Issue link: https://read.uberflip.com/i/1334488
In the Datacenter 234 6. Having a single HA Proxy server sitting in front of our multi-master MySQL cluster makes the HA Proxy server our single point of failure. To overcome this, we repeat the previous steps for our second HA Proxy server, and then we use a simple solution provided by keepalived for VRRP (Virtual Redundant Router Protocol) management. To do this, we need to install keepalived on our HA Proxy servers. Like before, we will configure one server then repeat the steps for our second server. We do this as follows: sudo apt-get update sudo apt-get -y install keepalived 7. To allow running software to bind to an address that does not physically exist on our server, we add in an option to sysctl.conf, to allow this. Add the following line to /etc/sysctl.conf: net.ipv4.ip_nonlocal_bind=1 8. To pick up the change, issue the following command: sudo sysctl -p 9. We can now configure keepalived. To do this, we create a /etc/keepalived/ keepalived.conf file with the following contents: vrrp_script chk_haproxy { script "killall -0 haproxy" # verify the pid exists or not interval 2 # check every 2 seconds weight 2 # add 2 points if OK } vrrp_instance VI_1 { interface eth1 # interface to monitor state MASTER virtual_router_id 51 # Assign one ID for this route priority 101 # 101 on master, 100 on backup virtual_ipaddress { 172.16.0.30 # the virtual IP } track_script { chk_haproxy } } 10. We can now start up keepalived on this server, by issuing the following command: sudo service keepalived start www.it-ebooks.info

