1. 程式人生 > >mysql5.7+keepalived1.3.5搭建熱備服務器

mysql5.7+keepalived1.3.5搭建熱備服務器

mysql5.7雙機熱備 mysql5.7+keepalived1

1.規劃

系統 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搭建熱備服務器