MHA+Lvs+Keepalived实现MySQL的高可用及读负载均衡_1(概览)
IP |
主机名 |
角色 |
MHA角色 |
192.168.15.11 |
MySQL-15.11 |
MySQL Master 主 |
Masterha-node |
192.168.15.12 |
MySQL-15.12 |
MySQL Slave1 从1 |
Masterha-node |
192.168.15.13 |
MySQL-15.13 |
MySQL Slave2 从2 |
Masterha-node |
192.168.15.14 |
MySQL-15.14 |
MySQL Slave3 从3 |
Masterha-node |
192.168.15.23 |
Lvs-15.23 |
Lvs 主 |
Masterha-manager |
192.168.15.24 |
Lvs-15.24 |
Lvs 从 |
Masterha-manager |
MySQL 写的VIP:192.168.15.95
MySQL 读的VIP:192.168.15.96
List:
1 MySQL 一主多从半同步复制架构搭建—> http://blog.csdn.net/u014749692/article/details/43192421
2 实现MySQL高可用的MHA安装及配置->http://blog.csdn.net/u014749692/article/details/43192447
3 实现Masterha-manager高可用及MySQL从的读负载均衡的Lvs+Keepalived安装及配置->http://blog.csdn.net/u014749692/article/details/43192499
部分用到的各软件在csdn的下载地址列表:
1 MHA的作者在谷歌code里的项目
http://download.csdn.net/detail/u014749692/8378011
2 mha4mysql-manager-0.56.tar.gz
http://download.csdn.net/detail/u014749692/8176759
3 mha4mysql-node-0.56.tar.gz
http://download.csdn.net/detail/u014749692/8176767
4 mysql-5.5.37.tar.gz
http://download.csdn.net/detail/u014749692/7390649
5 cmake-2.8.12.2
http://download.csdn.net/detail/u014749692/7274393
6 keepalived-1.2.12.tar.gz
http://download.csdn.net/detail/u014749692/8396867
7 ipvsadm-1.24.tar.gz
http://download.csdn.net/detail/u014749692/8396879
整个项目中涉及到IP变量的地方(若要改ip,检查下列文件):
-----Lvs服务器上
1 app1.cnf里的ip
2 check_masterha_manager里的vip
3 master_ip_failover里的vip
-----MySQL服务器上
1 /etc/cron.d/purge_relay_logs里的host
2 /etc/init.d/lvsrs