Preface
 
    Sometimes we need to collect information of  MySQL server as a report when we first time take over the system by someone else.Espcially there're lots of  servers for you to check them one by one with manual command.We need a simple tool to increase the efficiency when doing so.
 
Introduce
 
    pt-mysql-summary can help us to print information of our MySQL servers nicely.It's not a tuning or diagnostic tool but a tool just provides us a report with neat format.
 
Procedure
 
Usage
 pt-mysql-summary [OPTIONS]

Common Parameters

 --all-databases //Specify the scope is all databases for summarizing.
--databases //Specify the only database for summarizing.
--default-files //Specify the configuration file to use.
--list-encrypted-tables //Specify to contain encrypted tables in all databases.
--read-samples //Create a report from this file you sepcified.
--save-samples //Save to the direcotry you want to store the summary.
--sleep //Seconds to sleep for counter.
Example
 
Execute pt-mysql-summary with just connect options(single master).
 [root@zlm1 :: ~]
#pt-mysql-summary --user=root --password=Passw0rd --host=localhost
mysql: [Warning] Using a password on the command line interface can be insecure.
# Percona Toolkit MySQL Summary Report #######################
System time | -- :: UTC (local TZ: CEST +)
# Instances ##################################################
Port Data Directory Nice OOM Socket
===== ========================== ==== === ======
# MySQL Executable ###########################################
# Slave Hosts ################################################
No slaves found //The slave server is not started up yet.
# Report On Port ######################################## //Summary of overall of MySQL server.
User | root@localhost
Time | -- :: (CEST)
Hostname | zlm1
Version | 5.7.-log MySQL Community Server (GPL)
Built On | linux-glibc2. x86_64
Started | -- : (up +::)
Databases |
Datadir | /data/mysql/mysql3306/data/
Processes | connected, running
Replication | Is not a slave, has slaves connected
Pidfile | mysql.pid (does not exist)
# Processlist ################################################ //This is all the contents in processlist. Command COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- ---------
Query
Sleep User COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- ---------
monitor
root Host COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- ---------
localhost
zlm1 db COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- ---------
NULL State COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- --------- starting # Status Counters (Wait Seconds) ########################## //This paragragh shows the global status of MySQL and with 10 secs' differential values.
Variable Per day Per second secs
Bytes_received
Bytes_sent
Com_admin_commands
Com_select
Com_set_option
Com_show_slave_status
Com_show_status
Com_show_variables
Connections
Created_tmp_files
Created_tmp_tables
Flush_commands
Handler_commit
Handler_external_lock
Handler_read_first
Handler_read_key
Handler_read_next
Handler_read_rnd_next
Handler_write
Innodb_buffer_pool_bytes_data
Innodb_buffer_pool_pages_flushed
Innodb_buffer_pool_read_requests
Innodb_buffer_pool_reads
Innodb_buffer_pool_write_requests
Innodb_data_fsyncs
Innodb_data_read
Innodb_data_reads
Innodb_data_writes
Innodb_data_written
Innodb_dblwr_pages_written
Innodb_dblwr_writes
Innodb_log_writes
Innodb_os_log_fsyncs
Innodb_os_log_written
Innodb_pages_created
Innodb_pages_read
Innodb_pages_written
Innodb_rows_read
Innodb_num_open_files
Innodb_available_undo_logs
Key_read_requests
Key_reads
Open_table_definitions
Opened_files
Opened_table_definitions
Opened_tables
Queries
Questions
Select_scan
Table_locks_immediate
Table_open_cache_hits
Table_open_cache_misses
Threads_created
Uptime
# Table cache ################################################
Size |
Usage | %
# Key Percona Server features ################################ //Because mine is not percona version,so most of the features are not supported.
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 | Enabled
Response Time Hist. | Not Supported
Smooth Flushing | Not Supported
HandlerSocket NoSQL | Not Supported
Fast Hash UDFs | Unknown
# Percona XtraDB Cluster ##################################### //If we are using PXC structure,this paragraph will show the detail of it.
# Plugins ####################################################
InnoDB compression | ACTIVE
# Query cache ################################################
query_cache_type | OFF
Size | 0.0
Usage | %
HitToInsertRatio | %
# Semisynchronous Replication ################################ //Information of semi-replication if there's a master-slave replication.
Master | Disabled
Slave | Disabled
# 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 |
# InnoDB #####################################################
Version | 5.7.
Buffer Pool Size | 100.0M
Buffer Pool Fill | %
Buffer Pool Dirty | %
File Per Table | ON
Page Size | 16k
Log File Size | * 100.0M = 300.0M
Log Buffer Size | 8M
Flush Method | O_DIRECT
Flush Log At Commit |
XA Support | ON
Checksums | ON
Doublewrite | ON
R/W I/O Threads |
I/O Capacity |
Thread Concurrency |
Concurrency Tickets |
Commit Concurrency |
Txn Isolation Level | READ-COMMITTED
Adaptive Flushing | ON
Adaptive Checkpoint |
Checkpoint Age |
InnoDB Queue | queries inside InnoDB, queries in queue
Oldest Transaction | Seconds
History List Len |
Read Views |
Undo Log Entries | transactions, total undo, max undo
Pending I/O Reads | buf pool reads, normal AIO, ibuf AIO, preads
Pending I/O Writes | buf pool ( LRU, flush list, page); AIO, sync, log IO ( log, chkp); pwrites
Pending I/O Flushes | buf pool, log
Transaction States | 1xnot started
# MyISAM #####################################################
Key Cache | 8.0M
Pct Used | %
Unflushed | %
# Security ###################################################
Users | users, anon, w/o pw, old pw
Old Passwords |
# Encryption #################################################
mysql: [Warning] Using a password on the command line interface can be insecure.
No keyring plugins found
# Binary Logging #############################################
Binlogs |
Zero-Sized |
Total Size | .0k
binlog_format | ROW
expire_logs_days |
sync_binlog |
server_id |
binlog_do_db |
binlog_ignore_db |
# Noteworthy Variables #######################################
Auto-Inc Incr/Offset | /
default_storage_engine | InnoDB
flush_time |
init_connect |
init_file |
sql_mode | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
join_buffer_size | 128k
sort_buffer_size | 128k
read_buffer_size | 2M
read_rnd_buffer_size | 16M
bulk_insert_buffer | 0.00
max_heap_table_size | 96M
tmp_table_size | 96M
max_allowed_packet | 4M
thread_stack | 192k
log |
log_error | ./error.log
log_warnings |
log_slow_queries |
log_queries_not_using_indexes | OFF
log_slave_updates | ON
# Configuration File #########################################
Config File | /etc/my.cnf [mysqld]
datadir = /var/lib/mysql
socket = /var/lib/mysql/mysql.sock
symbolic-links = [mysqld_safe]
log-error = /var/log/mariadb/mariadb.log
pid-file = /var/run/mariadb/mariadb.pid [mysql]
prompt = "\\u@\\h:\\p [\\d]\\>"
user = zlm
password = zlmzlm
host = 192.168.56.100 [client]
user = zlm
password = zlmzlm
socket = /tmp/mysql3306.sock
host = 192.168.56.100
# Memory management library ##################################
jemalloc is not enabled in mysql config for process with id
# The End #################################################### [root@zlm1 :: ~]
#

