标签:style blog http color io os ar 使用 for
pt-ioprofile,是一个percona的性能分析工具,可以查看进程输出、输入,打印一些表文件及活动IO。pt-ioprofile是一个只读工具,所以对数据没风险。由于网上对pt-ioprofile的安装说明比较少,很多小伙伴都无从下手^.^
下面介绍一下pt-ioprofile的安装过程:
#!/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 -Uvh装了个epel的扩展后,出现了yum安装不了东西,解决办法是编辑/etc/yum.repos.d/epel.repo,把基础的恢复,镜像的地址注释掉,
#baseurl
mirrorlist
改成
baseurl
#mirrorlist
再运行脚本安装即可
请参考:http://www.cnblogs.com/cenalulu/archive/2013/04/12/3016714.html
请参考http://www.percona.com/doc/percona-toolkit/2.0/pt-ioprofile.html
标签:style blog http color io os ar 使用 for
原文地址:http://www.cnblogs.com/xuanzhi201111/p/4040761.html