MySQL监控工具中orzdba怎么安装

发布时间:2021-11-02 15:03:49 作者:小新
来源:亿速云 阅读:147

这篇文章将为大家详细讲解有关MySQL监控工具中orzdba怎么安装,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。



安装 orzdba

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

说明:Perl脚本,用于对Linux主机和MySQL相关指标进行实时监控。

    修改代码160行左右配置MySQL的相关验证信息,如username,password,host,port,sock等
    安装tcprstat
    安装orzdba_rt_depend_perl_module.tar.gz依赖包(version模块、Class-Data-Inheritable模块、Module-Build模块、File-Lockfile模块)


  1. shell> grep -n 'my $MYSQL' orzdba

  2. 160:my $MYSQL    = qq{mysql -s --skip-column-names -uroot -P$port };


  3. shell> chmod +x orzdba


  4. shell> ./orzdba --help


  5. ==========================================================================================

  6. Info  :

  7. Created By zhuxu@taobao.com

  8. Usage :

  9. Command line options :


  10. -h,--help           Print Help Info.

  11. -i,--interval       Time(second) Interval.    # 数据抓取间隔(秒)

  12. -C,--count          Times.                    # 抓取总次数

  13. -t,--time           Print The Current Time.

  14. -nocolor            Print NO Color.


  15. -l,--load           Print Load Info.

  16. -c,--cpu            Print Cpu  Info.

  17. -s,--swap           Print Swap Info.

  18. -d,--disk           Print Disk Info.

  19. -n,--net            Print Net  Info.


  20. -P,--port           Port number to use for mysql connection(default 3306).

  21. -S,--socket         Socket file to use for mysql connection.


  22. -com                Print MySQL Status(Com_select,Com_insert,Com_update,Com_delete).

  23. -hit                Print Innodb Hit%.

  24. -innodb_rows        Print Innodb Rows Status(Innodb_rows_inserted/updated/deleted/read).

  25. -innodb_pages       Print Innodb Buffer Pool Pages Status(Innodb_buffer_pool_pages_data/free/dirty/flushed)

  26. -innodb_data        Print Innodb Data Status(Innodb_data_reads/writes/read/written)

  27. -innodb_log         Print Innodb Log  Status(Innodb_os_log_fsyncs/written)

  28. -innodb_status      Print Innodb Status from Command: 'Show Engine Innodb Status'

  29. (history list/ log unflushed/uncheckpointed bytes/ read views/ queries inside/queued)

  30. -T,--threads        Print Threads Status(Threads_running,Threads_connected,Threads_created,Threads_cached).

  31. -rt                 Print MySQL DB RT(us).

  32. -B,--bytes          Print Bytes received from/send to MySQL(Bytes_received,Bytes_sent).


  33. -mysql              Print MySQLInfo (include -t,-com,-hit,-T,-B).

  34. -innodb             Print InnodbInfo(include -t,-innodb_pages,-innodb_data,-innodb_log,-innodb_status)

  35. -sys                Print SysInfo   (include -t,-l,-c,-s).

  36. -lazy               Print Info      (include -t,-l,-c,-s,-com,-hit).


  37. -L,--logfile        Print to Logfile.

  38. -logfile_by_day     One day a logfile,the suffix of logfile is 'yyyy-mm-dd';

  39. and is valid with -L.


  40. Sample :

  41. shell> nohup ./orzdba -lazy -d sda -C 5 -i 2 -L /tmp/orzdba.log  > /dev/null 2>&1 &

  42. ==========================================================================================



