时间:2021-07-01 10:21:17 帮助过:9人阅读
3. 生成停止mysql的脚本
vim /root/kill.sh 内容: #!/bin/bash service keepalived stop
4.脚本保存退出后重启keepalived
service keepalived restart
5.查看VIP是否生成
ip a
备份主机的操作
操作和主基本一致,需要更改的有:初始状态、优先级、真实服务器ip地址
1.复制主的keepalived的配置文件到服务器
scp 192.168.189.129:/etc/keepalived/keepalived.conf /etc/keepalived/keepalived.conf
2.编辑配置文件
vim /etc/keepalived/keepalived.conf
注意如下配置:
state BACKUP interface eth0 priority 90
real_server 192.168.189.130 3306
3. 生成停止mysql的脚本
vim /root/kill.sh 内容: #!/bin/bash service keepalived stop
4.更改完毕后重启keepalived
service keepalived restart
测试
停止主的mysql查看 VIP是否漂移到备份主机上,如成功飘逸则是配置成功
MySQL+keeplived高可用配置
标签:测试 vip ash 文件 start 虚拟 int oop 基础环境