Dear Reader
I am facing little issue with mmm-mysql setup. Let
me explain you about configuration first
I have setup Master Master replication setup and 3 virtual Ips and 2
Ips for MySQL nodes.
Monitoring Node >> 192.168.100.96
DB1 >> 192.168.100.97 >> Node 1 >> Slave of DB2
DB2 >> 192.168.100.98 >> Node 2 >> Slave of DB1
Virutal IP >> 192.168.100.196 >> Writer
Virutal IP >> 192.168.100.197 >> Reader
Virutal IP >> 192.168.100.198 >> Reader
Monitor configurations file mmm_mon.conf is as follows
include mmm_common.conf
<monitor>
ip 192.168.100.96
pid_path /var/run/mysql-mmm/mmm_mond.pid
bin_path /usr/libexec/mysql-mmm
status_path /var/lib/mysql-mmm/mmm_mond.status
ping_ips 192.168.100.97, 192.168.100.98
auto_set_online 60
# The kill_host_bin does not exist by default, though the monitor
will
# throw a warning about it missing. See the section 5.10 "Kill
Host
# Functionality" in the PDF documentation.
#
# kill_host_bin /usr/libexec/mysql-mmm/monitor/kill_host
#
</monitor>
# Ping checker
<check ping>
check_period 3
trap_period 5
timeout 2
</check>
# Mysql checker
<check mysql>
check_period 3
trap_period 2
timeout 2
</check>
# Mysql replication backlog checker
<check rep_backlog>
check_period 5
trap_period 10
max_backlog 60
timeout 2
</check>
# Mysql replication threads checker
<check rep_threads>
check_period 3
trap_period 5
timeout 2
</check>
<host default>
monitor_user mmm_monitor
monitor_password monitor_password
</host>
debug 0
# File Ends here
common configuration file mmm_common.conf is as follows
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 replicant
replication_password mypwd
agent_user mmm_agent
agent_password agent_password
</host>
<host db1>
ip 192.168.100.97
mode master
peer db2
</host>
<host db2>
ip 192.168.100.98
mode master
peer db1
</host>
#<host db3>
# ip 192.168.100.51
# mode slave
#</host>
<role writer>
hosts db1, db2
ips 192.168.100.196
mode exclusive
</role>
<role reader>
hosts db1, db2
ips 192.168.100.197, 192.168.100.198
mode balanced
</role>
# File ends Here.
I have same copy of mmm_common.conf file across all three nodes
192.168.100.96, 192.168.100.97 and 192.168.100.98. and I have also
set three virtual IPs in the monitoring node as well.
I have also created following used credentials on both mysql nodes as
follows:
GRANT REPLICATION SLAVE ON *.* TO 'replicant'@'%' IDENTIFIED BY
'mypwd';
GRANT REPLICATION CLIENT ON *.* TO 'mmm_monitor'@'%' IDENTIFIED BY
'monitor_password';
GRANT SUPER, REPLICATION CLIENT, PROCESS ON *.* TO 'mmm_agent'@'%'
IDENTIFIED BY 'agent_password';
I have used % sign in all three statements to make sure that
everything is accessible. I have also edited both mmm_agent.conf files
on DB1 and DB2 as follows
>> File from DB1
#File starts here
include mmm_common.conf
# The 'this' variable refers to this server. Proper operation
requires
# that 'this' server (db1 by default), as well as all other servers,
have the
# proper IP addresses set in mmm_common.conf.
this db1
debug 1
#File Ends here
>> File from DB2
#File starts here
include mmm_common.conf
# The 'this' variable refers to this server. Proper operation
requires
# that 'this' server (db1 by default), as well as all other servers,
have the
# proper IP addresses set in mmm_common.conf.
this db2
debug 1
#File Ends here
This is all about configuration i have. Now When i start monitor and
agents, MySQL on both Nodes everything works fine. In between when
everything is running i get message in one of the mmm_agent log files
stating
2011/06/07 14:12:40 FATAL Couldn't allow writes: ERROR: Can't connect
to MySQL (host =
192.168.100.97:3306, user = mmm_agent)! Can't connect
to MySQL server on '192.168.100.97' (4)
This error message is not permanent however after lets say after half
an hour
or 15 mins. It sometimes comes on Db1 and sometimes on DB1.
I also checked user credentials on both DB nodes just make sure that i
am able to login in specific user credentials
I tried login to MySQL on Node 1 and Node 2 using following command
mysql -u mmm_agent -h 192.168.100.98 -p
and
mysql -u mmm_agent -h 192.168.100.97 -p
I am able to login using above credentials. It means mmm_agent has
access to mysql on both nodes.
So I want to know why i am getting error message
2011/06/07 14:12:40 FATAL Couldn't allow writes: ERROR: Can't connect
to MySQL (host =
192.168.100.97:3306, user = mmm_agent)! Can't connect
to MySQL server on '192.168.100.97' (4)
in between entire process. How come mmm_agent is not able to connect
to MySQL after 15 mins or 30 mins during entire process.
Please advice am i doing anything wrong.