溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

安裝實(shí)時(shí)監(jiān)控mysql開源工具GitHub orzdba的操作方法

發(fā)布時(shí)間:2021-10-29 09:17:19 來(lái)源:億速云 閱讀:174 作者:柒染 欄目:MySQL數(shù)據(jù)庫(kù)

這期內(nèi)容當(dāng)中小編將會(huì)給大家?guī)?lái)有關(guān)安裝實(shí)時(shí)監(jiān)控mysql開源工具GitHub orzdba的操作方法,文章內(nèi)容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。

前言

數(shù)據(jù)庫(kù)運(yùn)維日常工作是非常繁瑣的,開源github上面有好多提升數(shù)據(jù)庫(kù)工作效率的軟件。其中orzdba就是非常好用的一款。它集成了操作系統(tǒng)vmstat及iostat的功能,兼有快速查看mysql一些性能指標(biāo)的功效。而且消耗資源也非常少。

安裝orzdba

1,操作系統(tǒng)版本

[root@primarygtid ~]# more /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.8 (Santiago)

2,下載并上傳orzdba工具

 
[root@primarygtid ~]# mkdir -p /monitor_tool

3,必須是python 2.7以上

[root@three57 bin]# python
Python 2.7.17 (default, Oct 22 2019, 13:24:01) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
[root@three57 bin]#

4,安裝gl python軟件包

[root@three57 monitor_dir]# python ./gl.py

5,顯示orzdba的具體用法

[root@three57 monitor_dir]# ll
總用量 64
-rw-r--r-- 1 root root  3254 10月 22 13:38 gl.py
-rw-r--r-- 1 root root 57590 10月 22 13:36 orzdba.py
[root@three57 monitor_dir]# python ./orzdba.py 
usage: orzdba.py [-h] [-i INTERVAL] [-t] [-sys] [-l] [-c] [-d DISK] [-n NET]
                 [-s] [-com] [-innodb_rows] [-innodb_pages] [-innodb_data]
                 [-innodb_log] [-innodb_status] [-innodb] [-T] [-B] [-rt]
                 [-hit] [-mysql] [-P PORT] [-S SOCKET] [-p PWD] [-C COUNT]
                 [-L LOGFILE] [-logfile_by_day] [-lazy] [--nocolor]
