8、启动监控[root@linux-node1 ~]# nohup masterha_manager --conf=/etc/mha/app1.cnf --remove_dead_master < /dev/null > /var/log/mha/app1/manager.log 2>&1 &[1] 20640[root@linux-node1 ~]# masterha_check_status --conf=/etc/mha/app1.cnf app1 monitoring program is now on initialization phase(10:INITIALIZING_MONITOR). Wait for a while and try checking again.
9、测试(1)停止主库[root@linux-node1 ~]# /etc/init.d/mysqld stopShutting down MySQL............ SUCCESS! (2)登录从库查看,node2变成了主库,node3的主库ip变成了192.168.56.12[root@linux-node2 ~]# mysql -uroot -p123456Welcome to the MariaDB monitor.Commands end with ; or g.Your MySQL connection id is 24Server version: 5.7.18-log MySQL Community Server (GPL)Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.MySQL [(none)]> show master status;+------------------+----------+--------------+------------------+-------------------+| File| Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |+------------------+----------+--------------+------------------+-------------------+| mysql-bin.000005 |154 ||||+------------------+----------+--------------+------------------+-------------------+1 row in set (0.00 sec)[root@linux-node3 ~]# mysql -uroot -p123456mysql> show slave statusG*************************** 1. row ***************************Slave_IO_State: Waiting for master to send eventMaster_Host: 192.168.56.12Master_User: repMaster_Port: 3306Connect_Retry: 60Master_Log_File: mysql-bin.000005Read_Master_Log_Pos: 154Relay_Log_File: linux-node3-relay-bin.000002Relay_Log_Pos: 320Relay_Master_Log_File: mysql-bin.000005Slave_IO_Running: YesSlave_SQL_Running: Yes
推荐阅读
- MySQL中的行级锁,表级锁,页级锁
- 霍山黄芽之瓦坛贮存法,如何用金属罐贮存霍山黄芽
- 快手早餐之鸡蛋葱油饼的做法
- 我想种植黄茶在哪里购买黄茶苗,中国黄茶之乡在哪里
- 黄茶的独特性表现在哪里呢,中国黄茶之乡在哪里
- 岳阳黄茶产自哪里,中国黄茶之乡在哪里
- 小风暴之时间的玫瑰郑婉莹结局 小风暴之时间的玫瑰高山的仇人是谁
- 十大名茶之六安瓜片的简述
- 茶道与茶艺,茶文化知识之茶艺
- 如果是MySQL引起的CPU消耗过大,你会如何优化?