• notice
  • Congratulations on the launch of the Sought Tech site

PERCONA-Toolkit to Mysql's replication and monitoring operation tutorial

Copy Tools
1.  pt-heartbeat
Feature introduction:
Monitor mysql replication latency
Usage introduction:
pt-heartbeat [OPTION...] [DSN]--update|--monitor|--check|--stop
Measure how long the replication is behind the master mysql or master PostgreSQL.You can use this script to update the master or monitor the replication.See the following example for usage.
Principle: pt-heartbeat confirms the replication delay of mysql and postgresql through the real replication data.This avoids the dependence on the replication mechanism, so that the accurate lagging replication time can be obtained.It consists of two parts: the first part is on the main pt-heartbeat The--update thread will update a timestamp at the specified time interval.The second part is the--monitor thread or--check thread of pt-heartbeat to connect to the heartbeat record (the previously updated timestamp) from the check copy, and Compare with the current system time to get the time difference.
You can manually create a heartbeat table or add the--create-table parameter.It is recommended to use the MEMORY engine.The table structure is:

CREATE TABLE heartbeat (
 ts varchar(26) NOT NULL,
 server_id int unsigned NOT NULL PRIMARY KEY,
 file varchar(255) DEFAULT NULL,-SHOW MASTER STATUS
 position bigint unsigned DEFAULT NULL,-SHOW MASTER STATUS
 relay_master_log_file varchar(255) DEFAULT NULL,-SHOW SLAVE STATUS
 exec_master_log_pos bigint unsigned DEFAULT NULL-SHOW SLAVE STATUS
);

 
Example of use:
Example 1: Create a background process to periodically update the heartbeat table of the main test library () The default is 1s, which can be specified by--interval.After execution, it will become a heartbeat table.The test library is the synchronization library I monitor:

pt-heartbeat-D test--update--user=root--password=zhang@123-h192.168.3.135--create-table

Tags

Technical otaku

Sought technology together

Related Topic

1 Comments

author

order atorvastatin 10mg online cheap & lt;a href="https://lipiws.top/"& gt;cheap lipitor 80mg& lt;/a& gt; order lipitor 40mg for sale

Epachc

2024-03-07

Leave a Reply

+