Multi-Master Replication Manager for MySQL FAQ

本文档解答了关于MySQL多主复制管理器(MMM)的一些常见问题,包括如何将从库提升为第二个主库,配置错误的解决办法,如何在同一个监控主机上监测多个集群,以及权限和依赖问题。同时,提到了MMM软件已被弃用,建议考虑使用MHA或增强版的MySQL Multi-Master-Manager。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I have one master and many slaves and want to promote one slave to become a second master. Does this work?

Yes. Set up master-master replication (don’t forget log_slave_updates, etc.), then change mmm config and finally restart agents/monitor.

FATAL Listener: Can’t create socket!

When I try to start the agent these messages are repeatedly logged:

2009/10/30 20:08:59 FATAL Child exited with exitcode 99, restarting
2009/10/30 20:08:59 FATAL Listener: Can't create socket!

→ For some reason the agent tries to listen on an IP that is not configured on the host. Check your configuration and be sure that you have not mistyped anything. Be sure to also check the this configuration directive.

Is it possible to monitor multiple clusters from the same monitoring host?

Yes, you can run multiple instances of mmm_mond on the same host. You have to copy the init-script and adjust the ‘CLUSTER’ variable (e.g. CLUSTER=’C1’). The config file for this second instance should be named mmm_mon_C1.conf instead of mmm_mon.conf. You also have to adjust some things in the section of the config (choose a unique port number, default is 9988):

pid_path /var/run/mmmd_mon_C1.pid
port     9990

To control this cluster you can use mmm_control @C1 - e.g.:

mmm_control @C1 show

FATAL Configuration file /etc/mysql-mmm/mmm_mon.conf is world writable!

mon:/etc/mysql-mmm # chmod 640 mmm_common.conf
mon:/etc/mysql-mmm # ll
total 16
-rw-r----- 1 root root   42 Sep  2 10:38 mmm_agent.conf
-rw-r----- 1 root root 1131 Sep  2 08:19 mmm_common.conf
-rw-r----- 1 root root  321 Sep  1 14:12 mmm_mon.conf
-rw-r----- 1 root root 1293 Sep  1 14:12 mmm_tools.conf

FATAL Child exited with exitcode 255, restarting after 10 second sleep

vi /etc/mysql-mmm/mmm_mon.conf
deubg 1
mon:/etc/init.d/mysql-mmm-monitor start
Daemon bin: '/usr/sbin/mmm_mond'
Daemon pid: '/var/run/mmm_mond.pid'
Starting MMM Monitor daemon: 2013/08/07 14:25:25 INFO STARTING...
2013/08/07 14:25:25 DEBUG Created pid file '/var/run/mmm_mond.pid' with pid 8982
2013/08/07 14:25:25 INFO Waiting for network connection...
2013/08/07 14:25:25 INFO Spawning checker 'ping_ip'...
2013/08/07 14:25:25 DEBUG IP '192.168.235.57' is reachable: OK
2013/08/07 14:25:25 INFO Shutting down checker 'ping_ip'...
2013/08/07 14:25:25 INFO Network connection is available.
Use of uninitialized value $old_state in string ne at /usr/local/lib/perl5/5.18.0/MMM/Monitor/Agent.pm line 42.
2013/08/07 14:25:25 FATAL Child exited with exitcode 255, restarting after 10 second sleep

I added the following code to /usr/share/perl5/MMM/Monitor/Agent.pm on line 41.

if (! defined($old_state)) { $old_state = 'certinally not new_state'; }

Looking forward to migrating off mmm to corosync/pacemaker.

FATAL Couldn’t configure IP ‘192.168.1.202’ on interface ‘em1’: undef

mon:/home/mysql-mmm-master# ifconfig
eth0      Link encap:Ethernet  HWaddr 98:90:96:d9:a8:1d
          inet addr:192.168.1.19  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::9a90:96ff:fed9:a81d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:696674 errors:0 dropped:0 overruns:0 frame:0
          TX packets:720489 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:186888073 (178.2 MiB)  TX bytes:60360726 (57.5 MiB)
          Interrupt:20 Memory:f7d00000-f7d20000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:109000 errors:0 dropped:0 overruns:0 frame:0
          TX packets:109000 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3082361 (2.9 MiB)  TX bytes:3082361 (2.9 MiB)
vi /etc/mysql-mmm/mmm_common.conf

cluster_interface                eth0

FATAL Child exited with exitcode 2, restarting after 10 second sleep
FATAL Child exited with exitcode 25, restarting after 10 second sleep

vi /etc/mysql-mmm/mmm-agent.conf
debug 1

ex :
Starting MMM Monitor daemon: Can not locate Proc/Daemon.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/sbin/mmm_mond line 11.

Install dependencies:

On Ubuntu

aptitude install liblog-log4perl-perl libmailtools-perl liblog-dispatch-perl iproute libnet-arp-perl libproc-daemon-perl libalgorithm-diff-perl libdbi-perl libdbd-mysql-perl

On RedHat

yum install -y mysql-mmm-agent
This will take care of all the dependencies, which may include:

Other

Visit to https://metacpan.org then search modules and download them.

tar xvf Proc-Daemon-0.21.tar.gz
cd Proc-Daemon-0.21
perl Makefile.pl
make
make install

PS:
DBI module need gcc envirment.
DBD::mysql module need install libmysqld-devel.

FATAL Can’t reach agent on host ‘db2’
FATAL Agent on host ‘db2’ is reachable again

check firewall or network

ex : openSUSE

vi /etc/sysconfig/SuSEfirewall2

FW_SERVICES_EXT_TCP="22 3306 9989"

FATAL exec ‘/usr/lib/mysql-mmm/agent/get_master_log_file’ Permission denied on ‘/usr/lib/perl5/vendor_perl/5.20.1/MMM/Agent/Agent.pm’ on line xxx.
FATAL exec ‘/usr/lib/mysql-mmm/agent/get_master_log_pos’ Permission denied on ‘/usr/lib/perl5/vendor_perl/5.20.1/MMM/Agent/Agent.pm’ on line xxx.
FATAL exec ‘/usr/lib/mysql-mmm/agent/kill_process’ Permission denied on ‘/usr/lib/perl5/vendor_perl/5.20.1/MMM/Agent/Agent.pm’ on line xxx.

db1:/usr/lib/mysql-mmm/agent # chmod 755 get_master_log_* kill_process

At last,MMM software is deprecated.
Please consider using something more actively developed like MHA
https://code.google.com/p/mysql-master-ha/

or

Enhanced MySQL Multi-Master-Manager based on Google’s “mysql-mmm 2.2.1”.
https://github.com/cenalulu/mysql-mmm

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值