Created By lubo 454331202@qq.com
optional arguments:
  -h, --help            show this help message and exit
  -i INTERVAL, --interval INTERVAL
                        Time(second) Interval.
  -t, --time            Print The Current Time.
  -sys                  print SysInfo (include -l,-c,-s).
  -l, --load            Print Load Info.
  -c, --cpu             Print Cpu Info.
  -d DISK, --disk DISK  Print Disk Info.
  -n NET, --net NET     Print Net Info.Time.
  -s, --swap            Print The Swap Info.
  -com                  print mysql status.
  -innodb_rows          Print Innodb Rows Status.
  -innodb_pages         Print Innodb Buffer Pool Pages Status.
  -innodb_data          Print Innodb Data Status.
  -innodb_log           Print Innodb Log Status.
  -innodb_status        Print Innodb Status from Command: "Show Engine Innodb
                        Status".
  -innodb               Print Innodb Info.
  -T, --threads         Print Threads Status.
  -B, --bytes           Print Bytes Status.
  -rt                   Print MySQL DB RT.
  -hit                  Print Innodb Hit%
  -mysql                print SysInfo (Print MySQLInfo (include
                        -t,-com,-hit,-T,-B).
  -P PORT, --port PORT  Port number to use for mysql connection(default 3306).
  -S SOCKET, --socket SOCKET
                        Socket file to use for mysql connection.
  -p PWD, --pwd PWD     root user password.
  -C COUNT, --count COUNT
                        Times.
  -L LOGFILE, --logfile LOGFILE
                        ath of logfile.
  -logfile_by_day       one day a logfile.
  -lazy                 Print Info (include -t,-l,-c,-s,-m,-hit).
  --nocolor             Print NO color.

6,顯示實(shí)時(shí)性的平均負(fù)載及CPU和交換分區(qū)的信息

[root@primarygtid monitor_tool]# python orzdba.py -i 3 -sys
.=================================================.
|       Welcome to use the orzdba tool !          |
|          Yep...Chinese English~                 |
|          Created by lubo qq:454331202~          |
'=============== Date: 2019-10-22 ================'
HOST: primarygtid IP: 127.0.0.1
-------- -----load-avg---- ---cpu-usage--- ---swap--- 
  time  |  1m    5m   15m |usr sys idl iow|   si   so|
13:27:46| 0.05  0.16  0.17|  0   0  99   0|    0    0|
13:27:49| 0.04  0.16  0.17|  0   0 100   0|    0    0|
13:27:52| 0.04  0.16  0.17|  0   0 100   0|    0    0|
13:27:55| 0.04  0.16  0.17|  0   0 100   0|    0    0|

7,顯示磁盤的讀寫及服務(wù)時(shí)間及響應(yīng)時(shí)間

[root@primarygtid monitor_tool]# python orzdba.py -i 3 -t -d sda1
.=================================================.
|       Welcome to use the orzdba tool !          |
|          Yep...Chinese English~                 |
|          Created by lubo qq:454331202~          |
'=============== Date: 2019-10-22 ================'
HOST: primarygtid IP: 127.0.0.1
---------------------------------io-usage----------------------- 
  time  |   r/s    w/s    rkB/s    wkB/s  queue await svctm \%util|
13:29:42|   1.4    0.6    34.2    28.0     0.0   1.7   0.8     0.2|
13:29:45|   0.0    0.0     0.0     0.0     0.0   0.0   0.0     0.0|

8,顯示 mysql INNODB相關(guān)信息

[root@primarygtid monitor_tool]# python orzdba.py -innodb
|       Welcome to use the orzdba tool !          |
|          Yep...Chinese English~                 |
|          Created by lubo qq:454331202~          |
'=============== Date: 2019-10-22 ================'
HOST: primarygtid IP: 127.0.0.1
Ver : 5.6.25-enterprise-commercial-advanced-log MySQL Enterprise Server - Advanced Edition (Commercial)
DB  : performance_schema|zxydb
Var : binlog_format[ROW]max_connect_errors[100]max_connections[4000]
      max_user_connections[2500]open_files_limit[65535]sync_binlog[1]
      table_definition_cache[1424]table_open_cache[2048]thread_cache_size[1024]
      innodb_adaptive_flushing[ON]innodb_adaptive_hash_index[ON]innodb_buffer_pool_size[3G]
      innodb_file_per_table[ON]innodb_flush_log_at_trx_commit[1]innodb_flush_log_at_trx_commit[1]
      innodb_io_capacity[200]innodb_lock_wait_timeout[50]innodb_log_buffer_size[16M]
      innodb_log_file_size[2G]innodb_log_files_in_group[2]innodb_max_dirty_pages_pct[75]
      innodb_open_files[2048]innodb_read_io_threads[24]innodb_thread_concurrency[24]
      innodb_write_io_threads[24]
-----------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|
13:30:35|      0      0      0     0|     0      0     0       0|     0       0|    0   0.0b   0.0b     0      0    0|
13:30:36|    429 196178      0     0|     0      0     0       0|     0       0|  351   0.0b   0.0b     0      0    0|
13:30:37|    429 196178      0     0|     0      0     0       0|     0       0|  351   0.0b   0.0b     0      0    0|
13:30:38|    429 196178      0     0|     0      0     0       0|     0       0|  351   0.0b   0.0b     0      0    0|
13:30:39|    429 196178      0     0|     0      0     0       0|     0       0|  351   0.0b   0.0b     0      0    0|
13:30:40|    429 196178      0     0|     0      0     0       0|     0       0|  351   0.0b   0.0b     0      0    0|

9,顯示mysql QPS及TPS相關(guān)信息,并且顯示所有相關(guān)的系統(tǒng)變量配置

[root@primarygtid monitor_tool]# python orzdba.py -C 10 -i 3 -com
.=================================================.
|       Welcome to use the orzdba tool !          |
|          Yep...Chinese English~                 |
|          Created by lubo qq:454331202~          |
'=============== Date: 2019-10-22 ================'
HOST: primarygtid IP: 127.0.0.1
Ver : 5.6.25-enterprise-commercial-advanced-log MySQL Enterprise Server - Advanced Edition (Commercial)
DB  : performance_schema|zxydb
Var : binlog_format[ROW]max_connect_errors[100]max_connections[4000]
      max_user_connections[2500]open_files_limit[65535]sync_binlog[1]
      table_definition_cache[1424]table_open_cache[2048]thread_cache_size[1024]
      innodb_adaptive_flushing[ON]innodb_adaptive_hash_index[ON]innodb_buffer_pool_size[3G]
      innodb_file_per_table[ON]innodb_flush_log_at_trx_commit[1]innodb_flush_log_at_trx_commit[1]
      innodb_io_capacity[200]innodb_lock_wait_timeout[50]innodb_log_buffer_size[16M]
      innodb_log_file_size[2G]innodb_log_files_in_group[2]innodb_max_dirty_pages_pct[75]
      innodb_open_files[2048]innodb_read_io_threads[24]innodb_thread_concurrency[24]
      innodb_write_io_threads[24]
-----------QPS--TPS----------- 
  ins   upd   del    sel   iud|
    0     0     0      0     0|
    0     0     0      2     0|
    0     0     0      2     0|
    0     0     0      2     0|

10,示mysql QPS及TPS及HIT及THREAD和BYTE相關(guān)信息

[root@primarygtid monitor_tool]# python orzdba.py -mysql -C 10 -i 3
.=================================================.
|       Welcome to use the orzdba tool !          |
|          Yep...Chinese English~                 |
|          Created by lubo qq:454331202~          |
'=============== Date: 2019-10-22 ================'
HOST: primarygtid IP: 127.0.0.1
Ver : 5.6.25-enterprise-commercial-advanced-log MySQL Enterprise Server - Advanced Edition (Commercial)
DB  : performance_schema|zxydb
Var : binlog_format[ROW]max_connect_errors[100]max_connections[4000]
      max_user_connections[2500]open_files_limit[65535]sync_binlog[1]
      table_definition_cache[1424]table_open_cache[2048]thread_cache_size[1024]
      innodb_adaptive_flushing[ON]innodb_adaptive_hash_index[ON]innodb_buffer_pool_size[3G]
      innodb_file_per_table[ON]innodb_flush_log_at_trx_commit[1]innodb_flush_log_at_trx_commit[1]
      innodb_io_capacity[200]innodb_lock_wait_timeout[50]innodb_log_buffer_size[16M]
      innodb_log_file_size[2G]innodb_log_files_in_group[2]innodb_max_dirty_pages_pct[75]
      innodb_open_files[2048]innodb_read_io_threads[24]innodb_thread_concurrency[24]
      innodb_write_io_threads[24]
-------------------QPS--TPS----------- ------Hit%----- ------threads------ -----bytes---- 
  time  |  ins   upd   del    sel   iud|    lor     hit| run  con  cre  cac|   recv   send|
13:34:44|    0     0     0      0     0|      0  100.00|   0    0    0    0|      0      0|
13:34:47|    0     0     0      2     0|      0  100.00|   3    5    0    1|   391b   522b|

上述就是小編為大家分享的安裝實(shí)時(shí)監(jiān)控mysql開源工具GitHub orzdba的操作方法了,如果剛好有類似的疑惑,不妨參照上述分析進(jìn)行理解。如果想知道更多相關(guān)知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道。

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI