-
Notifications
You must be signed in to change notification settings - Fork 36
Installation of haproxy
anjalysuresh edited this page Feb 2, 2018
·
7 revisions
- First thing let’s upgrade the packages:
sudo apt-get update
sudo apt-get -y upgrade
- Install haproxy
sudo apt-get install haproxy -y
- Enable haproxy
sudo vi /etc/default/haproxy
The variable ‘Enabled’ is set 0. Set it to 1 as shown below
ENABLED=1
Save and exit
- Configure haproxy
sudo vi /etc/haproxy/haproxy.cfg
Add the following lines at the end of file
#frontend haproxy_in
frontend http_front
bind *:80
default_backend http_back
#backend haproxy_http
backend http_back
balance roundrobin
mode http
server vm1 10.129.26.148:80 check
server vm2 10.129.26.188:80 check
- Restart and test haproxy
sudo /etc/init.d/haproxy restart
Open the browser and check the url which haproxy is installed
http://10.129.26.119
- Check access log for haproxy in both vms
sudo vi /home/collaboration/tester/logs/nginx-access.log(in 10.129.26.148)
or
sudo vi /home/edx/logs/nginx-access.log(10.129.26.188)
Collaborative Community
Contents