当前位置: 代码迷 >> 综合 >> MHA相关命令
  详细解决方案

MHA相关命令

热度:37   发布时间:2023-09-27 11:23:40.0

1、检查SSH配置(监控节点)


masterha_check_ssh --conf=/etc/masterha/ app1.cnf

2、检查整个集群的复制情况 (监控节点)

masterha_check_repl --conf=/etc/masterha/app1.cnf

(记得:set global read_only=1;

3、MHA监控启动及关闭(监控节点)

启动:nohup masterha_manager --conf=/etc/masterha/app1.cnf --remove_dead_master_conf --ignore_last_failover < /dev/ null > /var/log/masterha/app1/manager.log 2 >& 1 &
关闭:masterha_stop --conf=/etc/masterha/ app1.cnf

4、查看MHA监控状态 (监控节点)
masterha_check_status --conf=/etc/masterha/ app1.cnf

5、查看MHA监控日志 (监控节点)
tail -n20 /var/log/masterha/app1/manager.log

6、keepalived配置文件(master及备master)
cat /etc/keepalived/ keepalived.conf

7、MHA在线切换 masterha_master_switch --conf=/etc/masterha/app1.cnf --master_state=alive --new_master_host= 192.168 .1 .113 --new_master_port= 3306 --orig_master_is_new_slave --running_updates_limit= 10000

  相关解决方案