반응형
l MMM (MySQL Multi-Master Manager) INSTALLATION
<Server Allocation>
Name | IP | Host Name | Server ID |
Monitor | 10.1.1.111 | mon | - |
Master 1 | 10.1.1.121 | db1 | 1 |
Master 2 | 10.1.1.131 | db2 | 2 |
<Virtual IPs Allocation>
IP | ROLE | DB Work Grantee |
10.1.1.211 | writer | write only |
10.1.1.221 | reader | read only |
10.1.1.231 | reader | read only |
<Install MMM>
## Dual-Repl. MySQL 구성 및 초기 설치과정은 기존 참고자료들을 참고하도록 생략.
## MySQL Server Configuration File에 Parameter Value 추가 (MySQL node both)
- /etc/my.cnf
. . . # Setting For Replication (db1) binlog_cache_size=4M max_binlog_size=512M expire_logs_days = 2 relay-log-purge = 1 log_slave_updates = 1 skip-slave-start auto_increment_increment = 2 auto_increment_offset = 1 # Set Unique Value to Both Server bind-address = 0.0.0.0 . . . |
. . . # Setting For Replication (db2) binlog_cache_size=4M max_binlog_size=512M expire_logs_days = 2 relay-log-purge = 1 log_slave_updates = 1 skip-slave-start auto_increment_increment = 2 auto_increment_offset = 2 # Set Unique Value to Both Server bind-address = 0.0.0.0 . . . |
## MySQL Dual-Repl. 구성 설치 후 MMM설치를 위한 추가적인 GRANTEE작업
MySQL > GRANT SUPER, REPLICATION SLAVE, REPLICATION CLIENT, PROCESS ON *.* TO replusr@'10.1.1.%' IDENTIFIED BY ‘replusr!@#$’; |
## MMM 설치를 위한 필요 패키지 설치
$ yum install make libart_lgpl.x86_64 perl-Algorithm-Diff perl-DBD-mysql perl-DateManip perl-IPC-Shareable perl-Log-Dispatch perl-Log-Dispatch-FileRotate perl-Log-Log4perl perl-MIME-Lite perl-Mail-Sender perl-MailTools perl-Net-ARP perl-Params-Validate perl-Proc-Daemon perl-TimeDate perl-XML-DOM perl-XML-Parser perl-XML-RegExp rrdtool rrdtool-perl perl-Class-Singleton |
## 모니터링 노드의 경우 mysql library 환경 추가 설치 (DB 노드는 이미 설치되어 있음)
rpm -ivh MySQL-shared-compat-5.5.30-1.rhel5.x86_64.rpm (monitor node) |
## MMM 패키지 설치
$ wget http://mysql-mmm.org/_media/:mmm2:mysql-mmm-2.2.1.tar.gz $ tar -zxvf :mmm2:mysql-mmm-2.2.1.tar.gz && rm -fr :mmm2:mysql-mmm-2.2.1.tar.gz $ cd mysql-mmm-2.2.1 $ make install
$ echo $?
|
< Configuration File Setting >
# vi /etc/mysql-mmm/mm_common.conf (both all node)
(주석내용은 config 작성시 반드시 제거할 것!!!)
active_master_role writer <host default> cluster_interface eth1 ## Ethernet Interface pid_path /var/run/mmm_agentd.pid bin_path /usr/lib/mysql-mmm/ replication_user replusr replication_password 5emffld) agent_user replusr agent_password 5emffld) </host> <host db1> ip 10.1.1.121 ## MySQL Master 1 node real ip mode master peer db2 </host> <host db2> ip 10.1.1.131 ## MySQL Master 2 node real ip mode master peer db1 </host> <role writer> hosts db1, db2 ips 10.1.1.211 ## Monitor node virtual ip mode exclusive </role> <role reader> hosts db1, db2 ips 10.1.1.221, 10.1.1.231 ## MySQL Master nodes virtual ip mode balanced </role> |
# vi /etc/mysql-mmm/mmm_agent.conf (mysql node both)
include mmm_common.conf this db1 ## When node is second master then input db2 |
include mmm_common.conf this db2 ## When node is second master then input db2 |
# vi /etc/mysql-mmm/mmm_mon.conf (monitor node)
include mmm_common.conf <monitor> 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 10.1.1.121, 10.1.1.131 </monitor> <host default> monitor_user replusr monitor_password ‘replusr!@#$’ </host> debug 0 |
<Starting MMM>
- Start the agents (mysql node both) –
$ chkconfig mysql-mmm-agent on $ /etc/init.d/mysql-mmm-agent start
|
- Start the monitor (monitor node) -
$ /etc/init.d/mysql-mmm-monitor start
|
- mmm_control to check the status of the cluster –
$ mmm_control show
$ mmm_control checks all
$ tail -f /var/log/mysql-mmm/mmm_mond.log
$ mmm_control set_online db1
$ mmm_control set_online db2
$ mmm_control show
|
출처 : http://dba-jadelee.blogspot.kr/2014/10/mmm-mysql-multi-master-manager.html
반응형
'연구개발 > MYSQL' 카테고리의 다른 글
Seconds_Behind_Master (0) | 2015.03.18 |
---|---|
MHA (0) | 2015.03.18 |
MySQL INNODB Status Monitoring (0) | 2015.03.14 |
show status를 통한 MySQL 상태 분석하기 (0) | 2015.03.13 |
tmux - 여러개의 터미널을 실행할 수 있는 TTY 멀티플렉서 (0) | 2015.03.09 |