mysql集群之mysql-mmm在centos下的全程安装和配置(三)

来源:互联网 发布:linux网卡配置ip地址 编辑:程序博客网 时间:2024/05/16 14:31

mmm安装,配置,启动,监控

一: 下载安装MYSQL-MMM
db1,db2,db3,db4都要安装:
/soft]# wget http://mysql-mmm.org/_media/:mmm2:mysql-mmm-2.2.1.tar.gz
# mv :mmm2:mysql-mmm-2.2.1.tar.gz mysql-mmm-2.2.1.tar.gz
# tar -zxvf mysql-mmm-2.2.1.tar.gz
# cd mysql-mmm-2.2.1
# make install

: MYSQL-MMM使用的目录和存放文件简介
文件目录          描述
/usr/lib/perl5/vendor_perl/5.8.8/MMM    MMM使用的perl模块
/usr/lib/mysql-mmm        MMM的脚本插件
/usr/sbin   MMM的命令保存路径
/var/log/mysql-mmm   MMM的日志保存路径
/etc   MMM配置文件保存的路径
/etc/mysql-mmm   MMM配置文件保存的路径,优先级最高
/etc/init.d/  agentd和monitor的启动关闭脚本

配置MYSQL-MMM-AGENTD

db1:
# cat /etc/mysql-mmm/mmm_agent.conf   
include mmm_common.conf
this db1

db2,db3类似操作。

cat /etc/mysql-mmm/mmm_common.conf  拷贝一份到db1,2,3,4

注意1:Don't forget to copy this file to all other hosts (including the monitoring host).

注意2:On the database hosts we need to edit /etc/mysql-mmm/mmm_agent.conf. Change “db1” accordingly on the other hosts:


上面是我的配置 ,只供参考。

启动MYSQL-MMM_AGENT,以及相关的一些命令,如下

/etc/init.d/mysql-mmm-agent start

/etc/init.d/mysql-mmm-agent status

ps aux | grep mmm

netstat -tulnp | grep mmm

/etc/init.d/mysql-mmm-agent --help

四。配置MYSQL-MMM-MONITOR

cat /etc/mysql-mmm/mmm_mon.conf

include mmm_common.conf

<monitor>
        ip                                             10.1.1.12(或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.77.50.11, 10.77.50.12, 10.77.50.13 (真实ip)
</monitor>

<host default>
        monitor_user                    mmm_monitor
        monitor_password                mmm_monitor (创建的用户和密码)
</host>

debug 0 (0的时候不打印,1的时候打印信息)

启动MYSQL-MMM-MONITOR

/etc/init.d/mysql-mmm-monitor start

/etc/init.d/mysql-mmm-monitor --help

ps aux | grep mmm (展示如下)

root      2737  0.0  0.2  13764  8892 ?        S    15:10   0:00 mmm_mond
root      2738  1.3  0.9 108480 39992 ?        Sl   15:10   0:00 mmm_mond
root      2745  0.4  0.1  10676  6668 ?        S    15:10   0:00 perl /usr/lib/mysql-mmm//monitor/checker ping_ip
root      2748  0.5  0.1  12860  7776 ?        S    15:10   0:00 perl /usr/lib/mysql-mmm//monitor/checker mysql
root      2750  0.4  0.1  10676  6668 ?        S    15:10   0:00 perl /usr/lib/mysql-mmm//monitor/checker ping
root      2752  0.5  0.1  12860  7824 ?        S    15:10   0:00 perl /usr/lib/mysql-mmm//monitor/checker rep_backlog
root      2754  0.5  0.1  12860  7820 ?        S    15:10   0:00 perl /usr/lib/mysql-mmm//monitor/checker rep_threads

mmm管理工具的一些命令,通过help可以查看


具体实用的一些命令: