mysql监控工具之percona-toolkit集合

1.下载安装percona-toolkit软件

[[email protected] ~]# wget http://www.percona.com/downloads/percona-toolkit/2.2.13/deb/percona-toolkit_2.2.13.tar.gz

[[email protected] ~]# tar xvf percona-toolkit_2.2.13.tar.gz  -C /usr/local/

[[email protected] ~]# cd /usr/local/percona-toolkit-2.2.13/

[[email protected] percona-toolkit-2.2.13]# perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for percona-toolkit
[[email protected] percona-toolkit-2.2.13]# make && make install
[[email protected] percona-toolkit-2.2.13]# echo $?
0
[[email protected] percona-toolkit-2.2.13]#
[[email protected] percona-toolkit-2.2.13]# cd bin/

[[email protected] bin]#

2.使用pt-mysql-summary脚本查看mysql的详细信息

[[email protected] bin]# ./pt-mysql-summary --user root --password system --socket /tmp/mysql.sock
Warning: Using a password on the command line interface can be insecure.
# Percona Toolkit MySQL Summary Report #######################
              System time | 2015-03-13 09:17:08 UTC (local TZ: CST +0800)
# Instances ##################################################
  Port  Data Directory             Nice OOM Socket
  ===== ========================== ==== === ======
   3306 /usr/local/mysql-5.7.4/data 0    0   /tmp/mysql.sock
# MySQL Executable ###########################################
       Path to executable | /usr/local/mysql-5.7.4/bin/mysqld
              Has symbols | Yes
# Report On Port 3306 ########################################
                     User | [email protected]
                     Time | 2015-03-13 17:17:08 (CST)
                 Hostname | tong1
                  Version | 5.7.4-m14-log MySQL Community Server (GPL)
                 Built On | linux-glibc2.5 x86_64
                  Started | 2015-03-05 14:31 (up 8+02:45:46)
                Databases | 4
                  Datadir | /usr/local/mysql-5.7.4/data/
                Processes | 1 connected, 1 running
              Replication | Is not a slave, has 0 slaves connected
                  Pidfile | /usr/local/mysql-5.7.4/data/tong1.pid (exists)
# Processlist ################################################

Command                        COUNT(*) Working SUM(Time) MAX(Time)
  ------------------------------ -------- ------- --------- ---------
  Query                                 1       1         0         0

User                           COUNT(*) Working SUM(Time) MAX(Time)
  ------------------------------ -------- ------- --------- ---------
  root                                  1       1         0         0

Host                           COUNT(*) Working SUM(Time) MAX(Time)
  ------------------------------ -------- ------- --------- ---------
  localhost                             1       1         0         0

db                             COUNT(*) Working SUM(Time) MAX(Time)
  ------------------------------ -------- ------- --------- ---------
  NULL                                  1       1         0         0

State                          COUNT(*) Working SUM(Time) MAX(Time)
  ------------------------------ -------- ------- --------- ---------
  starting                              1       1         0         0

