MySQL---MMM 搭建及测试(四)

2014-11-24 18:34:56 · 作者: · 浏览: 1
dr
*********************************************************************************************************************************
1: lo: mtu 16436 qdisc noqueue
inet 127.0.0.1/8 scope host lo
2: eth0: mtu 1500 qdisc pfifo_fast qlen 1000
inet 192.168.204.128/24 brd 192.168.204.255 scope global eth0
inet 192.168.204.202/32 scope global eth0
inet 192.168.204.201/32 scope global eth0
*********************************************************************************************************************************

sdw_2
# ip -f inet addr

*********************************************************************************************************************************
1: lo: mtu 16436 qdisc noqueue
inet 127.0.0.1/8 scope host lo
2: eth0: mtu 1500 qdisc pfifo_fast qlen 1000
inet 192.168.204.129/24 brd 192.168.204.255 scope global eth0
inet 192.168.204.203/32 scope global eth0
*********************************************************************************************************************************

6.上拓扑架构图:
Two Node:




Two master+One/Many slave:


7.补充信息:
mmm_mon在每台服务器上执行四种不同的检查,以确定相关服务是否OK:
1)ping host is pingable
2)mysql MySQL server on the host is alive

3)rep_threads replication threads are running
4)rep_backlog replication backlog is not too big

Modes:
1)Active Mode :
The monitor will remove roles from failed hosts and assign them to other hosts automatically.
2)Manual Mode:
The monitor will only distribute balanced roles across the hosts,
but will not remove roles from failed hosts automatically.
You can remove roles from failed hosts manually with move_role.
3)Wait mode :
Like MANUAL mode, but mode will be changed into ACTIVE mode
when both master hosts are ONLINE or after wait_for_other_master seconds have elapsed.
4)Passive mode:
In passive mode the monitor doesn't change roles, update the status file nor send anything to agents.
In passive mode you can modify roles (unclean) with set_ip - the changes won't be applied
until the monitor is switched to ACTIVE or MANUAL mode with set_active or set_manual.
Passive mode will be entered if conflicting roles are detected during startup.
You should then analyze the situation, fix the role information (if needed) and switch into ACTIVE
or MANUAL mode. It also can be entered manually with set_passive.

(四)相关测试性试验:
以下每次的测试均基于环境:
sdw_1 : VIP(Reader)192.168.204.202 VIP(Write):192.168.204.201
sdw_2: VIP(Reader)192.168.204.203

1.动作: sdw_2上, 停止mysql服务, # mysqladmin -u xxx -pxxxx shutdown
结果: sdw_2上的VIP(192.168.204.203)会自动迁移到 sdw_1上

2.动作: sdw_1上,停止MySQL服务, # mysqladmin -u xxx -pxxxx shutdown
结果: sdw_1上,负责读的VIP(192.168.204.202) 以及负责写的VIP(192.168.204.201)