Microsoft Azure部署MYSQL-MMM(3)配置MYSQL-MMM

來源:互聯網
上載者:User

標籤:microsoft   伺服器   style   color   black   

(3)安裝配置MYSQL-MMM

在db1、db2、db3安裝MMM所需要的Perl模組(所有伺服器)執行該指令碼,然後 yum -y install mysql-mmm-agent來安裝MMM :

# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

# yum -y install mysql-mmm-agent

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/5D/18/wKiom1UhbYiBwOQeAARKMgACSs4736.jpg" />


在Monitor節點安裝mysql-mmm-monitor

# yum -y install mysql-mmm-monitor*

# yum -y install perl-Time-HiRes*

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/5D/18/wKiom1UhbYmgyhirAAmQoB6l6eM697.jpg" />


編譯DB1上的mmm_common.conf配置agent:


# sudo vim /etc/mysql-mmm/mmm_common.conf


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        replication

   replication_password    replication

   agent_user              mmm_agent

   agent_password          agent

</host>


<host db1>

   ip      10.0.0.4

   mode    master

   peer    db2

</host>


<host db2>

   ip      10.0.0.5

   mode    master

   peer    db1

</host>  


<host db3>

 ip      10.0.0.7

   mode    slave

</host>


<role writer>

   hosts   db1, db2

ips     10.0.0.100

   mode    exclusive

</role>


<role reader>

   hosts   db2, db3

 ips     10.0.0.80, 10.0.0.90

   mode    balanced


其中 replication_user 用於檢查複製的使用者, agent_user 為agent的使用者, mode 標明是否為主或者備選主,或者從庫。 mode exclusive 主為獨佔模式,同一時刻只能有一個主, <role write> 中hosts表示目前的主庫和備選主的真實主機ip或者主機名稱, ips 為對外提供的虛擬機器ip地址,<role readr> 中hosts代表從庫真實的ip和主機名稱, ips 代表從庫的虛擬ip地址。


完成編譯後通過scp複製到db2、db3、monitor節點:

# scp /etc/mysql-mmm/mmm_common.conf 10.0.0.5:/etc/mysql-mmm/

# scp /etc/mysql-mmm/mmm_common.conf 10.0.0.7:/etc/mysql-mmm/

# scp /etc/mysql-mmm/mmm_common.conf 10.0.0.6:/etc/mysql-mmm/

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/5D/13/wKioL1Uhbs2iB2hNAAB45KIZ6og815.jpg" />


分別在db1,db2,db3三台主機的/etc/mysql-mmm配置mmm_agent.conf檔案,分別用不同的字元標識,注意這三台機器的this db1這塊要想,比如本環境中,db1要配置this db1,db2要配置為this db2,而db3要配置為this db3。

# sudo vim /etc/mysql-mmm/mmm_agent.conf

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/5D/18/wKiom1UhbYnTVFLVAAEk57zBphU278.jpg" />


在monitor節點編譯monitor設定檔,添加ping_ips中的內容

# sudo vim /etc/mysql-mmm/mmm_mon.conf

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/5D/13/wKioL1Uhbs3RVtObAAM2nAMKlqs692.jpg" />


在db1、db2、db3啟動agent服務

# service mysql-mmm-agent start

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/5D/18/wKiom1UhbYmgLYlaAACEy9WTFGM822.jpg" />


在monitor啟動monitor服務

<span style="color:black; font-size:10pt

本文出自 “李珣部落格-微軟技術與雲” 部落格,請務必保留此出處http://lixun.blog.51cto.com/4198640/1629179

Microsoft Azure部署MYSQL-MMM(3)配置MYSQL-MMM

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.