资源描述:
《orzdba工具使用说明》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、orzdba工具使用说明Author:zhuxu@taobao.comDate:2012-08-03Team:TaobaoDBA代码SVN地址:http://code.taobao.org/p/orzdba/src/trunk/说明:Perl脚本,用于对Linux主机和MySQL相关指标进行实时监控。工具主要有如下参数:下面分别说明一下:1、查看Linux主机指标-l,--loadPrintLoadInfo.-c,--cpuPrintCpuInfo.-s,--swapPrintSwapInfo.-d,--diskPrintDis
2、kInfo.-n,--netPrintNetInfo.-sysPrintSysInfo(include-t,-l,-c,-s)这些指标的数据都来自/proc目录下的相关系统元数据:LOAD:/proc/loadavgCPU:/proc/statSWAP:/proc/vmstatDISK:/proc/diskstatsNET:/proc/net/dev其中,查看DISK(-d)和NET(-n)需要带具体的设备名(具体可以查看/proc/diskstats和/proc/net/dev中的设备或者可以取自iostat和sar-nDEV
3、)。2、查看MySQL指标通过showvariables列出经常关注的核心变量。通过showglobalstatus列出相关MYSQLstatus信息。-comPrintMySQLStatus(Com_select,Com_insert,Com_update,Com_delete).-hitPrintInnodbHit%.Hit%:(Innodb_buffer_pool_read_requests-Innodb_buffer_pool_reads)/Innodb_buffer_pool_read_requests*100%-in
4、nodb_rowsPrintInnodbRowsStatus(Innodb_rows_inserted/updated/deleted/read).-innodb_pagesPrintInnodbBufferPoolPagesStatus(Innodb_buffer_pool_pages_data/free/dirty/flushed)-innodb_dataPrintInnodbDataStatus(Innodb_data_reads/writes/read/written)-innodb_logPrintInnodbLogS
5、tatus(Innodb_os_log_fsyncs/written)-innodb_statusPrintInnodbStatusfromCommand:'ShowEngineInnodbStatus'(historylist/logunflushed/uncheckpointedbytes/readviews/queriesinside/queued)另外,-innodb_status的信息来自如下:其中:logunflushed=Logsequencenumber-Logflusheduptouncheckpointedb
6、ytes=Logsequencenumber-Lastcheckpointat-T,--threadsPrintThreadsStatus(Threads_running,Threads_connected,Threads_created,Threads_cached).-B,--bytesPrintBytesreceivedfrom/sendtoMySQL(Bytes_received,Bytes_sent).-mysqlPrintMySQLInfo(include-t,-com,-hit,-T,-B).-innodbPrin
7、tInnodbInfo(include-t,-innodb_pages,-innodb_data,-innodb_log,-innodb_status)3、查看MySQL的响应时间-rtPrintMySQLDBRT(us).通过调用tcprstat来监控MySQL的响应时间。-rt中列的具体意义参考http://www.percona.com/docs/wiki/tcprstat:start中的解释。-rt参数依赖:(1)需要安装tcprstat由于安装后运行tcprstat需要root用户,或者sudo进行,可以通过如下命令来
8、避免:$sudochownroot:root/usr/bin/tcprstat$sudochmodu+s/usr/bin/tcprstat$ll/usr/bin/tcprstat-rwsr-xr-x1rootroot1183465May2815:38/usr/b