这篇文章给大家分享的是有关MySQL监控工具orzdba怎么用的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。
[root@hank-yoon servers]# chmod +x orzdba
在代码的160行左右,配置自己的MySQL验证信息:username、password、socket、host、port
[root@hank-yoon servers]# grep -n 'my $MYSQL' orzdba
160:my $MYSQL = qq{mysql -s --skip-column-names -uroot -pyoon -h227.0.0.1 -P$port };
先安装tcprstat
[root@hank-yoon servers]# ln -sf /export/servers/tcprstat-static.v0.3.1.x86_64 /usr/bin/tcprstat
[root@hank-yoon servers]#chmod u+s /usr/bin/tcprstat
需要安装的perl依赖包:
yum install perl-Test-Simple.x86_64
yum install perl-Time-HiRes
yum install perl-ExtUtils-CBuilder
yum install perl-ExtUtils-MakeMaker
yum install perl-DBD-MySQL
yum install perl-DBI
安装中报错:(因缺少了“yum install perl-Test-Simple.x86_64”)
t/02derived.t ..... Can't locate Test/More.pm in @INC (@INC contains: /export/servers/Perl_Module/version-0.99/blib/lib /export/servers/Perl_Module/version-0.99/blib/arch /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 t/02derived.t line 7.
BEGIN failed--compilation aborted at t/02derived.t line 7.
t/02derived.t ..... Dubious, test returned 2 (wstat 512, 0x200)
No subtests run
安装Perl的File:LockFfile模块
安装version模块
wget http://search.cpan.org/CPAN/authors/id/J/JP/JPEACOCK/version-0.99.tar.gz
tar -zxvf version-0.99.tar.gz
cd version-0.99
perl Makefile.PL
make
make test
make install
安装安装File::Lockfile模块:
wget http://search.cpan.org/CPAN/authors/id/G/GL/GLORYBOX/File-Lockfile-v1.0.5.tar.gz
tar -zxvf File-Lockfile-v1.0.5.tar.gz
cd File-Lockfile-v1.0.5
perl Build.PL
perl ./Build
perl ./Build test
perl ./Build install
安装Class-Data-Inheritable模块:
wget http://search.cpan.org/CPAN/authors/id/T/TM/TMTM/Class-Data-Inheritable-0.08.tar.gztar -zxvf Class-Data-Inheritable-0.08.tar.gz
cd Class-Data-Inheritable-0.08
perl Makefile.PL
make
make test
make install
安装Module-Build模块:
wget http://search.cpan.org/CPAN/authors/id/K/KW/KWILLIAMS/Module-Build-0.31.tar.gz
tar -zxvf Module-Build-0.31.tar.gz
cd Module-Build-0.31
perl Build.PL
./Build
./Build test
./Build install
安装完提示:Usage: Socket::inet_ntoa(ip_address_sv) at ./orz line 477
因主机名不能解析,将IP和主机名写到/etc/hosts文件
[root@hank-yoon servers]# vi /etc/hosts
172.16.9.242 hank-yoon.com
[root@hank-yoon servers]# ./orzdba -lazy -rt -S /export/data/mysql/tmp/mysql.sock
count:此间隔内完成的请求数量
avg:此间隔内所有完成的请求,响应的平均时间
95_avg:此间隔内,95%的请求量的平均响应时间,单位微秒,该值较能体现MySQL Server查询的平均响应时间
[root@hank-yoon servers]# ./orzdba -innodb -S /export/data/mysql/tmp/mysql.sock
感谢各位的阅读!关于“MySQL监控工具orzdba怎么用”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。