MySQL master-slave Replication latency Monitoring

Source: Internet
Author: User
Tags percona

1. Install Percona-toolkit separately on the master and slave

wget https://www.percona.com/downloads/percona-toolkit/2.2.18/RPM/percona-toolkit-2.2.18-1.noarch.rpm

Yum Localinstall percona-toolkit-2.2.18-1.noarch.rpm


2. Execute on the main library

Pt-heartbeat--user=root--password=*******-s/var/lib/mysql/mysql.sock-d test--master-server-id=1--update-- Daemonize


3. Executing from the Library

Pt-heartbeat--user=root--password=*******-s/var/lib/mysql/mysql.sock-d test--master-server-id=1--monitor-- Print-master-server-id--daemonize--log=/tmp/slave-dely.log


4, Zabbix monitoring

# cat/etc/zabbix/mon/slave_dely.sh

#!/bin/bash

a1= ' Tail-n1/tmp/slave-dely.log |sed ' s/s//g ' |sed ' s/,//g ' |awk ' {print $1,$3,$4,$5} '

Echo $a 1


# Cat Zabbix_agentd.d/mysql.conf

userparameter=slave_dely0,/bin/bash/etc/zabbix/mon/slave_dely.sh |awk ' {print $} '

userparameter=slave_dely1,/bin/bash/etc/zabbix/mon/slave_dely.sh |awk ' {print $} '

userparameter=slave_dely5,/bin/bash/etc/zabbix/mon/slave_dely.sh |awk ' {print $} '

userparameter=slave_dely15,/bin/bash/etc/zabbix/mon/slave_dely.sh |awk ' {print $4} '


This article is from the Linux learning blog, so be sure to keep this source http://wjlking.blog.51cto.com/4431189/1828053

MySQL master-slave Replication latency Monitoring

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.