windows mysql 性能监控_7.MySQL 性能监控

MySQL运行状态的监控是每个运维工程师,和MySQL DBA的主要工作之一。我们把MySQL的监控分为两个部分,一部分为基本状态的监控(请参考《Linux系统运维之运维监控》),一部分为性能方面的监控,是为MySQL性能优化提供的参考信息,在这一章节,详细讲解,MySQL性能监控方面的内容。

7.1 性能监控的工具

在MySQL的命令行中,DBA们通常使用一下命令来获取MySQL的状态报告:

Mysql> show status;

Mysql> show master status;

Mysql> show slave status;

Mysql> show inodb status;

下面是show status输出的最后一行,可以看到总共有268行。面对如此庞大的性能指标,让很多DBA望而生畏。

268 rows in set (0.00 sec)

7.2 mysqlreport

Mysqlreport 是用perl编写的一个命令行工具,解决了show status产生的大量我们难以阅读的状况。

7.2.1 mysqlreport的相关资源

7.2.2 mysqlreport 安装

Mysqlreport需要Perl-DBI和Perl-DBD-Mysql的支持。

[root@MySQL-Master ~]# cd /usr/local/src

[root@MySQL-Master src]# tar zxvf mysqlreport-3.5.tgz

mysqlreport-3.5/

mysqlreport-3.5/COPYING

mysqlreport-3.5/mysqlreportdoc.html

mysqlreport-3.5/mysqlreportguide.html

mysqlreport-3.5/mysqlreport

7.2.3 mysqlreport 参数详解

[root@MySQL-Master mysqlreport-3.5]# perl mysqlreport --help

mysqlreport v3.5 Apr 16 2008

mysqlreport makes an easy-to-read report of important MySQL status values.

Command line options (abbreviations work):

--user USER       Connect to MySQL as USER  #用户名

--password PASS   Use PASS or prompt for MySQL user's password   #密码

--host ADDRESS    Connect to MySQL at ADDRESS    #主机IP或可以解析的域名

--port PORT       Connect to MySQL at PORT         #mysql 端口。

--socket SOCKET   Connect to MySQL at SOCKET     #设置通过mysql socket连接。

--no-mycnf        Don't read ~/.my.cnf               #不读取my.cnf配置文件

--infile FILE     Read status values from FILE instead of MySQL

--outfile FILE    Write report to FILE            #输出写入到文件中

--email ADDRESS   Email report to ADDRESS (doesn't work on Windows) #发送输出日志到邮件

--flush-status    Issue FLUSH STATUS; after getting current values

--relative X      Generate relative reports. If X is an integer,

reports are live from the MySQL server X seconds apart.

If X is a list of infiles (file1 file2 etc.),

reports are generated from the infiles in the order

that they are given.

--report-count N  Collect N number of live relative reports (default 1)

--detach          Fork and detach from terminal (run in background)

--help            Prints this   #打印此帮助日志

--debug           Print debugging information

Visit http://hackmysql.com/mysqlreport for more information.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值