- 論壇徽章:
- 0
|
Mysql管理必備工具M(jìn)aatkit詳解之三(mk-audit)
2009年05月18日 作者: 大頭剛
僅提供到5427版,后繼版本取消了該工具
mk-audit - 分析報(bào)告mysql狀態(tài)和操作系統(tǒng)相關(guān)環(huán)境,給出推薦值。安裝方法可以參考
這里
。
這個(gè)工具能把MYSQL的配置文件,SCHEMA的情況,操作系統(tǒng)的情況統(tǒng)一收集起來,形成一個(gè)統(tǒng)一的報(bào)表,并給出建議。
主要分成兩部分:
第一部分是操作系統(tǒng)的情況,CPU,內(nèi)存,硬盤等.
mk-audit -u sg -p'xxxx'
Server Specs
OS:
CPU: Intel(R) Xeon(TM) CPU 3.20GHz Architecture: 64-bit
Speed: MHz: 3192 3192 3192 3192
Cache: 2048 KB
Count: 2
Cores: 4
Memory: used 5.58G of 5.83G total (255.02M free)
Buffers: 98.55M
Cached: 1.41G
Shared: 0
Slots:
Storage:
1 RAID controllers detected:
LSI Logic MegaRAID
##################
*** MegaRAID present but unable to check its status
########## End of RAID controllers ##########
LVM volume groups:
df:
Filesystem Type Size Used Avail Use% Mounted on
libc: 2.3.4
PROBLEMS _________________________________________________________________
第二部分是MYSQL實(shí)例的情況。
MySQL Instance 1
Version: 5.1.33-log Architecture: 64-bit
Uptime: 28+00:59:29
ps vals: user mysql cpu% 0.1 rss 3.86G vsz 4.27G syslog: No
Bin:
Data dir:
PID file:
Socket: /tmp/mysql.sock
Port: 3306
Log locations:
Error:
Relay:
Slow: 10s OFF
Config file location:
SCHEMA ________________________________________________________________
5 213 120.59M 291 9.58G 3.11G
Key buffer size : 1.00G
InnoDB buffer pool size: 8.00M
Top 5 largest databases:
DATABASE SIZE DATA
Top 5 largest tables:
DB.TBL SIZE DATA SIZE INDEX #ROWS ENGINE
Remaining 208 4.57G (22.49M average)
Engines:
ENGINE SIZE DATA SIZE INDEX #TABLES #INDEXES
MyISAM 7.00G 2.79G 130 195
CSV 0 0 2 NA
InnoDB 32.00k 0 1 1
MEMORY 2.58G 333.92M 80 95
Triggers, Routines, Events:
DATABASE TYPE COUNT
PROBLEMS ______________________________________________________________
Out of sync system variables (online value differs from config value):
VARIABLE ONLINE VALUE CONFIG VALUE
record_buffer 6291456 8388608
myisam_recover DEFAULT
binlog_format MIXED mixed
datadir .
Things to Note:
- max_connections has been modified from its default (100): 1024
- innodb_flush_method is not set to O_DIRECT
- Slow query logging is disabled (log_slow_queries = OFF)
Aggregated PROCESSLIST ________________________________________________
FIELD VALUE COUNT TOTAL TIME (s)
host
localhost 1 0
state
null 1 0
command
query 1 0
但是目前的版本只支持在本機(jī)操作,對遠(yuǎn)程的MYSQL庫無法進(jìn)行統(tǒng)計(jì),不過會在后續(xù)的版本實(shí)現(xiàn)。
mk-audit -u sg -p'xxxx' --host localhost
Sorry, --host is not implemented yet at /usr/bin/mk-audit line 3558.
OK,還有其他的一些參數(shù),可以看下幫助文件
mk-audit --help
mk-audit inspects, analyzes and reports on a MySQL server. For more details,
please use the --help option, or try 'perldoc /usr/bin/mk-audit' for complete
documentation.
Usage: /usr/bin/mk-audit options>
Options:
--ask-pass Prompt for a password when connecting to MySQL
--charset -A Default character set
--config Read this comma-separated list of config files; if
specified, this must be the first option on the command
line
--defaults-file -F Only read mysql options from the given file
--help Show help and exit
--host Connect to host (not implemented yet)
--password -p Password to use when connecting
--port -P Port number to use for connection
--set-vars Set these MySQL variables (default wait_timeout=10000)
--socket -S Socket file to use for connection
--top Show top N largest databases and tables (default 5)
--user -u User for login if not current user
--version Show version and exit
Options and values after processing arguments:
--ask-pass FALSE
--charset (No value)
--config /etc/maatkit/maatkit.conf,/etc/maatkit/mk-audit.conf,/root/.maatkit.conf,/root/.mk-audit.conf
--defaults-file (No value)
--help TRUE
--host (No value)
--password (No value)
--port (No value)
--set-vars wait_timeout=10000
--socket (No value)
--top 5
--user (No value)
--version FALSE
本文來自ChinaUnix博客,如果查看原文請點(diǎn):http://blog.chinaunix.net/u3/111930/showart_2184781.html |
|