MySQL的MMM高可用架构测试
来源:未知 责任编辑:责任编辑 发表时间:2014-01-26 22:00 点击:次
一、架构模式(双master零slave)
==============================================================
==============================================================
---------------------[1] mmm_common.conf ——————–
主机:
功能 IP 主机名
monitor 192.168.9.159 proxy
DB db1 Server-id=1 192.168.5.157 fbfldb01
db2 Server-id=2 192.168.9.158 fbfldb02
虚拟ip:
IP0 192.168.9.154 (Write)
IP1 192.168.9.155 (Read)
IP2 192.168.9.156 (Read)
active_master_role writer
<host default>
cluster_interface eth0
pid_path /var/run/mysql-mmm/mmm_agentd.pid
bin_path /usr/libexec/mysql-mmm/
replication_user slave
replication_password slave
agent_user mmm_agent
agent_password RepAgent
</host>
<host db1>
ip 192.168.9.157
mode master
peer db2
</host>
<host db2>
ip 192.168.9.158
mode master
peer db1
</host>
#<host db3>
# ip 192.168.100.51
# mode slave
#</host>
<role writer>
hosts db1, db2 #能够作为writer的host
ips 192.168.100.250 #writer的虚拟IP,应用的写请求直接访问这里的ip即可
mode exclusive #只有两种模式:exclusive是排他,在这种模式下任何时候只能一个host拥有该角色,balanced模式下可以多个host同时拥有此角色。一般writer是ex,reader是ba
</role>
<role reader>
hosts db1, db2 #能够作为reader的host
ips 192.168.100.251, 192.168.100.252 #reader的虚拟IP,应用的读请求直接访问这里的ip即可
mode balanced
</role>
--------------------[2] mmm_mon.conf ———————–
include mmm_common.conf
<monitor>
==============================================================
==============================================================
---------------------[1] mmm_common.conf ——————–
主机:
功能 IP 主机名
monitor 192.168.9.159 proxy
DB db1 Server-id=1 192.168.5.157 fbfldb01
db2 Server-id=2 192.168.9.158 fbfldb02
虚拟ip:
IP0 192.168.9.154 (Write)
IP1 192.168.9.155 (Read)
IP2 192.168.9.156 (Read)
active_master_role writer
<host default>
cluster_interface eth0
pid_path /var/run/mysql-mmm/mmm_agentd.pid
bin_path /usr/libexec/mysql-mmm/
replication_user slave
replication_password slave
agent_user mmm_agent
agent_password RepAgent
</host>
<host db1>
ip 192.168.9.157
mode master
peer db2
</host>
<host db2>
ip 192.168.9.158
mode master
peer db1
</host>
#<host db3>
# ip 192.168.100.51
# mode slave
#</host>
<role writer>
hosts db1, db2 #能够作为writer的host
ips 192.168.100.250 #writer的虚拟IP,应用的写请求直接访问这里的ip即可
mode exclusive #只有两种模式:exclusive是排他,在这种模式下任何时候只能一个host拥有该角色,balanced模式下可以多个host同时拥有此角色。一般writer是ex,reader是ba
</role>
<role reader>
hosts db1, db2 #能够作为reader的host
ips 192.168.100.251, 192.168.100.252 #reader的虚拟IP,应用的读请求直接访问这里的ip即可
mode balanced
</role>
--------------------[2] mmm_mon.conf ———————–
include mmm_common.conf
<monitor>
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>