# Status Counters (Wait 10 Seconds) ##########################
Variable                                Per day  Per second     10 secs
Bytes_received                             5000                     350
Bytes_sent                               350000           4        2250
Com_admin_commands                           90                        
Com_select                                    2                       1
Com_set_option                                1                        
Com_show_fields                              30                        
Com_show_master_status                       25                        
Com_show_processlist                         25                        
Com_show_slave_status                        25                        
Com_show_status                              45                        
Com_show_tables                               1                        
Com_show_variables                            1                        
Connections                                   2                       1
Created_tmp_disk_tables                       5                       1
Created_tmp_tables                           60                       6
Handler_external_lock                        25                        
Handler_read_key                              1                        
Handler_read_rnd_next                      9000                      40
Handler_write                              9000                      40
Innodb_buffer_pool_bytes_data            400000           4            
Innodb_buffer_pool_pages_flushed              4                        
Innodb_buffer_pool_read_requests            150                        
Innodb_buffer_pool_reads                     20                        
Innodb_buffer_pool_write_requests            40                        
Innodb_data_read                         350000           3            
Innodb_data_reads                            20                        
Innodb_data_writes                            6                        
Innodb_data_written                      150000           1            
Innodb_dblwr_pages_written                    4                        
Innodb_os_log_written                        60                        
Innodb_pages_created                          4                        
Innodb_pages_read                            20                        
Innodb_pages_written                          4                        
Innodb_num_open_files                         1                        
Innodb_available_undo_logs                   15                        
Key_read_requests                             1                        
Open_table_definitions                       15                        
Opened_files                                 45                       5
Opened_table_definitions                     15                        
Opened_tables                                15                        
Qcache_not_cached                             2                       1
Queries                                     250                       4
Questions                                   125                       4
Select_scan                                  30                        
Table_locks_immediate                        15                        
Table_open_cache_hits                        20                        
Table_open_cache_misses                      15                        
Uptime                                    90000           1           1
# Table cache ################################################
                     Size | 2000
                    Usage | 5%
# Key Percona Server features ################################
      Table & Index Stats | Not Supported
     Multiple I/O Threads | Enabled
     Corruption Resilient | Not Supported
      Durable Replication | Not Supported
     Import InnoDB Tables | Not Supported
     Fast Server Restarts | Not Supported
         Enhanced Logging | Not Supported
     Replica Perf Logging | Disabled
      Response Time Hist. | Not Supported
          Smooth Flushing | Not Supported
      HandlerSocket NoSQL | Not Supported
           Fast Hash UDFs | Unknown
# Percona XtraDB Cluster #####################################
# Plugins ####################################################
       InnoDB compression | ACTIVE
# Query cache ################################################
         query_cache_type | OFF
                     Size | 1.0M
                    Usage | 1%
         HitToInsertRatio | 0%
# Schema #####################################################
Specify --databases or --all-databases to dump and summarize schemas
# Noteworthy Technologies ####################################
                      SSL | No
     Explicit LOCK TABLES | No
           Delayed Insert | No
          XA Transactions | No
              NDB Cluster | No
      Prepared Statements | No
 Prepared statement count | 0
# InnoDB #####################################################
                  Version | 5.7.4
         Buffer Pool Size | 128.0M
         Buffer Pool Fill | 2%
        Buffer Pool Dirty | 0%
           File Per Table | ON
                Page Size | 16k
            Log File Size | 2 * 48.0M = 96.0M
          Log Buffer Size | 8M
             Flush Method |
      Flush Log At Commit | 1
               XA Support | ON
                Checksums | ON
              Doublewrite | ON
          R/W I/O Threads | 4 4
             I/O Capacity | 200
       Thread Concurrency | 0
      Concurrency Tickets | 5000
       Commit Concurrency | 0
      Txn Isolation Level | REPEATABLE-READ
        Adaptive Flushing | ON
      Adaptive Checkpoint |
           Checkpoint Age | 0
             InnoDB Queue | 0 queries inside InnoDB, 0 queries in queue
       Oldest Transaction | 0 Seconds
         History List Len | 18
               Read Views | 0
         Undo Log Entries | 0 transactions, 0 total undo, 0 max undo
        Pending I/O Reads | 0 buf pool reads, 0 normal AIO, 0 ibuf AIO, 0 preads
       Pending I/O Writes | 0 buf pool (0 LRU, 0 flush list, 0 page); 0 AIO, 0 sync, 0 log IO (0 log, 0 chkp); 0 pwrites
      Pending I/O Flushes | 0 buf pool, 0 log
       Transaction States | 1xnot started
# MyISAM #####################################################
                Key Cache | 8.0M
                 Pct Used | 20%
                Unflushed | 0%
# Security ###################################################
                    Users | 2 users, 0 anon, 0 w/o pw, 0 old pw
            Old Passwords | 0
