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

CSS uses BEM naming convention practice

When you see a class, what information do you wan...

Detailed explanation of JQuery selector

Table of contents Basic selectors: Level selector...

JavaScript event capture bubbling and capture details

Table of contents 1. Event Flow 1. Concept 2. DOM...

JavaScript canvas to load pictures

This article shares the specific code of JavaScri...

Stop using absolute equality operators everywhere in JS

Table of contents Overview 1. Test for null value...

MySQL data insertion optimization method concurrent_insert

When a thread executes a DELAYED statement for a ...

Vue3.0 implements the encapsulation of the drop-down menu

Vue3.0 has been out for a while, and it is necess...

Implementation and usage scenarios of JS anti-shake throttling function

Table of contents 1. What is Function Anti-shake?...

Keep-alive multi-level routing cache problem in Vue

Table of contents 1. Problem Description 2. Cause...

Pycharm2017 realizes the connection between python3.6 and mysql

This article shares with you how to connect pytho...

Vue uses element-ui to implement menu navigation

This article shares the specific code of Vue usin...

CSS3 Tab animation example background switching dynamic effect

CSS 3 animation example - dynamic effect of Tab b...

Use pure CSS to achieve switch effect

First is the idea We use the <input type="...

How to add indexes to MySQL

Here is a brief introduction to indexes: The purp...