Implementation of MySQL master-slave status check

Implementation of MySQL master-slave status check

1. Check the synchronization status of A and B databases

Enter the following command and a lot of information will appear, but the main thing is to make sure that both the Slave_IO_Running and Slave_SQL_Running fields show yes.

MySQL> show slave status\G; 

insert image description here

2. Check the synchronization thread status of servers A and B

Enter the following command,

MySQL > show processlist\G

If the command window has the three threads shown in the figure below, the configuration is successful. If any thread is missing, restart the MySql service on the primary and backup machines, and then enter the above command in the MySql command window to check whether there are the three threads marked in the figure below. If these three threads are not present, please recheck whether the configuration is correct.

注意:主備服務器的MySql進程必須都有這三個線程才證明配置成功!

mysql> show processlist\G;
*************************** 1. row ***************************
*** Omitted ***
*************************** 2. row ***************************
   Id: 22
  User: system user
  Host: connecting host
   db: NULL
Command: Connect
  Time: 938775
 State: Waiting for master to send event
  Info: NULL
*************************** 3. row ***************************
   Id: 23
  User: system user
  Host: 
   db: NULL
Command: Query
  Time: 748608
 State: Slave has read all relay logs; waiting for more updates
  Info: NULL
*************************** 4. row ***************************
   Id: 3691
  User: slave
  Host: 1.2.3.3:54244
   db: NULL
Command: Binlog Dump
  Time: 70515
 State: Master has sent all binlog to slave; waiting for more updates
  Info: NULL

This is the end of this article about the implementation of MySQL master-slave status check. For more relevant MySQL master-slave status check content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Shell script to monitor MySQL master-slave status
  • Detailed explanation of how Zabbix monitors the master-slave status of MySQL
  • Shell script monitors mysql master-slave status

<<:  Web page creation for beginners: Learn to use HTML's hyperlink A tag

>>:  CSS achieves footer "bottom absorption" effect

Recommend

Sample code for implementing horizontal infinite scrolling with pure CSS3

The examples in this article are all written in s...

Notes on using the blockquote tag

<br />Semanticization cannot be explained in...

Methods for defragmenting and reclaiming space in MySQL tables

Table of contents Causes of MySQL Table Fragmenta...

Example of deploying Laravel application with Docker

The PHP base image used in this article is: php:7...

How to use the EXPLAIN command in SQL

In daily work, we sometimes run slow queries to r...

Linux bash: ./xxx: Unable to execute binary file error

Today I sent a small tool for Ubuntu to a custome...

Introduction to TypeScript basic types

Table of contents 1. Basic types 2. Object Type 2...

Summary of vue's webpack -v error solution

Xiaobai learned about Vue, then learned about web...

Install Docker on CentOS 7

If you don't have a Linux system, please refe...

Detailed tutorial on installing MySQL offline on CentOS7

1. Delete the original mariadb, otherwise mysql c...

How to upload the jar package to nexus via the web page

When using Maven to manage projects, how to uploa...

js to realize payment countdown and return to the home page

Payment countdown to return to the home page case...

Dynamic starry sky background implemented with CSS3

Result:Implementation Code html <link href=...