# Binary Logging #############################################
                  Binlogs | 4
               Zero-Sized | 0
               Total Size | 6.7k
            binlog_format | STATEMENT
         expire_logs_days | 0
              sync_binlog | 0
                server_id | 10
             binlog_do_db |
         binlog_ignore_db |
# Noteworthy Variables #######################################
     Auto-Inc Incr/Offset | 1/1
   default_storage_engine | InnoDB
               flush_time | 0
             init_connect |
                init_file |
                 sql_mode | STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION
         join_buffer_size | 256k
         sort_buffer_size | 256k
         read_buffer_size | 128k
     read_rnd_buffer_size | 256k
       bulk_insert_buffer | 0.00
      max_heap_table_size | 16M
           tmp_table_size | 16M
       max_allowed_packet | 4M
             thread_stack | 256k
                      log |
                log_error | /usr/local/mysql-5.7.4/data/tong1.err
             log_warnings | 2
         log_slow_queries |
log_queries_not_using_indexes | OFF
        log_slave_updates | OFF
# Configuration File #########################################
              Config File | /etc/my.cnf

[mysqld]
basedir                             = /usr/local/mysql-5.7.4
datadir                             = /usr/local/mysql-5.7.4/data
port                                = 3306
server_id                           = 10
socket                              = /tmp/mysql.sock
log-bin                             = mysql-bin
sql_mode                            = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
# The End ####################################################
[[email protected] bin]#

3.使用pt-diskstats脚本查看数据库对磁盘的信息

[[email protected] bin]# ./pt-diskstats
  #ts device    rd_s rd_avkb rd_mb_s rd_mrg rd_cnc   rd_rt    wr_s wr_avkb wr_mb_s wr_mrg wr_cnc   wr_rt busy in_prg    io_s  qtime stime
  1.0 sda        0.0     0.0     0.0     0%    0.0     0.0     3.0     8.0     0.0    50%    0.0     8.0   5%      0     3.0    0.0   8.0
  1.0 sda3       0.0     0.0     0.0     0%    0.0     0.0     3.0     8.0     0.0    50%    0.0     8.0   5%      0     3.0    0.0   8.0

1.0 sda        0.0     0.0     0.0     0%    0.0     0.0     0.0     0.0     0.0     0%    0.0     0.0   0%      0     0.0    0.0   0.0
  1.0 sda3       0.0     0.0     0.0     0%    0.0     0.0     0.0     0.0     0.0     0%    0.0     0.0   0%      0     0.0    0.0   0.0

1.0 sda        0.0     0.0     0.0     0%    0.0     0.0     0.0     0.0     0.0     0%    0.0     0.0   0%      0     0.0    0.0   0.0
  1.0 sda3       0.0     0.0     0.0     0%    0.0     0.0     0.0     0.0     0.0     0%    0.0     0.0   0%      0     0.0    0.0   0.0

[[email protected] bin]#

时间: 2024-08-11 05:32:44

mysql监控工具之percona-toolkit集合的相关文章

Percona Toolkit 2.2.12 发布,MySQL 管理工具

Percona Toolkit 2.2.12 发布了, Percona Toolkit 是一组高级的命令行工具,用来管理 MySQL 和系统任务. 改进内容包括: New Features: pt-stalk now gathers dmesg output from up to 60 seconds before the triggering event. Bugs Fixed: Fixed bug 1376561 : pt-archiver was not able to archive a

Percona Toolkit mysql辅助利器

1 PT介绍 Percona Toolkit简称pt工具—PT-Tools,是Percona公司开发用于管理MySQL的工具,功能包括检查主从复制的数据一致性.检查重复索引.定位IO占用高的表文件.在线DDL等,DBA熟悉掌握后将极大提高工作效率. 2 PT 安装 下载地址 :https://www.percona.com/downloads/percona-toolkit/ 下载完上传到linux 服务器 安装PT [[email protected] ~]# yum -y install p

Mysql监控工具小集合

