您好,登錄后才能下訂單哦!
小編給大家分享一下MySQL Innotop for Linux怎么安裝,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!
首先到網(wǎng)址https://code.google.com/archive/p/innotop/downloads里下載innotop-1.9.0.tar.gz,見下圖,選擇innotop-1.9.0.tar.gz下載
然后上傳到Linux服務(wù)器進(jìn)行解壓
[root@idb4 ~]# tar zxvf innotop-1.9.0.tar.gz
innotop-1.9.0/
innotop-1.9.0/t/
innotop-1.9.0/t/InnoDBParser.t
innotop-1.9.0/t/innodb-status-001
innotop-1.9.0/t/innodb-status-002
innotop-1.9.0/t/innodb-status-003
innotop-1.9.0/t/innodb-status-004
innotop-1.9.0/t/innodb-status-005
innotop-1.9.0/t/innodb-status-006
innotop-1.9.0/t/innodb-status-007
innotop-1.9.0/innotop.spec
innotop-1.9.0/Makefile.PL
innotop-1.9.0/INSTALL
innotop-1.9.0/Changelog
innotop-1.9.0/innotop
innotop-1.9.0/COPYING
innotop-1.9.0/MANIFEST
[root@idb4 innotop-1.9.0]# perl Makefile.PL
Checking if your kit is complete...
Looks good
Warning: prerequisite Term::ReadKey 2.1 not found.
Writing Makefile for innotop
報以上錯誤,缺少ReadKey包,解決方法:
[root@idb4 innotop-1.9.0]# yum install perl-DBI perl-DBD-MySQL perl-TermReadKey
安裝完再次運行后無報錯:
[root@idb4 innotop-1.9.0]# perl Makefile.PL
Writing Makefile for innotop
[root@idb4 innotop-1.9.0]#
[root@idb4 innotop-1.9.0]#
[root@idb4 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@idb4 innotop-1.9.0]#
運行innotop命令后發(fā)現(xiàn)報錯:
[root@idb4 innotop-1.9.0]# innotop -u mdba -p123456
localhost, 0.00, 0 QPS, 0/0/0 con/run/cac thds, !localhost
Uptime MaxSQL ReplLag Cxns Lock QPS QPS Run Run Tbls Repl SQL
localhost: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
查看一下幫助:
[root@idb4 innotop-1.9.0]# innotop --help
Usage: innotop
--[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
需要加-S后再運行:
[root@idb4 innotop-1.9.0]# innotop -u mdba -p123456 -S /tmp/mysql.sock
localhost, 44d, 1.53k QPS, 119/6/29 con/run/cac thds, 5.6.27-log
按?號顯示幫助
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
按Q,顯示以下信息
When Load Cxns QPS Slow Se/In/Up/De% QCacheHit KCacheHit BpsIn BpsOut
Now 0.16 135 1.53k 0 26/ 1/ 0/ 0 0.00% 100.00% 174.93k 427.61k
Total 0.00 1000 1.53k 2.09k 29/ 3/ 0/ 0 0.00% 90.42% 156.93k 463.33k
Cmd ID State User Host DB Time Query
Query 3978017 init ixinnuo_ 172.16.16.10 ixinnuo_sjcj 00:01 commit
Query 4051691 init ixinnuo_ 172.16.16.10 ixinnuo_sjcj 00:01 commit
Query 4054981 init ixinnuo_ 172.16.16.10 ixinnuo_sjcj 00:01 commit
Query 4064304 init ixinnuo_ 172.16.16.10 ixinnuo_sjcj 00:01 commit
Query 4083366 init ixinnuo_ 172.16.16.10 ixinnuo_sjcj 00:01 commit
Query 4083368 Sending data ixinnuo_ 172.16.16.10 ixinnuo_sjcj 00:01 select id, SH, KPJH, ZFJH, TYPE, MONTH, STATUS, CREATE_TIME, UPDAT
Query 4083370 init ixinnuo_ 172.16.16.10 ixinnuo_sjcj 00:01 commit
Query 4083372 init ixinnuo_ 172.16.16.10 ixinnuo_sjcj 00:01 commit
Query 4083375 init ixinnuo_ 172.16.16.10 ixinnuo_sjcj 00:01 commit
Query 4139383 init ixinnuo_ 172.16.16.10 ixinnuo_sjcj 00:01 commit
Query 4146551 init ixinnuo_ 172.16.16.10 ixinnuo_sjcj 00:01 commit
Query 4155188 init ixinnuo_ 172.16.16.10 ixinnuo_sjcj 00:01 commit
Query 4157873 init ixinnuo_ 172.16.16.10 ixinnuo_sjcj 00:01 commit
Query 4223328 Sending data ixinnuo_ 172.16.16.10 ixinnuo_sjcj 00:01 select id, SH, KPJH, ZFJH, TYPE, MONTH, STATUS, CREATE_TIME, UPDAT
其中 Load 是負(fù)載
QPS (Query Per Second) 表示每秒的查詢率
Slow 代表慢查詢的個數(shù)
Se/In/Up/De%: 增,刪,改,查的比率
QCacheHit:查詢緩沖的命中率
KCacheHit:索引的命中率
BpsIn (bytes Per Second in) 每秒鐘輸入的字節(jié)數(shù)
BpsOut(bytes Per Second Out)每秒鐘輸出的字節(jié)數(shù)
以上是“MySQL Innotop for Linux怎么安裝”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學(xué)習(xí)更多知識,歡迎關(guān)注億速云行業(yè)資訊頻道!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。