Please enter your e-mail address & password to login to the VPS.net customer portal

The VPS Cloud Wiki

Load Balancer

Open /etc/haproxy/haproxy.cfg,  at the bottom change 127.0.0.1:8080 + 127.0.0.1:8081 to the IP+Port of the servers you would like to balance.  You can add more by simply adding a new line at the bottom,  for example to add web3 with the ip of 192.168.1.105 on port 80 simply add,

server web3 192.168.1.105:80 weight 1 minconn 4 maxconn 4000 slowstart 30000 maxqueue 100 check inter 20000

To the bottom of the file.

The web stats section of haproxy is enabled with the default pass of vpsNET66,  ensure to change this to a more suitable password by changing the following line,

stats auth        admin:vpsNET66  # force HTTP Auth to view stats

Once you have configured these 2 items,  simply restart haproxy (/etc/init.d/haproxy restart) and the balancer should begin to work immediately.  You can view the stats and determine which servers it was able to successfully establish a connection to and is presently balancing (will show as green) at http://SERVERIP/haproxy?stats with the username and password you defined (Default admin:vpsNET66)


Rate this Article 1 Star2 Stars3 Stars4 Stars5 Stars (16 Ratings)
Help us improve the wiki Send Your Comments