Execute it again while slave is working normally with option "--database" and "--save-samples"

 [root@zlm1 :: ~]
#pt-mysql-summary --user=root --password=Passw0rd --host=localhost --databases zlm --save-samples=/root/zlm.rpl
mysql: [Warning] Using a password on the command line interface can be insecure.
# Percona Toolkit MySQL Summary Report #######################
System time | -- :: UTC (local TZ: CEST +)
# Instances ##################################################
Port Data Directory Nice OOM Socket
===== ========================== ==== === ======
# MySQL Executable ###########################################
# Slave Hosts ################################################ //Now,it shows the slave's information.
*************************** . row ***************************
Server_id:
Host:
Port:
Master_id:
Slave_UUID: 2b199d1f-94df-11e8-ae46-080027de0e0e
# Report On Port ########################################
User | root@localhost
Time | -- :: (CEST)
Hostname | zlm1
Version | 5.7.-log MySQL Community Server (GPL)
Built On | linux-glibc2. x86_64
Started | -- : (up +::)
Databases |
Datadir | /data/mysql/mysql3306/data/
Processes | connected, running
Replication | Is not a slave, has slaves connected
Pidfile | mysql.pid (does not exist)
# Processlist ################################################ Command COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- ---------
Binlog Dump GTID
Query
Sleep User COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- ---------
monitor
repl
root Host COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- ---------
localhost
zlm1
zlm2 db COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- ---------
NULL State COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- --------- Master has sent all binlog to //This is the dump thread of master working in replicatoin.
starting # Status Counters (Wait Seconds) ##########################
Variable Per day Per second secs
Bytes_received
Bytes_sent
Com_admin_commands
Com_select
Com_set_option
Com_show_binlogs
Com_show_databases
Com_show_engine_status
Com_show_master_status
Com_show_plugins
Com_show_processlist
Com_show_slave_hosts
Com_show_slave_status
Com_show_status
Com_show_storage_engines
Com_show_variables
Connections
Created_tmp_disk_tables
Created_tmp_files
Created_tmp_tables
Flush_commands
Handler_commit
Handler_external_lock
Handler_read_first
Handler_read_key
Handler_read_next
Handler_read_rnd_next
Handler_write
Innodb_buffer_pool_bytes_data
Innodb_buffer_pool_pages_flushed
Innodb_buffer_pool_read_requests
Innodb_buffer_pool_reads
Innodb_buffer_pool_write_requests
Innodb_data_fsyncs
Innodb_data_read
Innodb_data_reads
Innodb_data_writes
Innodb_data_written
Innodb_dblwr_pages_written
Innodb_dblwr_writes
Innodb_log_writes
Innodb_os_log_fsyncs
Innodb_os_log_written
Innodb_pages_created
Innodb_pages_read
Innodb_pages_written
Innodb_rows_inserted
Innodb_rows_read
Innodb_num_open_files
Innodb_available_undo_logs
Key_read_requests
Key_reads
Open_table_definitions
Opened_files
Opened_table_definitions
Opened_tables
Queries
Questions
Select_scan
Table_locks_immediate
Table_open_cache_hits
Table_open_cache_misses
Threads_created
Uptime
# Table cache ################################################
Size |
Usage | %
# 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 | Enabled
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 | 0.0
Usage | %
HitToInsertRatio | %
# Semisynchronous Replication ################################ //The semi-sync replication is still not used.
Master | Disabled
Slave | Disabled
# Schema ##################################################### //Because of the option of "--databases",it shows the detail of it. Database Tables Views SPs Trigs Funcs FKs Partn
zlm Database InnoDB
zlm Database
zlm i c
n h
t a
r
Database === ===
zlm # Noteworthy Technologies ####################################
Full Text Indexing | No
Geospatial Types | No
Foreign Keys | No
Partitioning | No
InnoDB Compression | No
SSL | No
Explicit LOCK TABLES | No
Delayed Insert | No
XA Transactions | No
NDB Cluster | No
Prepared Statements | No
Prepared statement count |
# InnoDB #####################################################
Version | 5.7.
Buffer Pool Size | 100.0M
Buffer Pool Fill | %
Buffer Pool Dirty | %
File Per Table | ON
Page Size | 16k
Log File Size | * 100.0M = 300.0M
Log Buffer Size | 8M
Flush Method | O_DIRECT
Flush Log At Commit |
XA Support | ON
Checksums | ON
Doublewrite | ON
R/W I/O Threads |
I/O Capacity |
Thread Concurrency |
Concurrency Tickets |
Commit Concurrency |
Txn Isolation Level | READ-COMMITTED
Adaptive Flushing | ON
Adaptive Checkpoint |
Checkpoint Age |
InnoDB Queue | queries inside InnoDB, queries in queue
Oldest Transaction | Seconds
History List Len |
Read Views |
Undo Log Entries | transactions, total undo, max undo
Pending I/O Reads | buf pool reads, normal AIO, ibuf AIO, preads
Pending I/O Writes | buf pool ( LRU, flush list, page); AIO, sync, log IO ( log, chkp); pwrites
Pending I/O Flushes | buf pool, log
Transaction States | 1xnot started
# MyISAM #####################################################
Key Cache | 8.0M
Pct Used | %
Unflushed | %
# Security ###################################################
Users | users, anon, w/o pw, old pw
Old Passwords |
# Encryption #################################################
mysql: [Warning] Using a password on the command line interface can be insecure.
No keyring plugins found
# Binary Logging #############################################
Binlogs |
Zero-Sized |
Total Size | .0k
binlog_format | ROW
expire_logs_days |
sync_binlog |
server_id |
binlog_do_db |
binlog_ignore_db |
# Noteworthy Variables #######################################
Auto-Inc Incr/Offset | /
default_storage_engine | InnoDB
flush_time |
init_connect |
init_file |
sql_mode | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
join_buffer_size | 128k
sort_buffer_size | 128k
read_buffer_size | 2M
read_rnd_buffer_size | 16M
bulk_insert_buffer | 0.00
max_heap_table_size | 96M
tmp_table_size | 96M
max_allowed_packet | 4M
thread_stack | 192k
log |
log_error | ./error.log
log_warnings |
log_slow_queries |
log_queries_not_using_indexes | OFF
log_slave_updates | ON
# Configuration File #########################################
Config File | /etc/my.cnf [mysqld]
datadir = /var/lib/mysql
socket = /var/lib/mysql/mysql.sock
symbolic-links = [mysqld_safe]
log-error = /var/log/mariadb/mariadb.log
pid-file = /var/run/mariadb/mariadb.pid [mysql]
prompt = "\\u@\\h:\\p [\\d]\\>"
user = zlm
password = zlmzlm
host = 192.168.56.100 [client]
user = zlm
password = zlmzlm
socket = /tmp/mysql3306.sock
host = 192.168.56.100
# Memory management library ##################################
jemalloc is not enabled in mysql config for process with id
# The End #################################################### [root@zlm1 :: ~]
#ls -l|grep rpl
drwxr-xr-x root root Aug : zlm.rpl [root@zlm1 :: ~]
#cd zlm.rpl [root@zlm1 :: ~/zlm.rpl]
#ls -l
total
-rw-r--r-- root root Aug : collect.err
-rw-r--r-- root root Aug : innodb-status
-rw-r--r-- root root Aug : mysql-config-file
-rw-r--r-- root root Aug : mysql-databases
-rw-r--r-- root root Aug : mysqld-executables
-rw-r--r-- root root Aug : mysqld-instances
-rw-r--r-- root root Aug : mysqldump
-rw-r--r-- root root Aug : mysql-master-logs
-rw-r--r-- root root Aug : mysql-master-status
-rw-r--r-- root root Aug : mysql-plugins
-rw-r--r-- root root Aug : mysql-processlist
-rw-r--r-- root root Aug : mysql-roles
-rw-r--r-- root root Aug : mysql-slave
-rw-r--r-- root root Aug : mysql-slave-hosts
-rw-r--r-- root root Aug : mysql-status
-rw-r--r-- root root Aug : mysql-status-defer
-rw-r--r-- root root Aug : mysql-users
-rw-r--r-- root root Aug : mysql-variables
-rw-r--r-- root root Aug : ndb-status //The directory of "zlm.rpl" contains individual collecting information of the connected MySQL server.You can check them for future use.
Summary
  • pt-mysql-summary is a report tool for collecting information of MySQL servers.
  • It's easy enough to use by merely specify several connection options.
  • It can tremendously increase the efficiency of summaring a large amount of MySQL servers.

