High Availability Configuration with mysql_mmm

Source: Internet
Author: User
ArticleDirectory
    • I. Software Packages
I. Software Packages

A) perl-Proc-Daemon-0.03-1.el5.noarch.rpm

B) perl-DBI-1.52-1.fc6.i386.rpm

C) perl-Algorithm-Diff-1.1902-2.el5.noarch.rpm

D) DBD-mysql-4.018.tar.gz

E) mysql-master-master-1.2.6.tar.gz

F) mysql-5.0.27.tar.gz

Ii. Installation Steps

A) nod1 IP 59.64.30.118 VIP 59.64.30.103 (read)

B) node2 IP 59.64.30.107 VIP 59.64.30.102 (read)

C) VIP 59.64.30.101 (writer)

D) Mgr 59.64.28.92 (Management node)

E) First, install the MySQL software and configure the MySQL master synchronization. (Data can be synchronized between the master and the master normally)

F) CD/var/local/software

G) rpm-IVH perl-Proc-Daemon-0.03-1.el5.noarch.rpm

H) rpm-IVH perl-DBI-1.52-1.fc6.i386.rpm

I) ln-S/usr/local/MySQL/lib/MySQL/libmysqlclient. so.15/bin/libmysqlclient. so.15

J) ln-S/usr/local/MySQL/lib/MySQL/libmysqlclient. so.15/usr/bin/libmysqlclient. so.15

K) ln-S/usr/local/MySQL/lib/MySQL/libmysqlclient. so.15/usr/lib/libmysqlclient. so.15

L) ln-S/usr/local/MySQL/lib/MySQL/libmysqlclient. so.15/usr/sbin/libmysqlclient. so.15

M) ln-S/usr/local/MySQL/lib/MySQL/libmysqlclient. so.15/sbin/libmysqlclient. so.15

N) tar zxvf DBD-mysql-4.018.tar.gz

O) CD DBD-mysql-4.018

P) perl makefile. pl -- With-mysql =/usr/local/MySQL -- mysql_config =/usr/local/MySQL/bin/mysql_config

Q) Make & make Test & make install

R) CD ../

S) rpm-IVH perl-Algorithm-Diff-1.1902-2.el5.noarch.rpm

T) tar zxvf mysql-master-master-1.2.6.tar.gz

U) CD mysql-master-master-1.2.6

V)./install. pl

W) CD/usr/local/Mmm/etc/examples/

X) CP mmm_agent.conf.example mmm_agent.conf

Y)> mmm_agent.conf

#

# Master-master manager config (agent)

#

# Debug mode

Debug No

# Paths

Pid_path/usr/local/Mmm/var/mmmd_agent.pid

Bin_path/usr/local/Mmm/bin

# Logging setup

Log mydebug

File/usr/local/Mmm/var/mmm-debug.log

Level debug

Log mytraps

File/usr/local/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 db1

Mode master

# For masters

Peer DB2

# Cluster hosts addresses and access Params

Host db1

IP 59.64.30.118

Port 3306

User rep_agent

Password 123456

Z) mV mmm_agent.conf ../

Aa) use the synchronization method to install mysql_mmm on another server

Bb) vi/usr/local/Mmm/etc/mmm_agent.conf

#

# Master-master manager config (agent)

#

# Debug mode

Debug No

# Paths

Pid_path/usr/local/Mmm/var/mmmd_agent.pid

Bin_path/usr/local/Mmm/bin

# Logging setup

Log mydebug

File/usr/local/Mmm/var/mmm-debug.log

Level debug

Log mytraps

File/usr/local/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 DB2

Mode master

# For masters

Peer db1

# Cluster hosts addresses and access Params

Host db1

IP 59.64.30.118

Port 3306

User rep_agent

Password 123456

A1) the following users are added at the same time to the two node servers MySQL.

Grant all privileges on *. * To 'rep _ agent' @ '%' identified by '000000' with grant option;

Grant all privileges on *. * To 'rep _ monitor' @ '%' identified by '000000' with grant option;

A2) install the mysql_mmm management node in synchronization mode

A3) vi/usr/local/Mmm/etc/mmm_mon.conf

# Master-master manager config (Monitor)

#

# Debug mode

Debug No

# Paths

Pid_path/usr/local/Mmm/var/mmmd. PID

Status_path/usr/local/Mmm/var/mmmd. Status

Bin_path/usr/local/Mmm/bin

# Logging setup

Log mydebug

File/usr/local/Mmm/var/mmm-debug.log

Level debug

Log mytraps

File/usr/local/Mmm/var/mmm-traps.log

Level trap

Email root @ localhost

# 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 db1

IP 59.64.30.118

Port 3306

User rep_monitor

Password 123456

Mode master

Peer DB2

Host DB2

IP 59.64.30.107

Port 3306

User rep_monitor

Password 123456

Mode master

Peer db1

#

# Define roles

#

Active_master_role writer

# MySQL reader role

Role Reader

Mode balanced

Servers db1, DB2

IP 59.64.30.103, 59.64.30.102 // This is a virtual IP address.

# MySQL writer role

Role writer

Mode exclusive

Servers db1, DB2

IP 59.64.30.101 // This is a virtual IP address.

#

# Checks Parameters

#

# Ping checker

Check Ping

Check_period 1

Trap_period 5

Timeout 2

# MySQL checker

# (Restarts after 10000 checks to prevent memory leaks)

Check MySQL

Check_period 1

Trap_period 2

Timeout 2

Restart_after10000

# MySQL replication backlog checker

# (Restarts after 10000 checks to prevent memory leaks)

Check rep_backlog

Check_period 5

Trap_period 10

Max_backlog 60

Timeout 2

Restart_after10000

# MySQL replication threads checker

# (Restarts after 10000 checks to prevent memory leaks)

Check rep_threads

Check_period 1

Trap_period 5

Timeout 2

Restart_after10000

A4) Start node1/usr/local/Mmm/sbin/mmmd_agent

A5) Start node2/usr/local/Mmm/sbin/mmmd_agent

A6) Start Mgr/usr/local/Mmm/sbin/mmm_mon start

A7) set db1 online mmm_control set_online db1

A8) set DB2 online mmm_control set_online DB2

A9) view the mmm_control show status

MySQL multi-master replication manager

Version: 1.2.6

Config File: mmm_mon.conf

Daemon is running!

====================================

Cluster failover method: Auto

====================================

Servers status:

Db1 (59.64.30.118): Master/online. Roles: reader (59.64.30.103;), writer (59.64.30.101 // This is a virtual IP address ;)

DB2 (59.64.30.107): Master/online. Roles: reader (59.64.30.102 // This is a virtual IP address ;)

3. Additional

A) because I didn't care about the master-slave synchronization, all of them were no, so an error was reported during the show process. I finally found the problem and fixed the master. The show operation was normal. When warning configuration, you must first ensure that the MySQL master/Master synchronization is normal. Configuration won't be a problem.

B. Installation of Perl Package is troublesome. I found many packages. Depressed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.