MySQL双主+Keepalived高可用6
5.2 同步测试https://common.cnblogs.com/images/copycode.gif1 # mysql -uroot -p2 Enter password:3 mysql> create database mysqltest;4 mysql> use mysqltest;5 mysql> create table user(id int(5),name char(10));6 mysql> insert into user values (00001,'zhangsan');7 在Slave从服务器上进行验证:8 # mysql -uroot -p9 Enter password: 10 mysql> show databases; 11 mysql> select * from mysqltest.user;https://common.cnblogs.com/images/copycode.gif
https://img2018.cnblogs.com/blog/680719/201811/680719-20181105120735694-980314131.png5.3 测试Keepalived切换1 # service mysqld stop #停止Master01的MySQL2 # tail -f /var/log/messages #观察Master01的日志
https://img2018.cnblogs.com/blog/680719/201811/680719-20181105120736348-444750459.png1 # tail -f /var/log/messages #观察Master02的日志
https://img2018.cnblogs.com/blog/680719/201811/680719-20181105120737209-1947766101.png1 # mysql -uroot -h172.24.8.12 -px120952576 #客户端连接VIP
https://img2018.cnblogs.com/blog/680719/201811/680719-20181105120737775-712006715.png注意:已经成功切换,在切换过程中可能中断几秒。
页:
[1]