资源描述:
《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,--diskPrintDiskInfo.-
2、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)。2、查看MySQL指标通
3、过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%-innodb_rowsPrintInnodbR
4、owsStatus(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_logPrintInnodbLogStatus(Innodb_os_log_fsyncs/w
5、ritten)-innodb_statusPrintInnodbStatusfromCommand:'ShowEngineInnodbStatus'(historylist/logunflushed/uncheckpointedbytes/readviews/queriesinside/queued)另外,-innodb_status的信息来自如下:其中:logunflushed=Logsequencenumber-Logflusheduptouncheckpointedbytes=Logsequencenumber-Lastcheckpoi
6、ntat-T,--threadsPrintThreadsStatus(Threads_running,Threads_connected,Threads_created,Threads_cached).-B,--bytesPrintBytesreceivedfrom/sendtoMySQL(Bytes_received,Bytes_sent).-mysqlPrintMySQLInfo(include-t,-com,-hit,-T,-B).-innodbPrintInnodbInfo(include-t,-innodb_pages,-innod
7、b_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进行,可以通过如下命令来避免:$sudochownroot:root/usr/bin/tcprstat$sudochmod
8、u+s/usr/bin/tcprstat$ll/usr/bin/tcprstat-rwsr-xr-x1rootroot1183465May2815:38/usr/b