pt-mysql-summary:本地安装、然后远程收集MySQL
Server的基本信息
在安装percona-toolkit的时候,这个组件也一起安装完成了:安装参考:http://blog.csdn.net/mchdba/article/details/14209765
要先在数据库里面建立监控帐号:
grant all on *.* to pt@''%" identified by 'pt';
执行命令,察看结果
[root@472322 ~]#pt-mysql-summary --user=pt --password='pt' --port=3308
-S /data56m1/mysql3308.sock
Warning: Using a password on the command line interface can be insecure.
# Percona Toolkit MySQL Summary Report #######################
System time | 2013-11-07 03:38:14 UTC (local TZ: CST -0600)
(1)第一部分实例信息,有个参数需要特别注意、Time 指的是MySQL 服务器的当前时间、而不是MySQL 服务器所在的系统的时间
# Instances ##################################################
Port Data Directory Nice OOM Socket ===== ========================== ==== === ====== 3309 /data56m2 0 0 /data56m2/mysql3309.sock 3308 /data56m1 0 0 /data56m1/mysql3308.sock /data56 0 0 # MySQL Executable ########################################### Path to executable | /usr/local/mysql56/bin/mysqld Has symbols | Yes Path to executable | /usr/local/mysql56m1/bin/mysqld Has symbols | Yes Path to executable | /usr/local/mysql56m2/bin/mysqld Has symbols | Yes# Report On Port 3308 ######################################## User | pt@localhost Time | 2013-11-06 21:38:14 (CDT) Hostname | 472322.ea.com Version | 5.6.13-log Source distribution Built On | Linux x86_64 Started | 2013-09-12 02:21 (up 55+19:16:16) Databases | 4 Datadir | /data56m1/ Processes | 2 connected, 2 running Replication | Is a slave, has 1 slaves connected Pidfile | /data56m1/472322.ea.com.pid (exists)# Processlist ################################################(2)第二部分是从show full processlist;中来的信息,对每一列进行了一些分析统计。
Command COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- ---------
Binlog Dump 1 1 1750000 1750000
Connect 2 2 2000000 1750000
Query 1 1 0 0
User COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- ---------
pt 1 1 0 0
repl 1 1 1750000 1750000
system user 2 2 2000000 1750000
Host COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- ---------
2 2 2000000 1750000
472322-esxapp16.ea.com 1 1 1750000 1750000
localhost 1 1 0 0
db COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- ---------
NULL 4 4 3500000 1750000
State COUNT(*) Working SUM(Time) MAX(Time)
------------------------------ -------- ------- --------- ---------
init 1 1 0 0
Master has sent all binlog to 1 1 1750000 1750000
Slave has read all relay log; 1 1 175000 175000
Waiting for master to send eve 1 1 1750000 1750000
(3)第三部分是从取自 show global status 、仅收集哪些变化的量,比较有价值的应该是第三列Per
day Per second、取自两张快照、除以变化量、算出每秒的变化
# Status Counters (Wait 10 Seconds) ##########################
Variable Per day Per second 11 secs
Bytes_received 3000 350
Bytes_sent 7000 2000
Com_select 1 1
Com_set_option 2
Connections 1 1
Created_tmp_disk_tables 1
Created_tmp_tables 3 5
Handler_commit 1
Handler_external_lock 6
Handler_prepare 1
Handler_read_rnd_next 40 35
Handler_write 35 35
Innodb_buffer_pool_bytes_data 125000 1
Innodb_buffer_pool_pages_flushed 10
Innodb_buffer_pool_read_requests 125
Innodb_buffer_pool_reads 3
Innodb_buffer_pool_write_requests 60
Innodb_data_fsyncs 5
Innodb_data_read 125000 1
Innodb_data_reads 5
Innodb_data_writes 9
Innodb_data_written 400000 4
Innodb_dblwr_pages_written 10
Innodb_log_write_requests 9
Innodb_log_writes 1
Innodb_os_log_fsyncs 1
Innodb_os_log_written 5000
Innodb_pages_created 3
Innodb_pages_read 3
Innodb_pages_written 10
Innodb_available_undo_logs 2
Open_table_definitions 1
Opened_files 9 4
Opened_table_definitions 1
Opened_tables 2
Qcache_not_cached 1 1
Queries 10 3
Questions 9 3
Select_scan 2
Slave_received_heartbeats 45
Table_locks_immediate 3
Table_open_cache_hits 3
Table_open_cache_misses 1
Uptime 90000 1 1
(4)第四部分显示表缓存的大小、Usage表示在用的百分比,是一个比较近似的值。
# Table cache ################################################
Size | 2000
Usage | 4%
(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 #####################################
(6)第六部分显示当前的插件以及状态。
# Plugins ####################################################
InnoDB compression | ACTIVE
(7)第七部分显示Query cache的参数值以及命中率。
# Query cache ################################################
query_cache_type | OFF
Size | 1.0M
Usage | 1%
HitToInsertRatio | 0%
# Schema #####################################################
(8)第八部分显示当前db下需要关注的一些点,比如SSL,Delayed Insert等。
Would you like to mysqldump -d the schema and analyze it? y/n n
Skipping schema analysis
# 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 #####################################################
# MyISAM #####################################################
Key Cache | 8.0M
Pct Used | 20%
Unflushed | 0%
# Security ###################################################
Users | 9 users, 2 anon, 6 w/o pw, 6 old pw
Old Passwords | 0
# Binary Logging #############################################
Binlogs | 4
Zero-Sized | 0
Total Size | 1.2M
binlog_format | MIXED
expire_logs_days | 0
sync_binlog | 0
server_id | 11
binlog_do_db |
binlog_ignore_db |
(9)第九部分显示当前的一些buffer参数值。
# 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 | /data56m1/error.err log_warnings | 1 log_slow_queries |log_queries_not_using_indexes | OFF log_slave_updates | ON# Configuration File ######################################### Config File | Cannot autodetect or find, giving up# The End ####################################################
分享到:
相关推荐
mysql-connector-j-8.2.0.zip
mysql 5.7安全审计插件 Linux X86-X64通用...audit-plugin-mysql-5.7-1.1.7 for Linux 等保开启审计插件,貌似官网找不到,发出来共享. 缺点:日志信息比较大,对性能影响大。 优点:对每一时刻每一用户的操作都有记录。
mysql-connector-java-5.1.40.tar.gz上传到Linux系统中,然后在Linux系统中新打开一个终端,在终端中执行命令解压缩文件:
mysql-connector-java-5.1.48-bin用于连接mysql数据库
这是在Linux里需要安装的64位的MySQL数据库文件,欢迎大家来此下载资源。有问题欢迎反馈,互相讨论学习进步
mysql-connector-java-5.1.40-bin.jar连接器,用于在hive和mysql的数据库连接
MySQL-client-5.5.23-1.linux2.6.i386.rpm
mysql-community-libs-5.7.34-1.el7.x86_64.rpm
mysql-connector-odbc-win32.zip
官方的MySQL ODBC驱动程序,最新版本。
mysql5.5msi 32位安装包,安装过程可以选择直接将path路径加入windows,无需后续配置,非常方便,适合新手下载使用
MySQL5.5 安装程序,不要进行任何配置,只需解压,进行下一步。
各种版本的mysql都在这里,不用积分下载了,http://mvnrepository.com/artifact/mysql/mysql-connector-java
installer-community-5.7.20.0.msi、mysql-installer-community-5.7.23.0.msi和mysql-installer-community-5.7.27.0.msi、以及安装MySQL之前必用的vcredist_x64.exe和vcredist_x86.exe、MySQL的图形化工具Navicat_...
2、MySQL的启动、登录以及配置方式 难点及措施 MySQL的安装 MySQL的登陆和配置 教学方式 教学采用教师课堂讲授为主,使用教学PPT讲解 教 学 过 程 第一课时 (数据库基础知识) 一、创设情境,导入数据库的概念 (1...
mac版本,mysql-8.0.20-macos10.15-x86_64.dmg,mysql,2020最新版的,有需要的拿走,不谢
jdk1.5 连接 mysql5.1 版本 mysql-connector-java-3.1.13-bin. 经过本人测试绝对能用。
mysql-8.0.18-macos10.14-x86_64 官网最新版2019年11月09日13:41:17,百度网盘链接
我是使用这个版本在虚拟机上搭建msyql主从复制的,此处是一个压缩包,解压后可以看到server和client
MySQL Workbench 8.0.20 macOS (x86, 64-bit), DMG Archive 可供开发学习使用