Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Do HAProxy load balancing on domestic processor servers

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Environment

Hardware platform: home-made arm64 3399cpu Seaboat server

Operating system: sea boat server operating system 1.0A

When the user accesses the 192.168.125 address, haproxy is assigned to two servers, 192.168.1.7192.168.1.8. Achieve load sharing.

Root@bigdataA:/home/zs# apt-get install haproxy / / install the software

Root@bigdataA:/home/zs# nano / etc/haproxy/haproxy.cfg

#-

# main frontend which proxys to the backends

#-

Frontend main

Bind *: 80 / / detect port 80

Default_backend webserver

#-

# static backend for serving up images, stylesheets and such

#-

Backend webserver

Balance roundrobin / / polling mode

Server web1 192.168.1.7 2000ms 80 check / / default check the server once per server, 192.168.1.7 normal.

Server web2 192.168.1.8:80 check

Root@bigdataA:/home/zs# / etc/init.d/haproxy stop / / restart the server for the configuration to take effect

[ok] Stopping haproxy (via systemctl): haproxy.service.

Root@bigdataA:/home/zs# / etc/init.d/haproxy start

[ok] Starting haproxy (via systemctl): haproxy.service.

Root@bigdataA:/home/zs# netstat-an | more / / check whether the port is enabled

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address Foreign Address State

Tcp 0 0 0.0.0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0

Tcp 0 0 0.0.0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0

Tcp 0 64 192.168.1.125:22 192.168.1.6:1524 ESTABLISHED

Tcp6 0 0: 8080: * LISTEN

Tcp6 0 0: 22:: * LISTEN

Tcp6 00 127.0.0.1 8005:: * LISTEN

Tcp6 00: 8009: * LISTEN

Active UNIX domain sockets (servers and established)

Root@bigdataA:/home/zs#

Enter the address http://192.168.1.125, in the client browser to access the polling web page.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report