1. Planning
system |
IP Address |
Package and Installation method |
VIP |
CentOS 7.3.1611 |
10.3.3.240<master> |
mysql5.7<rpm>; Keepalived-1.3.5-6<yum> |
10.3.3.99 |
CentOS 7.3.1611 |
10.3.3.208<slave > |
Mysql5.7<rpm>;keepalived-1.3.5-6<yum> |
10.3.3.99 |
2. Installation Preparation
MySQL master or MySQL dual-owner, self-built here no longer repeat.
Note: MySQL and keepalived are best on the same host. MySQL master-slave open remote user
3.keepalived Installation
Yum-y Install keepalived
4.master<10.3.3.240> Configuration keepalived
nopreempt in the configuration file: It is guaranteed to switch frequently after keepalived failure recovery .
5.slave<10.3.3.208> Configuration keepalived
6. Start keepalived:
Systemctl Start keepalived
7. View VIP Address:
8. Turn off Master's keepalived:
Systemctl Stop keepalived
9. Test the connection:
mysql5.7+keepalived1.3.5 Building a hot standby server