MHA Introduction
Preparing the Environment
1. Prepare three servers
2. Modify the host name (in two ways)
easily distinguish between each server
方式一
hostnamectl set-hostname 要修改的名字 //然后重新连接xshell就可以了
方式二
vim /etc/hostname //编辑配置文件,里面填写为修改后的名字,这个有一个注意的地方就是要重启服务器
3. The three machines are doing the same operation
1. Time Synchronization
echo "*/5 * * * * /usr/sbin/ntpade ntp1.aliyun.com >/del/null 2>&1" >>/var/spool/cron/root
2.hosts resolve
vim /etc/hosts ##加入以下内容
chen1 10.0.0.41
chen2 10.0.0.42
chen3 10.0.0.43
3. Turn off the firewall and SELinux
systemctl stop firewalld.service
systemctl disable firewalld.service
setenforce 0
4. Configure each other ssh login-free secret here is the script I realized may reference
https://blog.csdn.net/weixin_46164213/article/details/103901670
5. Install the above versions MySQL5.6
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum -y install mysql-server 安装
systemctl start mysqld 开启服务
6. Modify the MySQL password
mysql> update mysql.user set password=password('123456') where user='root' and host='localhost';
mysql> flush privileges;