Get the App
SLTechnology News&Howtos  ›  Database  › 

Configure the self-built MySQL on ECS as a pit stepped on by RDS from the library

Shulou Source: shulou.com Published: 2022-06-01 15:08:34 09月24日 Update

Environment:

RDS version: Ali Yun's 5.6

ECS self-built MySQL5.6.34 (official version)

By downloading the automatic full backup of Aliyun rds to ECS, follow the official steps to decompress-- > aploy-log-> mv to mysql's datadir and start mysql.

And then execute

Reset slave all

Reset master

Change master to master_host='rm-xxxxxxxxx.mysql.rds.aliyuncs.com'

Master_user='rpl'

Master_password='123456'

MASTER_PORT=3306

MASTER_AUTO_POSITION=1

This is the wrong report. Error log prompt:

2017-06-05 16:35:19 16759 [ERROR] Error reading relay log configuration.

2017-06-05 16:37:00 16759 [ERROR] Error reading master configuration.

Reason:

Aliyun's RDS is a modified version, which is different from the official table structure. (so far, there are slave_master_info, slave_relay_log_info and slave_worker_info under the mysql library, but other tables have not been carefully followed.)

In the three tables recovered by RDS, there is an extra Channel_name field than the official version. Caused our change master to fail.

The following figure shows the table structure I looked at on the compiled alisql:

Solution:

Use mysql

Drop table slave_master_info

Drop table slave_relay_log_info

Drop table slave_worker_info

Then recreate the three tables with reference to other MySQL5.6 machines.

When you are finished, follow the steps of building a slave database for GTID replication:

Change master to master_host='rm-xxxxxxxxxxx.mysql.rds.aliyuncs.com'

Master_user='rpl'

Master_password='rpl'

MASTER_PORT=3306

MASTER_AUTO_POSITION=1

SET GLOBAL gtid_purged='b9f0343a-3ac4-11e7-9769-008cfaf59624:1-6751, d50b0441-3ac4-11e7-976a-7cd30ac47780:1-106693'

Start salve

This allows you to automatically start synchronizing data.

(you don't need these steps if you compile and install alisql, because both ALiSQL and RDS open source by Aliyun have Channel_name fields.)

Tags: Official version Ali step field structure compilation following figure reason backup general data method log machine environment part error faceted synchronization Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi OPPO Reno Apple Linux NVidia