Chinaunix首页 | 论坛 | 博客
  • 博客访问: 492078
  • 博文数量: 99
  • 博客积分: 3621
  • 博客等级: 中校
  • 技术积分: 1089
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-22 16:29
文章存档

2012年(21)

2011年(28)

2010年(50)

分类: Mysql/postgreSQL

2012-05-07 14:10:54

How to install innotop on centos .

点击(此处)折叠或打开

  1. #各种依赖包下载地址
  2. http://www.cpan.org/modules/by-module

  3. #一共要安装的依赖包:Time::HiRes,Term::ReadKey,DBI,DBD::mysql

  4. #下载,解压缩
  5. [bzuo@devdb7 ~]$ wget http://innotop.googlecode.com/files/innotop-1.8.0.tar.gz
  6. [bzuo@devdb7 ~]$ tar zxvf innotop-1.8.0.tar.gz

  7. #安装,报错
  8. [bzuo@devdb7 innotop-1.8.0]$ perl Makefile.PL
  9. Can't locate ExtUtils/MakeMaker.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 Makefile.PL line 1.
  10. BEGIN failed--compilation aborted at Makefile.PL line 1.

  11. #下载依赖包
  12. [bzuo@devdb7 ~]$ wget
  13. [bzuo@devdb7 ~]$ tar zxvf ExtUtils-MakeMaker-6.31.tar.gz

  14. #安装依赖包报错
  15. [bzuo@devdb7 ~]$ cd ExtUtils-MakeMaker-6.31
  16. [bzuo@devdb7 ExtUtils-MakeMaker-6.31]$ perl Makefile.PL
  17. Checking if your kit is complete...
  18. Looks good
  19. Could not open '': No such file or directory at lib/ExtUtils/MM_Unix.pm line 2697.

  20. #yum安装依赖包
  21. [root@devdb7 ExtUtils-MakeMaker-6.31]# yum install perl-ExtUtils-MakeMaker

  22. [root@devdb7 ExtUtils-MakeMaker-6.31]# perl Makefile.PL
  23. Writing Makefile for ExtUtils::MakeMaker

  24. #安装,提示报错
  25. [root@devdb7 innotop-1.8.0]# perl Makefile.PL
  26. Warning: prerequisite DBD::mysql 1 not found.
  27. Warning: prerequisite DBI 1.13 not found.
  28. Warning: prerequisite Term::ReadKey 2.1 not found.
  29. Writing Makefile for innotop

  30. #安装DBD,需要先安装DBI
  31. [root@devdb7 bzuo]# wget
  32. [root@devdb7 bzuo]# tar zxvf DBD-mysql-4.020.tar.gz
  33. [root@devdb7 bzuo]# cd DBD-mysql-4.020
  34. [root@devdb7 DBD-mysql-4.020]# perl Makefile.PL
  35. Can't locate DBI/DBD.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 Makefile.PL line 25.

  36. #安装DBI,提示没有安装gcc,yum 安装gcc
  37. [root@devdb7 bzuo]# wget http://www.cpan.org/modules/by-module/DBI/DBI-1.618.tar.gz
  38. [root@devdb7 bzuo]# tar zxvf DBI-1.618.tar.gz
  39. [root@devdb7 bzuo]# cd DBI-1.618
  40. [root@devdb7 DBI-1.618]# perl Makefile.PL
  41. [root@devdb7 DBI-1.618]# make
  42. /bin/sh: gcc: command not found
  43. make: *** [Perl.o] Error 127
  44. [root@devdb7 DBI-1.618]# yum install gcc
  45. [root@devdb7 DBI-1.618]# make && make install (正常了)

  46. #在安装inotop,发现对DBI的提示没有了
  47. [root@devdb7 innotop-1.8.0]# perl Makefile.PL
  48. Warning: prerequisite DBD::mysql 1 not found.
  49. Warning: prerequisite Term::ReadKey 2.1 not found.

  50. #再安装DBD,正常了,
  51. [root@devdb7 DBD-mysql-4.020]# perl Makefile.PL
  52. [root@devdb7 DBD-mysql-4.020]# make
  53. [root@devdb7 DBD-mysql-4.020]# make install

  54. #安装innotop只提示一个依赖包没有了
  55. [root@devdb7 innotop-1.8.0]# perl Makefile.PL
  56. Warning: prerequisite Term::ReadKey 2.1 not found.
  57. Writing Makefile for innotop

  58. #下载TermReadKey
  59. [root@devdb7 bruce]# wget http://www.cpan.org/modules/by-module/Term/TermReadKey-2.30.tar.gz
  60. [root@devdb7 bruce]# tar zxvf TermReadKey-2.30.tar.gz
  61. [root@devdb7 bruce]# cd TermReadKey-2.30
  62. [root@devdb7 TermReadKey-2.30]# perl Makefile.PL
  63. [root@devdb7 TermReadKey-2.30]# make && make install

  64. #再来运行makefile.pl,就没报错了
  65. [root@devdb7 innotop-1.8.0]# perl Makefile.PL
  66. Writing Makefile for innotop
  67. [root@devdb7 innotop-1.8.0]# make && make install

  68. #运行innotop 提示缺少HiRes
  69. [root@devdb7 innotop-1.8.0]# innotop --help
  70. Can't locate Time/HiRes.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 /usr/local/bin/innotop line 1354.
  71. BEGIN failed--compilation aborted at /usr/local/bin/innotop line 1354.


  72. #安装Time-HiRes
  73. [root@devdb7 bruce]# wget
  74. [root@devdb7 bruce]# tar zxvf Time-HiRes-1.9725.tar.gz
  75. [root@devdb7 bruce]# cd Time-HiRes-1.9725
  76. [root@devdb7 Time-HiRes-1.9725]# perl Makefile.PL
  77. [root@devdb7 Time-HiRes-1.9725]# make && make install

  78. #到此安装完成
  79. [root@devdb7 Time-HiRes-1.9725]# innotop --help
  80. Usage: innotop

  81.   --[no]color -C Use terminal coloring (default)
  82.   --config -c Config file to read
  83.   --count Number of updates before exiting
  84.   --delay -d Delay between updates in seconds
  85.   --help Show this help message
  86.   --host -h Connect to host
  87.   --[no]inc -i Measure incremental differences
  88.   --mode -m Operating mode to start in
  89.   
  90. #运行报错
  91. [root@devdb7 Time-HiRes-1.9725]# innotop -uroot -pondemand -hlocalhost
  92. /usr/bin/perl: symbol lookup error: /usr/local/lib64/perl5/auto/DBD/mysql/mysql.so: undefined symbol: mysql_init

  93. #解决办法
  94. mkdir /tmp/mysql-static
  95.   cp /usr/lib64/mysql/*.a /tmp/mysql-static
  96.   perl Makefile.PL --libs="-L/tmp/mysql-static -lmysqlclient"
  97.   make
  98.   make test
  99.   make install
  100.   rm -rf /tmp/mysql-static

  101. #至此,运行正常了
  102. [root@devdb7 DBD-mysql-4.020]# innotop
  103. [RO] Query List (? for help) localhost, 00:00, 0 QPS, 0/0/0 con/run/cac thds, !localhost

  104. When Load QPS Slow Se/In/Up/De% QCacheHit KCacheHit BpsIn BpsOut
  105. Total 0/ 0/ 0/ 0 0.00% 0.00%
  106. localhost: Access denied for user 'root'@'localhost

阅读(2421) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~