1、名词解释
Collect forensic data about MySQL when problems occur
在问题发生的时候采集现场数据
pt-stalk waits for a trigger condition to occur, then collects data to help diagnose problems. The tool is designed to run as a daemon with root privileges, so that you can diagnose intermittent problems that you cannot observe directly. You can also use it to execute a custom command, or to collect data on demand without waiting for the trigger to occur
 

在一定条件下触发,采集一些监控数据便于分析问题。运行该功能需要有root权限。可以作为一个实时采集的功能,也可以设置触发条件。

2、例子

[root@typhoeus79 mysql_5580]# pt-stalk --collect-tcpdump --function status --variable Threads_connected --threshold  -- --user=root --password='c0BsZjR57MgAGOk6IWZAMarVVg0' --socket=./tmp/mysql.sock
Overwriting PID file /var/run/pt-stalk.pid because its PID () is not running
2013_12_25_11_11_16 Starting /data1/guosong/bin/pt-tool/bin/pt-stalk --function=status --variable=Threads_connected --threshold= --match= --cycles= --interval= --iterations= --run-time= --sleep= --dest=/var/lib/pt-stalk --prefix= --notify-by-email= --log=/var/log/pt-stalk.log --pid=/var/run/pt-stalk.pid --plugin=
2013_12_25_11_11_53 Check results: status(Threads_connected)=, matched=yes, cycles_true=
2013_12_25_11_11_54 Check results: status(Threads_connected)=, matched=yes, cycles_true=
2013_12_25_11_11_55 Check results: status(Threads_connected)=, matched=yes, cycles_true=
2013_12_25_11_11_56 Check results: status(Threads_connected)=, matched=yes, cycles_true=
2013_12_25_11_11_57 Check results: status(Threads_connected)=, matched=yes, cycles_true=
2013_12_25_11_11_57 Collect triggered
2013_12_25_11_11_57 Collect PID
2013_12_25_11_12_06 Collect done
2013_12_25_11_12_06 Sleeping seconds after collect

采集的数据放在--dest目录下,包含如下文件:

这些数据都是原始数据,我们可以根据这些来分析当时MySQL或者主机是否有异常

http://www.orczhou.com/index.php/2012/06/mysql-troubleshooting-with-pt-stakl/

最新文章

  1. C# 本质论 第四章 方法和参数
  2. 【APICloud】APICloud基础学习与快速入门
  3. leetcode 153. Find Minimum in Rotated Sorted Array
  4. android属性之excludeFromRecents -- clearTaskOnLaunch 隐身意图 启动activity
  5. SQL数据库基本语句
  6. 终端I/O之终端窗口的大小
  7. Power Strings(kmp妙解)
  8. Linux学习4——Vim和Bash
  9. http调用端HttpClient、DefaultHttpClient、CloseableHttpClient
  10. [bzoj4236]JOIOJI
  11. Envoy 源码分析--network
  12. 【代码笔记】Web-HTML-表格
  13. python3之枚举
  14. oracle 12c创建可插拔数据库(PDB)及用户
  15. GM Tech 2 works with Hummer Yes or No
  16. Java与.NET的WebServices相互调用
  17. 代码: js日期
  18. 2018.08.30 21:12 第一个Django程序完成
  19. 总结一发linux常用命令
  20. CentOS7 firewalld打开关闭防火墙 开放端口

热门文章

  1. Elasticsearch-sql 用SQL查询Elasticsearch
  2. JavaScript实现常见算法面试题
  3. cf290-2015-2-3总结与反思(dfs判断无向图是否有环)
  4. LINUX 笔记-VIM常用命令整理
  5. Hadoop(十四)MapReduce原理分析
  6. Java基础-流程控制(04)
  7. PhiloGL学习(3)——程序员的法宝—键盘、鼠标
  8. 正则表达式&常用JS校验
  9. [Bayesian] “我是bayesian我怕谁”系列 - Naive Bayes+prior
  10. linux学习(七)环境变量、cp、mv、cat,less,more,head,tail