一、环境部署
|
|
|
|
|
|
|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.配置主机名称
hostnamectl set-hostname mysql_managerhostnamectl set-hostname mysql_masterhostnamectl set-hostname mysql_slave1hostnamectl set-hostname mysql_slave2
2. 配置 hosts 文件
cat >> /etc/hosts << EOF10.132.47.60 mysql_manager10.132.47.61 mysql_master10.132.47.62 mysql_slave110.132.47.63 mysql_slave2EOF
3. 关闭防火墙和 SELinux
# 关闭防火墙systemctl stop firewalldsystemctl disable firewalld# 关闭SELinuxsetenforce 0sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
4. 配置 SSH 免密码登录
在 mysql_manager 节点执行:
# 生成密钥对ssh-keygen -t rsa -P "" -f ~/.ssh/id_rsa# 分发公钥到所有节点ssh-copy-id root@mysql_managerssh-copy-id root@mysql_masterssh-copy-id root@mysql_slave1ssh-copy-id root@mysql_slave2
二、安装 MySQL 8.0(所有数据库节点)
-
下载并安装 MySQL 源
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpmrpm -ivh mysql80-community-release-el7-3.noarch.rpm
导入 MySQL GPG 密钥
# 导入官方GPG密钥rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
强制安装 MySQL(跳过 GPG 验证,确保成功)
# 用--nogpgcheck参数跳过签名验证,直接安装yum install -y mysql-community-server --nogpgcheck
启动 MySQL 并设置开机自启
systemctl start mysqld && systemctl enable mysqld
-
获取初始密码并修改
#获取初始密码grep 'temporary password' /var/log/mysqld.log# 用初始密码登录(替换为实际密码)mysql -u root -p# 在MySQL命令行执行ALTER USER 'root'@'localhost' IDENTIFIED BY 'Shyshy521521!';FLUSH PRIVILEGES;#配置root远程访问use mysql;update user set host='%' where user='root';FLUSH PRIVILEGES;exit;
三、配置 MySQL 主从复制
1. 配置主库(mysql_master)
# 编辑配置文件vim /etc/my.cnf# 添加以下内容[mysqld]server_id = 1#复制集群中的各节点的id均必须唯一skip_name_resolve #关闭名称解析gtid-mode = on #启用gtid类型enforce-gtid-consistency = true #强制GTID的一致性log-slave-updates = 1#slave更新是否记入日志log-bin = mysql-bin #开启二进制日志relay-log = relay-log#开启中继日志
重启 MySQL:
systemctl restart mysqld
创建复制用户:
mysql -u root -pShyshy521521! -e "CREATE USER 'repl'@'%' IDENTIFIED BY 'Shyshy521521!'; GRANT REPLICATION SLAVE ON *.* TO 'repl'@'%'; FLUSH PRIVILEGES;"-- 切换到系统库USE mysql;-- 查看当前repl用户的认证插件SELECT user, host, plugin FROM user WHERE user = 'repl';-- 修改为mysql_native_password(不强制要求安全连接)ALTER USER 'repl'@'%' IDENTIFIED WITH mysql_native_password BY 'Shyshy521521!';#鉴于mysql8.0安全措施严重,所以配置为每个IP#主库CREATE USER 'repl'@'10.132.47.61' IDENTIFIED WITH mysql_native_password BY 'Shyshy521521!';GRANT REPLICATION SLAVE ON *.* TO 'repl'@'10.132.47.61';#slave1CREATE USER 'repl'@'10.132.47.62' IDENTIFIED WITH mysql_native_password BY 'Shyshy521521!';GRANT REPLICATION SLAVE ON *.* TO 'repl'@'10.132.47.62';#slave2CREATE USER 'repl'@'10.132.47.63' IDENTIFIED WITH mysql_native_password BY 'Shyshy521521!';GRANT REPLICATION SLAVE ON *.* TO 'repl'@'10.132.47.63';-- 刷新权限FLUSH PRIVILEGES;-- 退出主库exit;
查看主库状态
mysql -u root -pShyshy521521! -e "show master status\G"show master status;
记录 File 和 Position 的值,用于从库配置
2. 配置从库 1(mysql_slave1)
# 编辑配置文件vim /etc/my.cnf# 添加以下内容[mysqld]server_id = 2#复制集群中的各节点的id均必须唯一skip_name_resolve #关闭名称解析gtid-mode = on #启用gtid类型enforce-gtid-consistency = true #强制GTID的一致性log-slave-updates = 1#slave更新是否记入日志log-bin = mysql-bin #开启二进制日志relay-log = relay-log#开启中继日志read_only = ON #启用只读属性relay_log_purge = 0#是否自动清空不再需要中继日志
重启 MySQL 并配置主从:
systemctl restart mysqld# 配置主从复制mysql -u root -pShyshy521521!#设置主库连接信息(确保参数正确)CHANGE MASTER TOMASTER_HOST='10.132.47.61', -- 主库IPMASTER_USER='repl', -- 复制用户MASTER_PASSWORD='Shyshy521521!', -- 复制用户密码MASTER_LOG_FILE='mysql-bin.000001', -- 主库日志文件(需与主库show master status一致)MASTER_LOG_POS=849; -- 主库日志位置(需与主库show master status一致)-- 启动从库复制START SLAVE;# 查看从库状态mysql -u root -pShyshy521521!! -e "show slave status\G"-----------------------------------------------------------------------------------#主库强制要求安全连接的情况下配置:-- 先停止从库STOP SLAVE;-- 重新配置主库连接,启用SSLCHANGE MASTER TOMASTER_HOST='10.132.47.61',MASTER_USER='repl',MASTER_PASSWORD='Shyshy521521!',MASTER_LOG_FILE='mysql-bin.000001',MASTER_LOG_POS=849,MASTER_SSL=1; -- 启用SSL连接-- 启动从库START SLAVE;-- 查看状态SHOW SLAVE STATUS\G
3. 配置从库 2(mysql_slave2)
# 编辑配置文件vim /etc/my.cnf# 添加以下内容[mysqld]server_id = 3#复制集群中的各节点的id均必须唯一skip_name_resolve #关闭名称解析gtid-mode = on #启用gtid类型enforce-gtid-consistency = true #强制GTID的一致性log-slave-updates = 1#slave更新是否记入日志log-bin = mysql-bin #开启二进制日志relay-log = relay-log#开启中继日志read_only = ON #启用只读属性relay_log_purge = 0#是否自动清空不再需要中继日志
重启 MySQL 并配置主从:
systemctl restart mysqld# 配置主从复制mysql -u root -pShyshy521521!#设置主库连接信息(确保参数正确)CHANGE MASTER TOMASTER_HOST='10.132.47.61', -- 主库IPMASTER_USER='repl', -- 复制用户MASTER_PASSWORD='Shyshy521521!', -- 复制用户密码MASTER_LOG_FILE='mysql-bin.000001', -- 主库日志文件(需与主库show master status一致)MASTER_LOG_POS=849; -- 主库日志位置(需与主库show master status一致)
测试
#主库-- 1. 创建测试数据库CREATE DATABASE IF NOT EXISTS test_repl;-- 2. 切换到测试库USE test_repl;-- 3. 创建测试表CREATE TABLE IF NOT EXISTS user (id INT PRIMARY KEY AUTO_INCREMENT,name VARCHAR(50),age INT);-- 4. 插入测试数据INSERT INTO user (name, age) VALUES ('测试同步1', 20), ('测试同步2', 25);-- 5. 查看主库数据(确认插入成功)SELECT * FROM user;
#从库-- 1. 切换到同步过来的测试库USE test_repl;-- 2. 查看表和数据(若能看到主库插入的数据,说明同步成功)SELECT * FROM user;
所有节点配置授权
# 1. 登录MySQLmysql -uroot -pShyshy521521!# 2. 切换到MySQL命令行后,执行以下授权(拆分创建用户和授权)# (1)创建repl用户(主从复制用)+ 授权CREATE USER IF NOT EXISTS 'repl'@'10.132.47.%' IDENTIFIED BY 'Shyshy521521!';GRANT replication slave ON *.* TO 'repl'@'10.132.47.%';# (2)创建mha_admin用户(MHA管理用,网段授权)+ 授权CREATE USER IF NOT EXISTS 'mha_admin'@'10.132.47.%' IDENTIFIED BY 'Shyshy521521!';GRANT ALL PRIVILEGES ON *.* TO 'mha_admin'@'10.132.47.%' WITH GRANT OPTION;# (3)补充mha_admin主机名授权(去掉重复的slave1授权)CREATE USER IF NOT EXISTS 'mha_admin'@'mysql_master' IDENTIFIED BY 'Shyshy521521!';GRANT ALL PRIVILEGES ON *.* TO 'mha_admin'@'mysql_master' WITH GRANT OPTION;CREATE USER IF NOT EXISTS 'mha_admin'@'mysql_slave1' IDENTIFIED BY 'Shyshy521521!';GRANT ALL PRIVILEGES ON *.* TO 'mha_admin'@'mysql_slave1' WITH GRANT OPTION;CREATE USER IF NOT EXISTS 'mha_admin'@'mysql_slave2' IDENTIFIED BY 'Shyshy521521!';GRANT ALL PRIVILEGES ON *.* TO 'mha_admin'@'mysql_slave2' WITH GRANT OPTION;# (4)刷新权限,立即生效FLUSH PRIVILEGES;
四、安装配置 MHA
1. 安装依赖包(所有节点)
yum install -y epel-release perl-DBD-MySQL perl-Config-Tiny perl-Log-Dispatch perl-Parallel-ForkManager perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker --nogpgcheck
2. 安装 MHA node(所有数据库节点)
# 下载MHA node包wget https://github.com/yoshinorim/mha4mysql-node/releases/download/v0.58/mha4mysql-node-0.58-0.el7.centos.noarch.rpm# 安装rpm -ivh mha4mysql-node-0.58-0.el7.centos.noarch.rpm
3. 安装 MHA manager(仅 mysql_manager 节点)
# 下载MHA manager包wget https://github.com/yoshinorim/mha4mysql-manager/releases/download/v0.58/mha4mysql-manager-0.58-0.el7.centos.noarch.rpm# 安装rpm -ivh mha4mysql-manager-0.58-0.el7.centos.noarch.rpm
4. 创建 MHA 工作目录(仅 mysql_manager 节点)
# 创建配置目录mkdir -p /etc/mhamkdir -p /etc/mha/mysql_clustermkdir -p /var/log/mha/app1
5. 创建 MHA 配置文件(仅 mysql_manager 节点)
# 创建主配置文件vim /etc/mha/app1.cnf# 添加以下内容[server default]manager_workdir=/var/log/mha/app1manager_log=/var/log/mha/app1/manager.logmaster_binlog_dir=/var/lib/mysqluser=mha_adminpassword=Shyshy521521!ping_interval=1remote_workdir=/tmprepl_user=replrepl_password=Shyshy521521!ssh_user=rootsecondary_check_script=masterha_secondary_check -s mysql_slave1 -s mysql_slave2[server1]hostname=10.132.47.61port=3306[server2]hostname=10.132.47.62port=3306candidate_master=1[server3]hostname=10.132.47.63port=3306candidate_master=1
五、配置 MySQL 权限(所有数据库节点)
# 1. 先创建 root@mysql_manager 用户并设密码mysql -u root -pShyshy521521! -e "CREATE USER IF NOT EXISTS 'root'@'mysql_manager' IDENTIFIED BY 'Shyshy521521!'; FLUSH PRIVILEGES;"# 2. 给 root@mysql_manager 授予全量权限mysql -u root -pShyshy521521! -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'mysql_manager' WITH GRANT OPTION; FLUSH PRIVILEGES;"# 3. 先创建 root@mysql_master 用户并设密码mysql -u root -pShyshy521521! -e "CREATE USER IF NOT EXISTS 'root'@'mysql_master' IDENTIFIED BY 'Shyshy521521!'; FLUSH PRIVILEGES;"# 4. 给 root@mysql_master 授予全量权限mysql -u root -pShyshy521521! -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'mysql_master' WITH GRANT OPTION; FLUSH PRIVILEGES;"# 5. 先创建 root@mysql_slave1 用户并设密码mysql -u root -pShyshy521521! -e "CREATE USER IF NOT EXISTS 'root'@'mysql_slave1' IDENTIFIED BY 'Shyshy521521!'; FLUSH PRIVILEGES;"# 6. 给 root@mysql_slave1 授予全量权限mysql -u root -pShyshy521521! -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'mysql_slave1' WITH GRANT OPTION; FLUSH PRIVILEGES;"# 7. 先创建 root@mysql_slave2 用户并设密码mysql -u root -pShyshy521521! -e "CREATE USER IF NOT EXISTS 'root'@'mysql_slave2' IDENTIFIED BY 'Shyshy521521!'; FLUSH PRIVILEGES;"# 8. 给 root@mysql_slave2 授予全量权限mysql -u root -pShyshy521521! -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'mysql_slave2' WITH GRANT OPTION; FLUSH PRIVILEGES;"------------------------------------------------------------------------------------- 登录MySQLmysql -u root -pShyshy521521!-- 创建mha_admin@主库IP的用户并授权CREATE USER IF NOT EXISTS 'mha_admin'@'10.132.47.61' IDENTIFIED BY 'Shyshy521521!';GRANT ALL PRIVILEGES ON *.* TO 'mha_admin'@'10.132.47.61' WITH GRANT OPTION;-- 同理,在mysql_slave1(IP 10.132.47.62)执行:CREATE USER IF NOT EXISTS 'mha_admin'@'10.132.47.62' IDENTIFIED BY 'Shyshy521521!';GRANT ALL PRIVILEGES ON *.* TO 'mha_admin'@'10.132.47.62' WITH GRANT OPTION;-- 在mysql_slave2(IP 10.132.47.63)执行:CREATE USER IF NOT EXISTS 'mha_admin'@'10.132.47.63' IDENTIFIED BY 'Shyshy521521!';GRANT ALL PRIVILEGES ON *.* TO 'mha_admin'@'10.132.47.63' WITH GRANT OPTION;-- 刷新权限FLUSH PRIVILEGES;------------------------------------------------------------------------------------ 1. 给mha_admin授权(MHA管理用)CREATE USER IF NOT EXISTS 'mha_admin'@'10.132.47.60' IDENTIFIED WITH mysql_native_password BY 'Shyshy521521!';GRANT ALL PRIVILEGES ON *.* TO 'mha_admin'@'10.132.47.60' WITH GRANT OPTION;-- 2. 给repl授权(MHA检测复制用)CREATE USER IF NOT EXISTS 'repl'@'10.132.47.60' IDENTIFIED WITH mysql_native_password BY 'Shyshy521521!';GRANT REPLICATION SLAVE ON *.* TO 'repl'@'10.132.47.60';-- 3. 刷新权限生效FLUSH PRIVILEGES;-- 4. 验证SELECT user, host FROM mysql.user WHERE host='10.132.47.60';
六、测试 MHA 配置
1. 测试 SSH 连接(仅 mysql_manager 节点)
masterha_check_ssh --conf=/etc/mha/app1.cnf
2. 测试 MySQL 复制(仅 mysql_manager 节点)
masterha_check_repl --conf=/etc/mha/app1.cnf
七、启动 MHA Manager
1. 手动启动(仅 mysql_manager 节点)
nohup masterha_manager --conf=/etc/mha/app1.cnf --remove_dead_master_conf --ignore_last_failover < /dev/null > /var/log/mha/app1/manager.log 2>&1 &
2. 查看 MHA 状态(仅 mysql_manager 节点)
masterha_check_status --conf=/etc/mha/app1.cnf
八、配置脚本启动
vim /etc/init.d/masterha_managerd-----------------------------------------------------------------------------------#!/bin/bash# chkconfig: 35 80 20# description: MHA management script.STARTEXEC="/usr/bin/masterha_manager --conf"STOPEXEC="/usr/bin/masterha_stop --conf"CONF="/etc/mha/app1.cnf"process_count=`ps -ef |grep -w masterha_manager|grep -v grep|wc -l`PARAMS="--ignore_last_failover"case "$1" instart)if [ $process_count -gt 1 ]thenecho "masterha_manager exists, process is already running"elseecho "Starting Masterha Manager"$STARTEXEC $CONF $PARAMS < /dev/null > /var/log/mha/app1/manager.log 2>&1 &fi;;stop)if [ $process_count -eq 0 ]thenecho "Masterha Manager does not exist, process is not running"elseecho "Stopping ..."$STOPEXEC $CONFwhile(true)doprocess_count=`ps -ef |grep -w masterha_manager|grep -v grep|wc -l`if [ $process_count -gt 0 ]thensleep 1elsebreakfidoneecho "Master Manager stopped"fi;;*)echo "Please use start or stop as first argument";;esac------------------------------------------------------------------------------------chmod +x /etc/init.d/masterha_managerdchkconfig --add masterha_managerdchkconfig masterha_managerd on
测试服务脚本:
systemctl start masterha_managerdsystemctl status masterha_managerd-------------------------------------------------------------------------------------● masterha_managerd.service - SYSV: MHA management script.Loaded: loaded (/etc/rc.d/init.d/masterha_managerd; bad; vendor preset: disabled)Active: active (running) since Wed 2021-11-24 15:22:55 CST; 9s agoDocs: man:systemd-sysv-generator(8)Process: 25727 ExecStart=/etc/rc.d/init.d/masterha_managerd start (code=exited, status=0/SUCCESS)CGroup: /system.slice/masterha_managerd.service└─25733 perl /usr/bin/masterha_manager --conf /etc/mha/app1.cnf --ignore_last_failoverNov 24 15:22:54 node1.kongd.com systemd[1]: Starting SYSV: MHA management script....Nov 24 15:22:55 node1.kongd.com masterha_managerd[25727]: Starting Masterha ManagerNov 24 15:22:55 node1.kongd.com systemd[1]: Started SYSV: MHA management script..-------------------------------------------------------------------------------------ps -ef | grep -w masterha_managersystemctl stop masterha_managerdps -ef | grep -w masterha_manager
九、配置VIP漂移
vip配置可以采用两种方式,一种通过keepalived的方式管理虚拟ip的浮动;另外一种通过脚本方式启动虚拟ip的方式 (即不需要keepalived或者heartbeat类似的软件).
vim /usr/local/bin/master_ip_failover
#!/usr/bin/perluse strict;use warnings FATAL => 'all';use Getopt::Long;my ($command, $ssh_user, $orig_master_host, $orig_master_ip,$orig_master_port, $new_master_host, $new_master_ip, $new_master_port);# 1. 核心修改:适配你的网段和网卡(根据实际环境调整)my $vip = '10.132.47.64/24'; # 新增VIP,需和集群在同一网段(10.132.47.x)my $key = '1'; # VIP虚拟网卡别名(eth0:1)my $network_card = 'eth0'; # 集群节点实际网卡(根据节点网卡名称调整,默认eth0)# 2. 修复ifconfig命令(适配CentOS 7+,兼容ip命令,避免命令不存在)my $ssh_start_vip = "/sbin/ifconfig $network_card:$key $vip || ip addr add $vip dev $network_card";my $ssh_stop_vip = "/sbin/ifconfig $network_card:$key down || ip addr del $vip dev $network_card";GetOptions('command=s' => \$command,'ssh_user=s' => \$ssh_user,'orig_master_host=s' => \$orig_master_host,'orig_master_ip=s' => \$orig_master_ip,'orig_master_port=i' => \$orig_master_port,'new_master_host=s' => \$new_master_host,'new_master_ip=s' => \$new_master_ip,'new_master_port=i' => \$new_master_port,);exit &main();sub main {print "\n\nIN SCRIPT TEST====$ssh_stop_vip==$ssh_start_vip===\n\n";if ( $command eq "stop" || $command eq "stopssh" ) {my $exit_code = 1;eval {print "Disabling the VIP $vip on old master: $orig_master_host($orig_master_ip) \n";&stop_vip();$exit_code = 0;};if ($@) {warn "Got Error when stopping VIP: $@\n";exit $exit_code;}exit $exit_code;}elsif ( $command eq "start" ) {my $exit_code = 10;eval {print "Enabling the VIP $vip on new master: $new_master_host($new_master_ip) \n";&start_vip();$exit_code = 0;};if ($@) {warn "Got Error when starting VIP: $@\n";exit $exit_code;}exit $exit_code;}elsif ( $command eq "status" ) {print "Checking the Status of the VIP script.. OK \n";exit 0;}else {&usage();exit 1;}}# 启动VIP(在新主库执行)sub start_vip() {`ssh $ssh_user\@$new_master_host \"$ssh_start_vip\"`;# 检查VIP是否生效my $check = `ssh $ssh_user\@$new_master_host \"ifconfig $network_card:$key || ip addr show $network_card | grep $vip\"`;print "VIP start check result: $check\n" if $check;}# 停止VIP(在旧主库执行)sub stop_vip() {return 0 unless ($ssh_user && $orig_master_host);`ssh $ssh_user\@$orig_master_host \"$ssh_stop_vip\"`;# 检查VIP是否移除my $check = `ssh $ssh_user\@$orig_master_host \"ifconfig $network_card:$key || ip addr show $network_card | grep $vip\"`;print "VIP stop check result: No VIP found\n" unless $check;}sub usage {"Usage: master_ip_failover --command=start|stop|stopssh|status --orig_master_host=host --orig_master_ip=ip --orig_master_port=port --new_master_host=host --new_master_ip=ip --new_master_port=port\n";}
chmod +x /usr/local/bin/master_ip_failover
更改manager配置文件
vim /etc/mha/app1.cnf[server default]添加:master_ip_failover_script=/usr/local/bin/master_ip_failover
主库上,手工生成第一个vip地址
ifconfig eth0:1 10.132.47.64/24注意:第一次需要在主库上手动配置vipifconfig -a |grep -A 2 "eth0:1"
重启MHA
systemctl restart masterha_managerd
十、测试 MHA 故障转移
1.在 master 节点关闭 mysql 服务,模拟主节点数据崩溃
systemctl stop mysqld.service
2. 在 manger 节点查看日志
tail -1 /var/log/mha/app1/manager.log[root@mysql_manager app1]# tail -1 /var/log/mha/app1/manager.logMaster failover to 10.132.47.62(10.132.47.62:3306) completed successfully.
3. 检查VIP(新转移的主库上)
ifconfig -a |grep -A 2 "eth0:1"[root@mysql_slave1 ~]# ifconfig -a |grep -A 2 "eth0:1"eth0:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500inet 10.132.47.64 netmask 255.255.255.0 broadcast 10.132.47.255ether 0c:da:41:1d:d6:63 txqueuelen 1000 (Ethernet)
4.故障转移完成后, manager将会自动停止
masterha_check_status -conf=/etc/mha/app1.cnfapp1 is stopped(2:NOT_RUNNING).
5.提供新的从节点以修复复制集群
原有 master 节点故障后,需要重新准备好一个新的 MySQL 节点。基于来自于master 节点的备份恢复数据后,将其配置为新的 master 的从节点即可。注意,新加入的节点如果为新增节点,其 IP 地址要配置为原来 master 节点的 IP,否则,还需要修改 mha.cnf 中相应的 ip 地址。随后再次启动 manager ,并再次检测其状态。
新主库查看mysql -u root -p'Shyshy521521!' -e "show master status;"mysql: [Warning] Using a password on the command line interface can be insecure.+------------------+----------+--------------+------------------+-----------------------------------------------------------------------------------+| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |+------------------+----------+--------------+------------------+-----------------------------------------------------------------------------------+| mysql-bin.000001 | 8661 | | | 81697361-b633-11f0-bc1f-0cda411defbe:6-36,84573f1d-b633-11f0-bc21-0cda411dd663:1 |+------------------+----------+--------------+------------------+-----------------------------------------------------------------------------------+#新节点上进行操作systemctl start mysqldmysql -u root -p'Shyshy521521!'stop slave;change master to master_host='10.132.47.62', master_user='repl', master_password='Shyshy521521!', master_auto_position=1;start slave;show slave status\G | grep "Running:"# 查看从库状态mysql -u root -pShyshy521521!! -e "show slave status\G"
6.新节点提供后再次执行检查操作
#在mysql_manager上进行#添加配置:vim /etc/mha/app1.cnf[server1]hostname=10.132.47.61ssh_port=22candidate_master=1systemctl restart masterha_managerdmasterha_check_status -conf=/etc/mha/app1.cnfapp1 (pid:26445) is running(0:PING_O