介绍一些常见的Mysql监控工具. Cacti Cacti是 一套基于PHP,MySQL,SNMP及RRDTool开发的网络流量监测图形分析工具.它通过snmpget来获取数据,使用 RRDtool绘画图形,而且你完全可以不需要了解RRDtool复杂的参数.它提供了非常强大的数据和用户管理功能,可以指定每一个用户能查看树状结 构.host以及任何一张图,还可以与LDAP结合进行用户验证,同时也能自己增加模板,功能非常强大完善,界面友好. MysqlReport MysqlReport 实际上只是

pt(Percona Toolkit)工具详解:(一)安装

pt(Percona Toolkit)工具是由Percona公司开发的一个用perl语言编写的工具集,包含很多功能,例如在线更改数据表结构,校验主从数据,检查数据库状态,分析慢查询等这些靠人手做起来比较麻烦的事情,功能强大,操作简单. 安装 既然是perl语言开发的工具集,那当然是先安装perl相关依赖包了 yum install -y perl perl-IO-Socket-SSL perl-DBD-MySQL perl-Time-HiRes perl-Digest-MD5 然后,就到下面这个

Percona Toolkit 学习(四)(heartbeat, index-usage,ioprofile,killmextmysql-summary)

seconds_behind_master含义及不足 seconds_behind_master的值是通过将salve服务器当前的时间戳与二进制日志中的事件的时间戳相比得到的,所以只有执行事件时才会报告延迟. 1.1 如果备库复制线程没有运行,就会报延迟为null.1.2 一些错误比如网络不稳定可能导致复制中断或停止复制线程,但是seconds_behind_master将显示为0,而不是显示错误1.3 即使备库线程正在运行,备库有时候可能无法计算延时,如果发生这种情况,备库会报0或者null.

Percona Toolkit 的安装与使用(安装篇)

Percona Toolkit 是一个相当好用的mysql管理工具.这里记录下最简单的安装方法.比源码安装要方便多了. wget https://www.percona.com/downloads/percona-toolkit/2.2.17/RPM/percona-toolkit-2.2.17-1.noarch.rpm   yum install percona-toolkit-2.2.17-1.noarch.rpm 这样就安装好了.够简单了吧 如果你习惯用rpm包来安装的话,可能要手动解决依

Percona Toolkit 安装

Percona Toolkit(pt工具)是一组用于维护数据库的命令行工具, 大部分是Perl脚本, 其连接数据库, 需要DBI和DBD::mysql的支持. 直接使用yum安装这两个软件包就行. # yum install perl-DBI perl-DBD-MySQL 安装pt工具的依赖后, 就是安装pt本身了(percona-toolkit-3.0.3_x86_64.tar.gz), 这里指定其安装的目录. # perl Makefile.PLPREFIX=/usr/local/perco

MySQL Study之--Percona server 5.5升级5.6

MySQL Study之--Percona server 5.5升级5.6 系统环境:      操作系统:CentOS_6.5(64)            MySQL:   Percona server 5.5(5.6) 一.升级的目的 为什么MySQL升级是必须的? 原因有很多,比如:为了使用新增的特性,基于性能方面的考量, 修复的bug. 但是在没有充分的测试以前就应用到你的应用中是非常危险的, 因为升级可以能会让你的应用不能正常运作- 也可能引起性能的问题. 此外, 我建议你关注MyS

MySQL Study之--Percona Server版本号

MySQL Study之--Percona Server版本号 1.简单介绍 Percona 为 MySQL 数据库server进行了改进,在功能和性能上较 MySQL 有着非常显著的提升.该版本号提升了在高负载情况下的 InnoDB 的性能.为 DBA 提供一些非常实用的性能诊断工具:另外有很多其它的參数和命令来控制server行为. 2.特点 Percona Server 仅仅包括 MySQL 的server版,并没有提供对应对 MySQL 的 Connector 和 GUI 工具进行改进.