查看Linux主机指标

 

  1. shell> ./orzdba -sys -C 10 -i 1 -t -d sda


  2. .=================================================.

  3. |       Welcome to use the orzdba tool !          |

  4. |          Yep...Chinese English~                 |

  5. '=============== Date : 2014-12-31 ==============='


  6. HOST: rac3   IP: 127.0.0.1


  7. -------- -----load-avg---- ---cpu-usage--- ---swap--- -------------------------io-usage-----------------------

  8. time  |  1m    5m   15m |usr sys idl iow|   si   so|   r/s    w/s    rkB/s    wkB/s  queue await svctm %util|

  9. 02:14:13| 0.08  0.02  0.01|  0   0 100   0|    0    0|    0.3    0.3     7.7      2.7   0.0    6.0   2.0   0.1|

  10. 02:14:14| 0.08  0.02  0.01|  0   3  97   0|    0    0|    0.0    3.0     0.0     11.9   0.0    4.0   1.3   0.4|

  11. 02:14:15| 0.08  0.02  0.01|  0   3  97   0|    0    0|    0.0    6.7     0.0     30.5   0.0    2.1   0.7   0.5|

  12. 02:14:16| 0.08  0.02  0.01|  0   2  98   0|    0    0|    0.0    0.0     0.0      0.0   0.0    0.0   0.0   0.0|

  13. 02:14:17| 0.08  0.02  0.01|  0   3  97   0|    0    0|    0.0    0.0     0.0      0.0   0.0    0.0   0.0   0.0|

  14. 02:14:18| 0.07  0.02  0.00|  0   3  96   0|    0    0|    0.0    0.0     0.0      0.0   0.0    0.0   0.0   0.0|

  15. 02:14:19| 0.07  0.02  0.00|  0   3  97   0|    0    0|    0.0    1.9     0.0      7.5   0.0    4.0   2.0   0.4|

  16. 02:14:20| 0.07  0.02  0.00|  0   4  96   0|    0    0|    0.0    5.0     0.0     51.7   0.0    0.8   0.4   0.2|

  17. 02:14:21| 0.07  0.02  0.00|  0   3  96   0|    0    0|    0.0    0.0     0.0      0.0   0.0    0.0   0.0   0.0|

  18. 02:14:22| 0.07  0.02  0.00|  0   4  96   0|    0    0|    0.0    0.0     0.0      0.0   0.0    0.0   0.0   0.0|

  19. 02:14:23| 0.07  0.02  0.00|  0   3  97   0|    0    0|    0.0    0.0     0.0      0.0   0.0    0.0   0.0   0.0|



-sys:打印系统信息,包括-t(打印当前时间)、-l(打印负载信息,分1分钟、5分钟、15分钟)、-c(打印cpu信息)、-s(打印交换分区信息)
-d:打印磁盘信息,需要指点磁盘设备名
-n:打印网络信息,接收和发送大小,需要指点网卡设备名

查看DISK(-d)和NET(-n)需要带具体的设备名(具体可以查看/proc/diskstats和/proc/net/dev中的设备或者可以取自iostat
和sar -n DEV)

Linux指标的数据都来自/proc目录下的相关系统元数据:
LOAD : /proc/loadavg
CPU : /proc/stat
SWAP : /proc/vmstat
DISK : /proc/diskstats
NET : /proc/net/dev
查看MySQL响应时间(rt)

通过调用tcprstat来监控MySQL的响应时间。


  1. shell> ./orzdba -rt -C 10 -i 1 -t -d sda


  2. .=================================================.

  3. |       Welcome to use the orzdba tool !          |

  4. |          Yep...Chinese English~                 |

  5. '=============== Date : 2014-12-31 ==============='


  6. -------- -------------------------io-usage----------------------- --------tcprstat(us)--------

  7. time  |   r/s    w/s    rkB/s    wkB/s  queue await svctm %util|  count    avg 95-avg 99-avg|

  8. 01:53:22|    0.0    0.0     0.1      0.0   0.0    0.4   0.4   0.0|      0      0      0      0|

  9. 01:53:24|    0.0    0.0     0.0      0.0   0.0    0.0   0.0   0.0|      0      0      0      0|

  10. 01:53:25|    0.0    0.0     0.0      0.0   0.0    0.0   0.0   0.0|      0      0      0      0|

  11. 01:53:26|    0.0    0.0     0.0      0.0   0.0    0.0   0.0   0.0|      0      0      0      0|

  12. 01:53:27|    0.0    0.0     0.0      0.0   0.0    0.0   0.0   0.0|      0      0      0      0|

  13. 01:53:28|    0.0    0.0     0.0      0.0   0.0    0.0   0.0   0.0|      0      0      0      0|

  14. 01:53:29|    0.0    0.0     0.0      0.0   0.0    0.0   0.0   0.0|      0      0      0      0|

  15. 01:53:30|    0.0    0.0     0.0      0.0   0.0    0.0   0.0   0.0|      0      0      0      0|

  16. 01:53:31|    0.0    0.0     0.0      0.0   0.0    0.0   0.0   0.0|      0      0      0      0|

  17. 01:53:32|    0.0    0.0     0.0      0.0   0.0    0.0   0.0   0.0|      0      0      0      0|

  18. 01:53:33|    0.0    0.0     0.0      0.0   0.0    0.0   0.0   0.0|      0      0      0      0|




