Preface
 
    If we want to check out how many slaves in our replication environment.We can execute "show processlit;" on master.Whatif we'd like to check the detail of slaves.We have to execute "show slave status\G" on slaves.
 
Introduce
 
    pt-salve-find is a tool to find and print the the hierarchy tree of MySQL slaves.It can provide us a simple way to check out whether our slaves are working normally.
 
Procedure
 
Usage
 pt-slave-find [OPTIONS] [DSN]

Common parameter

 --host //Specify the host your want to connect.
--port //Specify the port of the server to connect.
--user //Specify the username of target instance.
--password //Specify the password of user.
Example
 
Check out the information on master.
 [root@zlm1 :: ~]
#pt-slave-find -h192.168.56. -P3306 -urepl -prepl4slave
192.168.56.100
Version 5.7.-log
Server ID
Uptime :: (started --21T09::)
Replication Is not a slave, has slaves connected, is not read_only
Filters
Binary logging ROW
Slave status
Slave mode STRICT
Auto-increment increment , offset
InnoDB version 5.7.
+- zlm3
Version 5.7.-log
Server ID
Uptime : (started --22T08::)
Replication Is a slave, has slaves connected, is not read_only
Filters
Binary logging ROW
Slave status seconds behind, running, no errors
Slave mode STRICT
Auto-increment increment , offset
InnoDB version 5.7.
+- zlm2
Version 5.7.-log
Server ID
Uptime :: (started --21T09::)
Replication Is a slave, has slaves connected, is not read_only
Filters
Binary logging ROW
Slave status seconds behind, running, no errors
Slave mode STRICT
Auto-increment increment , offset
InnoDB version 5.7.

Check out the information on slaves.

 [root@zlm1 :: ~]
#pt-slave-find -h192.168.56. -P3306 -urepl -prepl4slave
192.168.56.101
Version 5.7.-log
Server ID
Uptime :: (started --21T09::) //It shows that the slave has been run almost 24 hours.
Replication Is a slave, has slaves connected, is not read_only
Filters
Binary logging ROW
Slave status seconds behind, running, no errors
Slave mode STRICT
Auto-increment increment , offset
InnoDB version 5.7. [root@zlm1 :: ~]
#pt-slave-find -h192.168.56. -P3306 -urepl -prepl4slave
192.168.56.102
Version 5.7.-log
Server ID
Uptime : (started --22T08::) //This was the newly added slave 10 minutes ago.
Replication Is a slave, has slaves connected, is not read_only
Filters
Binary logging ROW
Slave status seconds behind, running, no errors
Slave mode STRICT
Auto-increment increment , offset
InnoDB version 5.7.
Summary
  • There're merely several simple connection parameters you need to specify.
  • It's convenient to get the information about slaves on master without executing any commands.
  • This tool can also be used to checkout the lag time of slaves.

Percona-Tookit工具包之pt-slave-find的更多相关文章

  1. 关于 percona monitoring plugins插件报slave is stoped on ip地址

    思路:肯定是某个item触发了触发器 去看触发器,找到 slave is stoped,如下图 看到键是mysql.running-slave ,然后去定义key的文件中查看该键对应的脚本,修改脚本. ...

  2. Mysql: pt-table-checksum 和 pt-table-sync 检查主从一致性,实验过程

    一.安装 percona 包 1.安装仓库的包 https://www.percona.com/doc/percona-repo-config/yum-repo.html sudo yum insta ...

  3. Linux后台开发工具箱

    https://files-cdn.cnblogs.com/files/aquester/Linux后台开发工具箱.pdf 目录 目录 1 1. 前言 3 2. 脚本类工具 3 2.1. sed命令- ...

  4. Linux后台开发工具箱-葵花宝典

    Linux后台开发工具箱-葵花宝典 一见 2016/11/4 目录 目录 1 1. 前言 4 2. 脚本类工具 4 2.1. 双引号和单引号 4 2.2. 取脚本完整文件路径 5 2.3. 环境变量和 ...

  5. 推荐几款MySQL相关工具

    前言: 随着互联网技术的不断发展, MySQL 相关生态也越来越完善,越来越多的工具涌现出来.一些公司或个人纷纷开源出一些不错的工具,本篇文章主要介绍几款 MySQL 相关实用工具.提醒下,这里并不介 ...

  6. [知识库分享系列] 二、.NET(ASP.NET)

    最近时间又有了新的想法,当我用新的眼光在整理一些很老的知识库时,发现很多东西都已经过时,或者是很基础很零碎的知识点.如果分享出去大家不看倒好,更担心的是会误人子弟,但为了保证此系列的完整,还是选择分享 ...

  7. SQL慢查询安装过程

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

  8. JSP版LCX:端口转发神器 KPortTran

    最近接触内网很多,渗透过程中,由于windows和linux的差别以及运行语言环境的限制导致端口转发经常出现问题.于是自己写了个简单的JSP的端口转发脚本.仿造LCX的功能,具有正向.反向.监听三种模 ...

  9. 快速安装Percona pt工具

    yum install perl-DBI perl-DBD-MySQL perl-Time-HiRes perl-Time-HiRes perl-IO-Socket-SSLwget http://pk ...

  10. 使用Percona Xtrabackup创建MySQL slave库

    一.使用Percona Xtrabackup创建MySQL slave库 MySQL Server 版本: Server version: 5.7.10-log MySQL Community Ser ...

随机推荐

  1. IOS 获取.plist文件的数据

      @property (nonatomic,strong) NSArray *apps; //获取.plist数据 /**获取plist文件的数组数据*/ -(NSArray *)apps{ if( ...

  2. 二维码生成的WEB api方法

    /// <summary> /// 获取二维码 /// </summary> /// <param name="size">编码测量度,值越大生 ...

  3. mysql用一个表更新另一个表

    写法: UPDATE Document, ObservationRequestSET Document.CreateOrganizationName = ObservationRequest.Orga ...

  4. 虚拟内存映射 段分割 vm_area_struct

    http://www.cnblogs.com/huxiao-tee/p/4660352.html linux内核使用vm_area_struct结构来表示一个独立的虚拟内存区域,由于每个不同质的虚拟内 ...

  5. 重写KVC

    #import "NSObject+WQKVC.h" #import <objc/runtime.h> /** KVC 首先调用的方法顺序: |- setter: se ...

  6. 在Centos上面用yum不能安装redis的朋友看过来

    我得是centos 6.3,如果直接用yum安装redis,报错,如下:[root@CentOS6 etc]# yum install redisLoaded plugins: fastestmirr ...

  7. Vuex进阶

    1.插件 下面以一个对state进行持久化存储的插件为例进行介绍: 代码结构: saveInLocal.js export default function (store) { if (localSt ...

  8. java获取文件后缀名(正则表达式)+文件名

    String fileName="asadas.jsp"; String reg = ".+(.JPEG|.jpeg|.JPG|.jpg|.png|.PNG)$" ...

  9. Mysql语句 AND 和 OR 的运用

    数据记录 查询方式1 -- 查询info=1或者info=2同时bookname=java的数据 AND bookname='java'; 查询方式2 -- 查询info=3同时bookname=ja ...

  10. Java OOP——第八章 File IO

    1.文件:文件可认为是相关记录或放在一起的数据的集合: 2.File类:名命空间:java.io File对象即可表示文件,也可表示目录, 在程序中,一个File对象可以代表一个文件或目录, 利用他可 ...