Keepalived+HAProxy实现MySQL高可用负载均衡的配置

2019-01-04 16:01:32王旭

测试:

通过vip10.1.6.173 3366访问cluster数据库(注意账户dave权限需要加3个ip10.1.6.203,10.1.6.205,10.1.6.173)

root@10.1.6.203:mgm# mysql -udave -p -h 10.1.6.173 -P 3366 Enter password: Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 1344316 Server version: 5.5.22-ndb-7.2.6-gpl-log MySQL Cluster Community Server (GPL) Type 'help;' or 'h' for help. Type 'c' to clear the buffer. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | dave | | test | +--------------------+ 3 rows in set (0.01 sec) mysql>

手动分别使keepalive,haproxy,数据库挂掉.vip10.1.6.173会自动漂到10.1.6.205从上,并不影响vip的访问

通过vip,haproxy查看各节点状态

http://10.1.6.173:8888/status

2016228164844383.jpg (1158×481)

您可能感兴趣的文章:

LVS+Keepalived构建高可用负载均衡(测试篇)LVS+Keepalived构建高可用负载均衡配置方法(配置篇)haproxy+keepalived实现高可用负载均衡(实例配置)haproxy+keepalived实现高可用负载均衡(理论篇)keepalived实现nginx高可用