MYSQL database GTID realizes master-slave replication (super convenient)

MYSQL database GTID realizes master-slave replication (super convenient)

1. Add Maria source

vi /etc/yum.repos.d/MariaDB.repo

Paste the latest mariadb image from Alibaba Cloud:

[mariadb]
name = MariaDB
baseurl = https://mirrors.aliyun.com/mariadb/yum/10.5/centos7-amd64/
gpgkey=https://mirrors.aliyun.com/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1

Install the new version of MariaDB

yum install mariadb mariadb-server

Enable binlog

vim /etc/my.cnf.d/server.cnf

Add the following under mysqld server_id = 1
log_bin = mysql-bin

systemctl restart mariadb

insert image description here

2. Master-Slave Replication

1. Authorize on the master

grant replication slave on *.* to 'slave'@'192.168.59.%' identified by '123';

insert image description here

2. Add a host and perform synchronization master operation

Stop slave, stop synchronization, and start modifying information stop slave;
Write the master information CHANGE MASTER TO
  -> MASTER_HOST='192.168.59.143',
  -> MASTER_USER='slave',
  -> MASTER_PASSWORD = '123',
  -> MASTER_PORT=3306,
  ->MASTER_USE_GTID = current_pos;

 Start slave and start synchronization start slave;

insert image description here

Verify whether

show slave status \G;

insert image description here

At this point, GTID master-slave replication is completed! !

This is the end of this article about MYSQL database GTID master-slave replication implementation (super convenient). For more relevant MYSQL GTID master-slave replication 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:
  • Detailed introduction to GTID mode of MySQL master-slave replication
  • Solution to the problem that synchronous replication errors cannot be skipped in MySQL5.6 GTID mode
  • An example of changing traditional replication to GTID replication without stopping business in MySQL 5.7
  • Detailed explanation of MySQL master-slave replication practice - GTID-based replication
  • MySQL 5.6 master-slave replication based on GTID
  • Tutorial on using GTIDs replication protocol and outage protocol in MySQL
  • Specific use of GTID replication in MySQL replication

<<:  A complete list of meta tag settings for mobile devices

>>:  Detailed explanation of the watch listener example in vue3.0

Recommend

Three examples of blur background effects using CSS3

Let’s not start with the introduction and get str...

HTML Tutorial: Definition List

<br />Original text: http://andymao.com/andy...

Explain TypeScript mapped types and better literal type inference

Table of contents Overview Using mapped types to ...

Docker's health detection mechanism

For containers, the simplest health check is the ...

Detailed explanation of nginx upstream configuration and function

Configuration Example upstream backend { server b...

Let's talk about the characteristics and isolation levels of MySQL transactions

The Internet is already saturated with articles o...

Linux Dig command usage

Dig Introduction: Dig is a tool that queries DNS ...

Linux checkup, understand your Linux status (network IO, disk, CPU, memory)

Table of contents 1. Core commands 2. Common comm...

How to use type enhancement without typingscript

Preface Due to the weak typing of JS, loose writi...

How to restore single table data using MySQL full database backup data

Preface When backing up the database, a full data...

How to View All Running Processes in Linux

You can use the ps command. It can display releva...

JavaScript to implement the countdown for sending SMS

This article shares the specific code of JavaScri...