监控InnoDB的性能指标

 

  1. shell> ./orzdba -innodb -C 10 -i 1


  2. .=================================================.

  3. |       Welcome to use the orzdba tool !          |

  4. |          Yep...Chinese English~                 |

  5. '=============== Date : 2014-12-31 ==============='


  6. -------- ---innodb bp pages status-- -----innodb data status---- --innodb log--   his --log(byte)--  read ---query---
      time  |   data   free  dirty flush| reads writes  read written|fsyncs written| list uflush  uckpt  view inside  que|
    01:48:38|      0      0      0     0|     0      0      0      0|     0       0|    0      0      0     0     0     0|
    01:48:39|    638   7553      0     0|     0      0      0      0|     0       0|  350      0       0    0     0     0|
    01:48:40|    638   7553      0     0|     0      0      0      0|     0       0|  350      0       0    0     0     0|
    01:48:41|    638   7553      0     0|     0      0      0      0|     0       0|  350      0       0    0     0     0|
    01:48:42|    638   7553      0     0|     0      0      0      0|     0       0|  350      0       0    0     0     0|
    01:48:43|    638   7553      0     0|     0      0      0      0|     0       0|  350      0       0    0     0     0|
    01:48:44|    638   7553      0     0|     0      0      0      0|     0       0|  350      0       0    0     0     0|
    01:48:45|    638   7553      0     0|     0      0      0      0|     0       0|  350      0       0    0     0     0|
    01:48:46|    638   7553      0     0|     0      0      0      0|     0       0|  350      0       0    0     0     0|
    01:48:47|    638   7553      0     0|     0      0      0      0|     0       0|  350      0       0    0     0     0|
    01:48:48|    638   7553      0     0|     0      0      0      0|     0       0|  350      0       0    0     0     0|



监控MySQL Server性能


  1. shell> ./orzdba -mysql -C 10 -i 1


  2. .=================================================.

  3. |       Welcome to use the orzdba tool !          |

  4. |          Yep...Chinese English~                 |

  5. '=============== Date : 2014-12-31 ==============='


  6. --------                     -QPS- -TPS-         -Hit%- ------threads------ -----bytes----

  7. time  |  ins   upd   del    sel   iud|     lor    hit| run  con  cre  cac|   recv   send|

  8. 01:45:58|    0     0     0      0     0|       0 100.00|   0    0    0    0|      0      0|

  9. 01:45:59|    0     0     0      1     0|       0 100.00|   1    2    0    0|    839     1k|

  10. 01:46:01|    0     0     0      1     0|       0 100.00|   1    2    0    0|    839     1k|

  11. 01:46:02|    0     0     0      1     0|       0 100.00|   1    2    0    0|    839     1k|

  12. 01:46:03|    0     0     0      1     0|       0 100.00|   1    2    0    0|    839     1k|

  13. 01:46:04|    0     0     0      1     0|       0 100.00|   1    2    0    0|    839     1k|

  14. 01:46:05|    0     0     0      1     0|       0 100.00|   1    2    0    0|    839     1k|

  15. 01:46:06|    0     0     0      1     0|       0 100.00|   1    2    0    0|    839     1k|

  16. 01:46:07|    0     0     0      1     0|       0 100.00|   1    2    0    0|    839     1k|

  17. 01:46:08|    0     0     0      1     0|       0 100.00|   1    2    0    0|    839     1k|

  18. 01:46:09|    0     0     0      1     0|       0 100.00|   1    2    0    0|    839     1k|




安装问题:
Usage: Socket::inet_ntoa(ip_address_sv) at ./orz line 477

因主机名不能解析,将主机名和IP写到/etc/hosts文件。

关于“MySQL监控工具中orzdba怎么安装”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。

推荐阅读:
  1. MySQL 性能医生:OrzDBA
  2. orzdba监控工具【增加远程监控】

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

mysql orzdba

上一篇:怎么用Python进行数据分析

下一篇:vuejs怎么返回上一页

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》