zoukankan      html  css  js  c++  java
  • pt-stalk

    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 1 -- --user=root --password='c0BsZjR57MgAGOk6IWZAMarVVg0' --socket=./tmp/mysql.sock 
    Overwriting PID file /var/run/pt-stalk.pid because its PID (15881) is not running
    2013_12_25_11_11_16 Starting /data1/guosong/bin/pt-tool/bin/pt-stalk --function=status --variable=Threads_connected --threshold=1 --match= --cycles=5 --interval=1 --iterations= --run-time=30 --sleep=300 --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)=2, matched=yes, cycles_true=1
    2013_12_25_11_11_54 Check results: status(Threads_connected)=2, matched=yes, cycles_true=2
    2013_12_25_11_11_55 Check results: status(Threads_connected)=2, matched=yes, cycles_true=3
    2013_12_25_11_11_56 Check results: status(Threads_connected)=2, matched=yes, cycles_true=4
    2013_12_25_11_11_57 Check results: status(Threads_connected)=2, matched=yes, cycles_true=5
    2013_12_25_11_11_57 Collect 1 triggered
    2013_12_25_11_11_57 Collect 1 PID 17396
    2013_12_25_11_12_06 Collect 1 done
    2013_12_25_11_12_06 Sleeping 300 seconds after collect

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

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

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

  • 相关阅读:
    Debug权限提升
    QTime的本质上是一个int,QDateTime本质上是一个qint64
    QString先于QObject存在,因为QObject::objectName()返回的是QString
    C++杂记:运行时类型识别(RTTI)与动态类型转换原理
    gcc/g++编译(生动形象,从最容易入手的hello world解释了库的概念)
    分布式存储
    开源代码——Crouton
    android studio
    WebRTC
    FileProvider是个什么东西?
  • 原文地址:https://www.cnblogs.com/gsblog/p/3490260.html
Copyright © 2011-2022 走看看