Home > Database > Mysql Tutorial > body text

MySQL的MMM高可用架构测试

WBOY
Release: 2016-06-07 17:11:03
Original
1049 people have browsed it

很显然,当DB1或DB2中的其中一台宕机之后,mmm都会立即将宕机的主机的角色全部转换到另一台DB。仔细分析Mmm的处理步骤大致是:db

一、架构模式(双master零slave)
==============================================================

MySQL的MMM高可用架构测试

一、架构模式(双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

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


ip 192.168.9.157
mode master
peer db2


ip 192.168.9.158
mode master
peer db1

#
# ip 192.168.100.51
# mode slave
#


hosts db1, db2 #能够作为writer的host
ips 192.168.100.250 #writer的虚拟IP,应用的写请求直接访问这里的ip即可
mode exclusive #只有两种模式:exclusive是排他,在这种模式下任何时候只能一个host拥有该角色,balanced模式下可以多个host同时拥有此角色。一般writer是ex,reader是ba


hosts db1, db2 #能够作为reader的host
ips 192.168.100.251, 192.168.100.252 #reader的虚拟IP,应用的读请求直接访问这里的ip即可
mode balanced

 
--------------------[2] mmm_mon.conf ———————–
include mmm_common.conf

ip 127.0.0.1
pid_path /var/run/mmm_mond.pid
bin_path /usr/lib/mysql-mmm/
status_path /var/lib/misc/mmm_mond.status
ping_ips 192.168.9.157, 192.168.9.158,192.168.9.254


monitor_user mmm_monitor
monitor_password RepMonitor

debug 0
 
------------------------[4] mmm_agent.conf  ——————–
include mmm_common.conf
this db1 #在DB1上就写成这样,DB2上就写成this db2,写错了,将有一台DB的mysql-mmm-agent开不起来!切记!

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!