欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

orzdba工具配置

程序员文章站 2022-03-20 20:25:33
./orzdba -lazy -rt -S /u01/svr/working/my3306/run/mysql.sock mysql -s --skip-column-names -h127.0.0.1 -urep -P3306 -prep123 -Dmysql -S /u01/svr/workin ......

./orzdba -lazy -rt -s /u01/svr/working/my3306/run/mysql.sock

mysql -s --skip-column-names -h127.0.0.1 -urep -p3306 -prep123 -dmysql -s /u01/svr/working/my3306/run/mysql.sock

源代码地址:http://code.taobao.org/p/orzdba/src/trunk/

[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 -h127.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
cp tcprstat /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.gz
tar -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 /u01/svr/working/my3306/run/mysql.sock