MMM架构部署深度分析(3)

[root@monitor ~]# mmm_control show
  master1(192.168.4.10) master/AWAITING_RECOVERY. Roles:
  master2(192.168.4.11) master/AWAITING_RECOVERY. Roles:
  slave1(192.168.4.12) slave/AWAITING_RECOVERY. Roles:
  slave2(192.168.4.13) slave/AWAITING_RECOVERY. Roles:

设置4台数据库主机状态为online:

[root@monitor ~]# mmm_control set_online master1
OK: State of 'master1' changed to ONLINE. Now you can wait some time and check its new roles!
[root@monitor ~]# mmm_control set_online master2
OK: State of 'master2' changed to ONLINE. Now you can wait some time and check its new roles!
[root@monitor ~]# mmm_control set_online slave1
OK: State of 'slave1' changed to ONLINE. Now you can wait some time and check its new roles!
[root@monitor ~]# mmm_control set_online slave2
OK: State of 'slave2' changed to ONLINE. Now you can wait some time and check its new roles!
[root@monitor ~]#

再次查看当前集群中各服务器状态:

[root@monitor ~]# mmm_control show
  master1(192.168.4.10) master/ONLINE. Roles: writer(192.168.4.200)
  master2(192.168.4.11) master/ONLINE. Roles:
  slave1(192.168.4.12) slave/ONLINE. Roles: reader(192.168.4.201)
  slave2(192.168.4.13) slave/ONLINE. Roles: reader(192.168.4.202)
[root@monitor ~]#

步骤三:测试MySQL-MMM架构

1)客户机安装MySQL-client软件包

[root@client ~]# tar xvf MySQL-5.6.15-1.el6.x86_64.rpm-bundle.tar
.. ..
[root@client ~]# rpm -ivh MySQL-client-5.6.15-1.el6.x86_64.rpm
.. ..

2)MySQL-MMM虚拟IP访问测试

[root@client ~]# mysql -h192.168.4.200 -uroot -ppwd123 -e "show databases"
Warning: Using a password on the command line interface can be insecure.
+--------------------+
| Database          |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| tarena            |
| test              |
+--------------------+
[root@client ~]#
[root@client ~]# mysql -h192.168.4.200 -uroot -ppwd123 -e "show databases"
Warning: Using a password on the command line interface can be insecure.
+--------------------+
| Database          |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| tarena            |
| test              |
+--------------------+
[root@client ~]#
[root@client ~]# mysql -h192.168.4.202 -uroot -ppwd123 -e "show databases"
Warning: Using a password on the command line interface can be insecure.
+--------------------+
| Database          |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| tarena            |
| test              |
+--------------------+
[root@client ~]#

3)主数据库宕机测试

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/624708d7143f7f550c64c8067c1fdd2d.html