Percona-Tookit工具包之pt-mysql-summary的更多相关文章

  1. percona innobackupex 遇到 connect to MySQL server as DBD::mysql module is not installed 问题

    percona innobackupex connect to MySQL server as DBD::mysql module is not installed [root@mysql softw ...

  2. 利用Percona monitoring for zabbix监控MySQL

    系统要求 被监控的主机及mysql监控账号,zabbix agent 2.0或以上(最好与zabbix-server版本相同),php, php-mysql(php版本没有限制,经测试5.3是可以的. ...

  3. 【Linux】【Database】【MySQL】使用percona搭建高可用的MySQL数据库

    1. 简介 1.1. 官方文档: 数据库架构:https://docs.openstack.org/ha-guide/shared-database.html 1.2. 本次使用的的是Percona ...

  4. SQL慢查询安装过程

    SQL慢查询 基本操作 打开防火墙 firewall-cmd --zone=public --add-port=3306/tcp --permanent firewall-cmd --reload 安 ...

  5. Percona Toolkit mysql辅助利器

    1 PT介绍 Percona Toolkit简称pt工具—PT-Tools,是Percona公司开发用于管理MySQL的工具,功能包括检查主从复制的数据一致性.检查重复索引.定位IO占用高的表文件.在 ...

  6. Mysql 主从一致校验工具------Maatkit工具包

    Maatkit工具包 http://www.maatkit.org/ 简介 maatkit是一个开源的工具包,为mysql日常管理提供了帮助.目前,已被Percona公司收购并维护.其中: mk-ta ...

  7. mysql高可用之PXC(Percona XtraDB Cluster)

    简介 Percona XtraDB Cluster是MySQL高可用性和可扩展性的解决方案,Percona XtraDB Cluster提供的特性如下: 1).同步复制,事务要么在所有节点提交或不提交 ...

  8. 【MySQL】TokuDB引擎初探(MySQL升级为Percona,MySQL升级为MariaDB)

    参考:http://blog.sina.com.cn/s/blog_4673e6030102v46l.html 参考:http://hcymysql.blog.51cto.com/5223301/14 ...

  9. MySQL/MariaDB/Percona数据库升级脚本

    MySQL/MariaDB/Percona数据库升级脚本截取<OneinStack>中upgrade_db.sh, 一般情况下不建议升级数据库版本,该脚本专提供给各位版本控们.为防止大版本 ...

  10. MySQL分支Percona, cmake编译安装

    Percona是在MySQL基础上改进的,在功能和性能上有着很显著的提升.该版本提升了在高负载情况下的InnoDB的性能,为DBA提供一些非常有用的性能诊断工具:另外有更多的参数和命令来控制服务器行为 ...

随机推荐

  1. 自定义Powershell提示符

    实现效果: 实现原理: Powershell将个人配置脚本文件的地址存放在$profile变量中, 通过修改该变量达到想要的目的. 实现过程: 1>创建一个新的配置脚本: 2>编辑脚本内容 ...

  2. cascade DecodeBBox层

    https://zhuanlan.zhihu.com/p/36095768 我的推断,第二第三阶段应该不是把所有anchor进行bounding box regression,然后再选取当前条件下的所 ...

  3. js时间日期格式

    Date.prototype.format = function(format){ var o = { "M+" : this.getMonth()+1, //month &quo ...

  4. 【洛谷P1538】迎春舞会之数字舞蹈

    迎春舞会之数字舞蹈 题目链接 一道奇怪的模拟题, 先将样例输出复制下来,观察观察 -- -- -- -- -- -- -- -- ① | | | | | | | | | | | | | | ② | | ...

  5. Android学习笔记_17_Intent匹配规则(隐式意图)

    Android基本的设计理念是鼓励减少组件间的耦合,因此Android提供了Intent (意图) ,Intent提供了一种通用的消息系统,它允许在你的应用程序与其它的应用程序间传递Intent来执行 ...

  6. Asset Store 下载的package存在什么地方?

    发现从Asset store下载的packages都不知道放在了什么地方 Windows 7,C:\Users\<username>\AppData\Roaming\Unity\Asset ...

  7. 论坛数据转换discuz论坛?

    http://www.bbstobbs.com/thread-397-1-1.html

  8. ProjectOnline同步数据到线下

    根据微软官方文档 我们能将office365上的应用系统projectonline数据同步到线下. 我们看看projectonline上面的数据: 同步后到达sqlserver的数据 这样office ...

  9. CSS实战3

    1. z-index  层级   div 层 <!DOCTYPE html> <html> <head lang="en"> <meta ...

  10. SQL3120W 不能将xx的字段值转换成 INTEGER值

    一次用DB2 Load/Import导入数据时,报错,提示SQL3120W 不能将xx的字段值转换成 INTEGER值,但目标列不可为空.未装入该行. 目标表: CREATE TABLE TEST( ...