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. 在WINDOWS下安装PEAR

    一.从官网下载go-pear.phar 文件,地址http://pear.php.net/go-pear.phar 将下载好的文件go-pear.phar 放到PHP安装目录下,dos 命令下进入PH ...

  2. framework7对日历的一些效果处理

    现在的要求是日历中要区分已打卡和未打卡的显示,并且当月只显示当月的日历状态,其他月份不显示状态,并且打卡的日期不能大于当日 实现代码(精确到天): HTML: <div class=" ...

  3. Spring boot 集成三种定时任务方式

    三种定时任务方式分别为 org.springframework.scheduling.annotation.Scheduled java.util.concurrent.ScheduledExecut ...

  4. numpy中生成随机矩阵并打印出矩阵的shape

    from numpy import * c=zeros((4,5)) print c.shape print numpy.random.random((2,3))

  5. java导入、导出

    一.介绍 当前B/S模式已成为应用开发的主流,而在企业办公系统中,常常有客户这样子要求:你要把我们的报表直接用Excel打开(电信系统.银行系统).或者是:我们已经习惯用Excel打印.这样在我们实际 ...

  6. CUDA内存拷贝

    原文链接1.cudaMemcpy()<--> cudaMalloc()  //线性内存拷贝 1 //线性内存拷贝 2 cudaMalloc((void**)&dev_A, data ...

  7. Objection, 一个轻量级的Objective-C依赖注入框架

    简介 项目主页:https://github.com/atomicobject/objection 实例下载: https://github.com/ios122/ios122 Objection 是 ...

  8. 【杂题总汇】UVa-1336 Fixing the Great Wall

    [UVA-1336]Fixing the Great Wall 一开始把题看错了……直接用的整数存储答案:之后用double存最后输出答案的时候取整就AC了

  9. BeanUtils工具的实现

    BeanUtils工具的实现 自定义一个将数据映射到类里的方法 方法一: package utils; import java.lang.reflect.Field; import java.lang ...

  10. Percona-Tookit工具包之pt-stalk

      Preface       We have a lot of methods to diagnose problems in our system such as strace,pstack,gs ...