MySQL監控工具之innotop

來源:互聯網
上載者:User

MySQL監控工具之innotop

innotop是一個通過文字模式顯示MySQL和InnoDB儲存引擎的監測工具。innotop是用perl語言開發,這是它能更加靈活的使用在各種操作平台之上,它能詳細的的監控出當前mysql和innodb儲存引擎啟動並執行狀態,以便維護人員根據結果合理的最佳化資料庫,讓資料庫更穩定更高效的運行,innotop依賴於系統的perl-ExtUtils-MakeMaker軟體包。

1.安裝perl依賴包

[root@bkjia ~]# yum install perl-ExtUtils-MakeMaker
[root@bkjia ~]# rpm -aq | grep perl-ExtUtils-MakeMaker
perl-ExtUtils-MakeMaker-6.55-136.el6_6.1.x86_64
[root@bkjia ~]#

2.下載安裝innotop監控工具
[root@bkjia ~]# wget http://innotop.googlecode.com/files/innotop-1.9.0.tar.gz
[root@bkjia ~]# tar xvf innotop-1.9.0.tar.gz -C /usr/local/
[root@bkjia ~]# cd /usr/local/innotop-1.9.0/
[root@bkjia innotop-1.9.0]# perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for innotop

[root@bkjia innotop-1.9.0]# make install
cp innotop blib/script/innotop
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/innotop
Manifying blib/man1/innotop.1
Installing /usr/local/share/man/man1/innotop.1
Installing /usr/local/bin/innotop
Appending installation info to /usr/lib64/perl5/perllocal.pod
[root@bkjia innotop-1.9.0]# echo $?
0
[root@bkjia innotop-1.9.0]#
 
3.innotop使用協助和監控執行個體
[root@bkjia innotop-1.9.0]# ./innotop  --help
Usage: innotop <options> <innodb-status-file>

  --[no]color  -C  Use terminal coloring (default)
  --config      -c  Config file to read
  --count            Number of updates before exiting
  --delay      -d  Delay between updates in seconds
  --help            Show this help message
  --host        -h  Connect to host
  --[no]inc    -i  Measure incremental differences
  --mode        -m  Operating mode to start in
  --nonint      -n  Non-interactive, output tab-separated fields
  --password    -p  Password to use for connection
  --port        -P  Port number to use for connection
  --skipcentral -s  Skip reading the central configuration file
  --socket      -S  MySQL socket to use for connection
  --spark            Length of status sparkline (default 10)
  --timestamp  -t  Print timestamp in -n mode (1: per iter; 2: per line)
  --user        -u  User for login if not current user
  --version          Output version information and exit
  --write      -w  Write running configuration into home directory if no config files were loaded

innotop is a MySQL and InnoDB transaction/status monitor, like 'top' for
MySQL.  It displays queries, InnoDB transactions, lock waits, deadlocks,
foreign key errors, open tables, replication status, buffer information,
row operations, logs, I/O operations, load graph, and more.  You can
monitor many servers at once with innotop.

[root@bkjia innotop-1.9.0]# ./innotop  -u root -psystem -h localhost -S /tmp/mysql.sock
[RO] Dashboard (? for        help)            --輸入?或htlp查看協助資訊
Uptime  MaxSQL  ReplLag  Cxns  Lock  QPS  QPS  Run  Run  Tbls  Repl  SQL

    6d                      1    0  0.40  ^_____  _____  551  Off     
   

輸入?號可看協助資訊
Switch to a different mode:
  A  Dashboard        I  InnoDB I/O Info    Q  Query List
  B  InnoDB Buffers    K  InnoDB Lock Waits  R  InnoDB Row Ops
  C  Command Summary  L  Locks              S  Variables & Status
  D  InnoDB Deadlocks  M  Replication Status  T  InnoDB Txns
  F  InnoDB FK Err    O  Open Tables        U  User Statistics

Actions:
  d  Change refresh interval        p  Pause innotop
  k  Kill a query's connection      q  Quit innotop
  n  Switch to the next connection  x  Kill a query

Other:
 TAB  Switch to the next server group  /  Quickly filter what you see
  !  Show license and warranty        =  Toggle aggregation
  #  Select/create server groups      @  Select/create server connections
  $  Edit configuration settings      \  Clear quick-filters
Press any key to continue

本文永久更新連結地址:

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.