Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1381392
  • 博文数量: 77
  • 博客积分: 2104
  • 博客等级: 大尉
  • 技术积分: 2322
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-19 13:21
个人简介

关注于系统高可用、网站架构

文章分类

全部博文(77)

文章存档

2018年(1)

2017年(1)

2015年(4)

2014年(8)

2013年(4)

2012年(12)

2011年(17)

2010年(30)

分类: 架构设计与优化

2014-08-13 11:33:07

首先安装好MYSQL,并且搭建好 主主从复制  (关于复制的搭建这边就不做详细的说明)

 

DBS

物理IP

主机

虚拟IP

角色

tts

199.155.122.91

tts91

199.155.122.251

reader

199.155.122.176

writer

199.155.122.194

tts194

199.155.122.252

reader

199.155.122.208

tts208

 

monitor

 

配置选项:

         vi /etc/hosts

            199.155.122.91    tts91

  199.155.122.194  tts194

 

安装(配置好epel)

Agent

yum install –y mysql-mmm mysql-mmm-agent

monitor

yum install –y mysql-mmm-monitor

 

配置文件修改

Agent

    cluster_interface       eth0

    pid_path                /var/run/mysql-mmm/mmm_agentd.pid

    bin_path                /usr/libexec/mysql-mmm/

    replication_user        repl

    replication_password    repl

    agent_user              mmm_agent

    agent_password          RepAgent

 

    ip      199.155.122.91

    mode    master

    peer    tts194

 

    ip      199.155.122.194

    mode    master

    peer    tts91

 

    hosts   tts91, tts194

    ips     199.155.122.176

    mode    exclusive

    prefer  tts91

 

    hosts   tts91, tts194

    ips     199.155.122.251, 199.155.122.252

    mode    balanced

 

mmm_agent.conf

include mmm_common.conf

this tts91

 

mmm_mon.conf

    ip                  127.0.0.1

    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            199.155.122.91,199.155.122.194

    auto_set_online     30

 

 

    monitor_user        mmm_monitor

    monitor_password    RepMonitor

 

创建监控用户 (主库):

         grant REPLICATION CLIENT on *.* TO 'mmm_monitor'@'%' identified by ' RepMonitor';

         grant SUPER,REPLICATION CLIENT,PROCESS on *.* TO 'mmm_agent'@'%' identified by 'RepMonitor';

         grant REPLICATION SLAVE on *.* TO 'repl'@'%' identified by 'repl';

 

启动 agent 服务 :

         service mysql-mmm-agent start

        

启动 monitor 服务 :

        service mysql-mmm-monitor start

检查主机状态:

        /usr/sbin/mmm_control  checks all

检查集群环境在线状况:

        /usr/sbin/mmm_control  show

查看监控日志:

        cat /var/log/mysql-mmm/mmm_mond.log

 

阅读(4620) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~