Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use pt-heartbeat to monitor mysql master-slave synchronization delay method

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

The following is mainly about how to use pt-heartbeat to monitor mysql master-slave synchronization delay. I hope these contents can bring you practical use, which is also the main purpose of this article on how to monitor mysql master-slave synchronization delay using pt-heartbeat. All right, don't talk too much nonsense, let's just read the following.

Pt-heartbeat monitors the master-slave synchronization delay of mysql:

Install percona toolkit (pt-heartbeat is a subcommand of the software):

Http://repo.percona.com/release/6/RPMS/x86_64/percona-toolkit-3.0.13-1.el6.x86_64.rpm

Yum install perl-DBD-MySQL

Yum install perl-IO-Socket-SSL

Yum install perl-TermReadKey

Create the heartbeat table on the main library:

Mysql-u root-pendant xxxxxxx'

Create table heartbeat (ts varchar (26) not NULL, server_id int unsigned NOT NULL PRIMARY KEY, file varchar (255) DEFAULT NULL, position bigint unsigned DEFAULT NULL, relay_master_log_file varchar (255DEFAULT NULL, exec_master_log_pos bigint unsigned DEFAULT NULL)

Exit

Use ming

Update the heartbeat table of the primary mysql every 1 second (here the root is the root of mysql):

Pt-heartbeat-user=root-ask-pass-host=localhost-create-table D ming-interval=1-update-replace-daemonize

Run and monitor synchronization latency on the master mysql (need to be authorized on the slave mysql first):

Pt-heartbeat-D ming-table=heartbeat-monitor-host=10.0.1.3-user=ming-password=xxxxx-master-server-id=1

Record the delay result in a file:

Pt-heartbeat-D ming-table=heartbeat-monitor-host=10.0.1.3-user=ming-password=xxxxx-master-server-id=1-log=/log/slave.txt-daemonize

For the above about how to use pt-heartbeat to monitor the mysql master-slave synchronization delay method, you do not find it very helpful. If you need to know more, please continue to follow our industry information. I'm sure you'll like it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report