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