使用 pt-stalk 诊断 MySQL 问题
pt-stalk 适用场景: ① MySQL Server 性能波动出现的频率很低、例如、几天一次 ② MySQL Server 性能波动出现的机率很快、例如、几秒闪过 ㈠ 安装 ① 下载 http://www.percona.com/downloads/percona-toolkit/LATEST/ ② 问题 MySQL RPM安装的可能会遇到下面问题: Warning: prerequisite DBD::mysql 3 not found. Warning: prerequisite DBI 1.46 not found. Writing Makefile for percona-toolkit 处理方法如下: 分 2 步: ⑴ 配置 percona 源: http://www.percona.com/doc/percona-server/5.5/installation/yum_repo.html # yum list | grep percona # yum install Percona-Server-shared-compat-5.5.19-rel24.0.204.rhel5.i386.rpm ⑵ 安装驱动 Perl DBD::mysql 下载:http://search.cpan.org/~capttofu/DBD-mysql-3.0007_2/ 不过、这之前要先把 MySQL-devel-community 包给打上 ㈡ 使用 例子:
[root@localhost ~]# pt-stalk --collect-tcpdump --function status \
> --variable Threads_connected --threshold 2 \
> --daemonize -- --user=root --password=oracle
2013_04_10_15_15_34 PID file /var/run/pt-stalk.pid already exists and its PID (23950) is running
上面的命令表示,让pt-stalk后台运行(--