配置pt-heartbeat监控主从复制延迟

主库创建监控用户:

mysql> grant select,process,super,replication slave on *.* to 'pt_checksum'@'%' identified by 'mysql';
Query OK, 0 rows affected, 1 warning (0.00 sec)

授权test库,pt-heartbeat会创建监控用表

mysql> grant all privileges on test.* to pt_checksum@'%';
Query OK, 0 rows affected (0.00 sec)

在后台启动心疼守护进程:

[mysql@server-254-163 ~]$ pt-heartbeat h='172.16.254.163',u='pt_checksum',p='mysql',P=3307 -D test --create-table --interval=1 --update --replace --daemonize
[mysql@server-254-163 ~]$ 
[mysql@server-254-163 ~]$ 
[mysql@server-254-163 ~]$ ps -ef|grep heartbeat
mysql     40548      1  0 18:24 ?        00:00:00 perl /usr/local/bin/pt-heartbeat h=172.16.254.163,u=pt_checksum,p=mysql,P=3307 -D test --create-table --interval=1 --update --replace --daemonize
mysql     40563  34992  0 18:25 pts/10   00:00:00 grep --color=auto heartbeat

在从库服务器监控延迟:

[mysql@server-254-163 ~]$ pt-heartbeat h='172.16.254.163',u='pt_checksum',p='mysql',P=3307 -D test  --table=heartbeat --monitor --master-server-id=1633307
*******************************************************************
 Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client
 is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER
 possibly with SSL_ca_file|SSL_ca_path for verification.
 If you really don't want to verify the certificate and keep the
 connection open to Man-In-The-Middle attacks please set
 SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application.
*******************************************************************
  at /usr/local/bin/pt-heartbeat line 4556.
*******************************************************************
 Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client
 is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER
 possibly with SSL_ca_file|SSL_ca_path for verification.
 If you really don't want to verify the certificate and keep the
 connection open to Man-In-The-Middle attacks please set
 SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application.
*******************************************************************
  at /usr/local/bin/pt-heartbeat line 4556.
# A software update is available:
0.00s [  0.00s,  0.00s,  0.00s ]
0.00s [  0.00s,  0.00s,  0.00s ]
0.00s [  0.00s,  0.00s,  0.00s ]
0.00s [  0.00s,  0.00s,  0.00s ]
0.00s [  0.00s,  0.00s,  0.00s ]
0.00s [  0.00s,  0.00s,  0.00s ]
0.00s [  0.00s,  0.00s,  0.00s ]
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值