這篇文章給大家分享的是有關(guān)MySQL監(jiān)控工具orzdba怎么用的內(nèi)容。小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,一起跟隨小編過來看看吧。
巴彥淖爾網(wǎng)站建設(shè)公司成都創(chuàng)新互聯(lián),巴彥淖爾網(wǎng)站設(shè)計(jì)制作,有大型網(wǎng)站制作公司豐富經(jīng)驗(yàn)。已為巴彥淖爾上千余家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\外貿(mào)網(wǎng)站建設(shè)要多少錢,請找那個(gè)售后服務(wù)好的巴彥淖爾做網(wǎng)站的公司定做!
[root@hank-yoon servers]# chmod +x orzdba
在代碼的160行左右,配置自己的MySQL驗(yàn)證信息: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
安裝中報(bào)錯(cuò):(因缺少了“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
因主機(jī)名不能解析,將IP和主機(jī)名寫到/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:此間隔內(nèi)完成的請求數(shù)量
avg:此間隔內(nèi)所有完成的請求,響應(yīng)的平均時(shí)間
95_avg:此間隔內(nèi),95%的請求量的平均響應(yīng)時(shí)間,單位微秒,該值較能體現(xiàn)MySQL Server查詢的平均響應(yīng)時(shí)間
[root@hank-yoon servers]# ./orzdba -innodb -S /export/data/mysql/tmp/mysql.sock
感謝各位的閱讀!關(guān)于“MySQL監(jiān)控工具orzdba怎么用”這篇文章就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,讓大家可以學(xué)到更多知識(shí),如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!