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.

最新文章

  1. Android Stdio 调试Smali
  2. 打开gvim发现菜单栏是乱码
  3. 计算ffff:0~ffff:b数据的和,结果存在dx中
  4. Spring boot配置文件 application.properties
  5. 修改TFS2013服务账户或者密码
  6. 记录linux /bin被误删除的解决过程
  7. 超级链接a中javascript:void(0)弹出另外一个框问题
  8. 转:python webdriver API 之下拉框处理
  9. 【皇甫】☀亲爱的~help me
  10. Facebook内部分享:25个高效工作的小技巧
  11. poj 1704 Georgia and Bob(阶梯博弈)
  12. Android(java)学习笔记240:多媒体之图形颜色的变化
  13. Lambda表达式、依赖倒置
  14. java 内部类和闭包
  15. jquery validate 动态增加删除验证规则(转载)
  16. iOS TabelViewCell 删除 编辑 插入
  17. 编译snort经验
  18. 6、Qt Meta Object system 学习
  19. 如何判断一个请求为ajax请求?
  20. [LeetCode&Python] Problem 883. Projection Area of 3D Shapes

热门文章

  1. 分享个谷歌浏览器下的一款插件PostMan
  2. React的安装
  3. 问题 C: B C++时间类的运算符重载
  4. 剑指offer 33 把数组排成最小的数
  5. 17、SpringBoot------整合dubbo
  6. JavaScript中并非一切皆对象
  7. js、jquery中全局替换replace
  8. 爬虫学习(十三)——xpath基础学习
  9. HTML5--定义区块
  10. java实现 zip解压缩