In this implementation, we will need three separate MySQL nodes and two HAProxy servers so that we guarantee our load balancer can fail over in case one of them fails. Keepalived will be installed in each HAProxy to control the Virtual IP. Different nodes in this setup will be assigned as the following:
- Virtual IP: 192.168.47.47
- HAProxy01: 192.168.47.120
- HAProxy02: 192.168.47.121
- MySQL01: 192.168.47.125
- MySQL02: 192.168.47.126
- MySQL03: 192.168.47.127
In order to implement HA on MySQL, go through the following steps:
- Let's start first by installing and configuring our HAProxy servers:
packtpub@haproxy1$ yum updatepacktpub@haproxy1$ yum install haproxy keepalived
- We check whether the HAProxy is properly installed: ...