|
ConfigurationExamples
Config file examples with a short description.
IntroductionDetailed description of this example configuration could be found in “Typical use-cases of mmm-deployment” document. Master-master replication exampleLet’s take a look at an example configuration file for such configuration. Every deployment of mmm requires N+1 installation where N is number of MySQL servers and 1 is monitoring server (can be combined with application server). Following examples would be named as mmm_mon.conf for monitoring server and mmm_agent.conf for database servers. mmm_mon.conf: #
# Master-Master Manager config (monitor)
#
# Debug mode
debug no
# Paths
pid_path /opt/mmm/var/mmmd.pid
status_path /opt/mmm/var/mmmd.status
bin_path /opt/mmm/bin
# Logging setup
log mydebug
file /opt/mmm/var/mmm-debug.log
level debug
log mytraps
file /opt/mmm/var/mmm-traps.log
level trap
# MMMD command socket tcp-port
bind_port 9988
agent_port 9989
monitor_ip 127.0.0.1
# Cluster interface
cluster_interface eth0
# Cluster hosts addresses and access params
host master1
ip 192.168.1.8
port 3306
user rep_monitor
password RepMonitor
mode master
peer master2
host master2
ip 192.168.1.9
port 3306
user rep_monitor
password RepMonitor
mode master
peer master1
#
# Define roles
#
active_master_role writer
# Mysql Reader role
role reader
mode balanced
servers master1, master2
ip 192.168.1.100, 192.168.1.101
# Mysql Writer role
role writer
mode exclusive
servers master1, master2
ip 192.168.1.200
#
# Checks parameters
#
# Ping checker
check ping
check_period 1
trap_period 5
timeout 2
# Mysql checker
check mysql
check_period 1
trap_period 2
timeout 2
# Mysql replication backlog checker
check rep_backlog
check_period 5
trap_period 10
max_backlog 60
timeout 2
# Mysql replication threads checker
check rep_threads
check_period 1
trap_period 5
timeout 2In this config file I want to highlight few sections:
mmm_agent.conf: #
# Master-Master Manager config (agent)
#
# Debug mode
debug no
# Paths
pid_path /opt/mmm/var/mmmd_agent.pid
bin_path /opt/mmm/bin
# Logging setup
log mydebug
file /opt/mmm/var/mmm-debug.log
level debug
log mytraps
file /opt/mmm/var/mmm-traps.log
level trap
# MMMD command socket tcp-port and ip
bind_port 9989
# Cluster interface
cluster_interface eth0
# Define current server id
this master1
mode master
# For masters
peer master2
# Cluster hosts addresses and access params
host master1
ip 192.168.1.8
port 3306
user rep_monitor
password RepMonitor
host master2
ip 192.168.1.9
port 3306
user rep_monitor
password RepMonitor
All other config sections are pretty straightforward and described in detail in configuration files section of MMM guide. |
Sign in to add a comment
Is it correct to have 192.168.1.201 in role writer section? I supposed that we just move 192.168.1.200 between servers..
# Mysql Writer role role writer
I have the same question. was this question ever resolved? it is from march (!!)
It was an error. The following is correct:
role writer
log level is: trap, error, notice, warn, debug 'trap' = 0; 'error' = 10; 'notice' = 20; 'warn' = 30; 'debug' = 100;
I am experiencing a connection problem after moving writer role to another machine or setting one db is offline. I need wait for several minutes for a ready connection. Sometimes the waiting time is 7 minutes. To be clear,
If I move the writer to db2, then connection to 209.134.190.120 cannot be established immediately, instead, my perl script is timed out. After that, the connection resumes.
How can I work around this?
Thank you,
Coway
This example is outdated. Make sure to look at the examples that come with the project source instead.