mysql5.7+keepalived1.3.5搭建热备服务器
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql5.7+keepalived1.3.5搭建热备服务器相关的知识,希望对你有一定的参考价值。
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搭建热备服务器的主要内容,如果未能解决你的问题,请参考以下文章
搭建LNMP环境 (centos7+nginx+MySQL5.7.9+PHP7)
Centos7 搭建lnmp环境 (centos7+nginx+MySQL5.7.9+PHP7)