mysql自动化运维工具参考文档;
淘宝开源工具:Orztop
实时查看当前的processlist和full processlist;
可以查看mysql数据库实时运行的sql状况的工具,以前苦于通过show processlist/show full processlist抓取sql的同志们现在只要盯一盯屏幕就可以了,非常的方便,
安装部署:
1.下载:wget http://hidba.org/wp-content/uploads/2013/06/orztop.rar
上传下载的文件到服务器上
chmod a+x orztop
2.登陆数据库授权orztop检测用户
grant all on browser.* toorztopuser@'127.0.0.1' identified by 'oriTOpusertesT';
flush privileges;
3.操作命令:
./orztop -h=127.0.0.1 -P=3306 -u=orztopuser-p='oriTOpusertesT' -t=2
4.缺少DBI组件报错
[root@4 opt]# ./orztop -h=127.0.0.1 -P=3306 -u=root-p='oriTOpusertesT' -t=2
Can't locate DBI.pm in @INC (@INC contains:/usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl/usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./orztopline 13.
BEGIN failed--compilation aborted at ./orztop line 13.
错误原因:系统没有按安装DBI组件。
DBI(Database Interface)是perl连接数据库的接口。其是perl连接数据库的最优秀方法,他支持包括Orcal,Sybase,mysql,db2等绝大多数的数据库。
解决办法:
安装DBI组件。 Can't locate DBI.pm in @INC-mysql接口
yum -y install perl-DBD-MySQL
5.缺少ReadKey组件报错
[root@4 opt]# ./orztop -h=127.0.0.1 -P=3306 -u=root-p='oriTOpusertesT' -t=2
Can't locate Term/ReadKey.pm in @INC (@INC contains:/usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl/usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./orztopline 14.
BEGIN failed--compilation aborted at ./orztop line 14.
解决办法:
yum search ReadKey
yum install perl-TermReadKey.x86_64 -y
测试正常:
./orztop -h=127.0.0.1 -P=3306 -u=orztopuser-p='oriTOpusertesT' -t=2
本文转自 wjw555 51CTO博客,原文链接:http://blog.51cto.com/wujianwei/1941699