pt-ioprofile,是一个percona的性能分析工具,可以查看进程输出、输入,打印一些表文件及活动IO。pt-ioprofile是一个只读工具,所以对数据没风险。由于网上对pt-ioprofile的安装说明比较少,很多小伙伴都无从下手^.^
写一个shell来安装,方便快捷:
-
#!/bin/bash
-
-
toolkit(){
-
version=$(cat /etc/redhat-release | awk '{print $3}' | awk -F '.' '{print $1}')
-
if [ $version -eq 6 ]
-
then
-
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
-
else
-
rpm -ivh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
-
fi
-
-
yum install perl-IO-Socket-SSL perl-DBD-MySQL perl-Time-HiRes -y
-
wget http://www.percona.com/downloads/percona-toolkit/LATEST/RPM/percona-toolkit-2.2.11-1.noarch.rpm
-
rpm -ivh percona-toolkit-2.2.11-1.noarch.rpm
-
}
-
-
toolkit
如果安装过程报以下错误:
-
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
-
error: Failed dependencies:
-
perl(DBI) >= 1.13 is needed by percona-toolkit-2.2.11-1.noarch
-
perl(DBD::mysql) >= 1.0 is needed by percona-toolkit-2.2.11-1.noarch
-
perl(Time::HiRes) is needed by percona-toolkit-2.2.11-1.noarch
-
perl(IO::Socket::SSL) is needed by percona-toolkit-2.2.11-1.noarch
原因是rpm -ivh装了epel源后,出现yum安装异常,解决办法是编辑/etc/yum.repos.d/epel.repo,修改为以下:
-
#baseurl
-
mirrorlist
-
-
改成
-
-
baseurl
-
#mirrorlist
再运行脚本安装即可^.^
参考资料:
http://www.cnblogs.com/cenalulu/archive/2013/04/12/3016714.html
阅读(2984) | 评论(0) | 转发(0) |