mysql5.7+keepalived1.3.5搭建熱備服務器
阿新 • • 發佈:2018-05-13
mysql5.7雙機熱備 mysql5.7+keepalived1 1.規劃
3.keepalived安裝
yum -y install keepalived
4.master<10.3.3.240>配置keepalived
配置文件中的nopreempt:是保證keepalived出現故障恢復後頻繁切換。
5.slave<10.3.3.208>配置keepalived
6.啟動keepalived:
systemctl start keepalived
7.查看VIP地址:
8.關閉master的keepalived:
systemctl stop keepalived
系統 | IP地址 | 軟件包及安裝方式 | 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.安裝準備
mysql主從或者mysql雙主,自行搭建這裏不再贅述。
註:mysql與keepalived最好在同一臺主機。mysql主從開啟遠程用戶
3.keepalived安裝
yum -y install keepalived
4.master<10.3.3.240>配置keepalived
配置文件中的nopreempt:是保證keepalived出現故障恢復後頻繁切換。
5.slave<10.3.3.208>配置keepalived
6.啟動keepalived:
systemctl start keepalived
7.查看VIP地址:
8.關閉master的keepalived:
systemctl stop keepalived
9.測試連接:
mysql5.7+keepalived1.3.5搭建熱備服務器