Get the App
SLTechnology News&Howtos  ›  Database  › 

Trove mysql replica usage

Shulou Source: shulou.com Published: 2022-06-01 14:44:40 09月30日 Update

1. Some restrictions on trove mysql replica

Trove can support both binlog replica and gtid replica

Gtid requires mysql5.6 and above

Newton trove's binlog replica support for mysql is not very good.

The gtid replica of newton trove to mysql works normally.

Newton trove can create mysql5.5 binlog replica

Detach-replica:Mysql 5.5binlog mode works fine

Eject-replica-source: binlog replication mode mysql5.5 error message, binlog mode error message: Could not locate column in row for column 'Master_UUID'

An error is reported in promote-to-replica-source:Mysql5.5 binlog mode, and gtid is used in the operation.

2. Commands related to replica

Trove create # create replication trove detach-replica # remove slavetrove promote-to-replica-source # master,slave from replication, upgrade the specified slave to master, and reduce the original master to slavetrove eject-replica-source # when master loses heartbeat, you can remove master,trove in slave and select a suitable node as master

3. Create replication

Trove create ab 6-size 5-databases myDB\-users userA:password-datastore_version mysql-5.6\-datastore mysqltrove create ab-slave1 6-size 5-replica_of ab--replica_count 2\-datastore_version mysql-5.6-datastore mysql

4. Separate slave

Trove show ab-slave2-2 trove show ab-slave2 + | Property | Value | +-+- -- + | created | 2017-03-31T03:29:20 | | datastore | mysql | | datastore_version | mysql-5.6 | | flavor | 6 | | id | caa908f1-5e14-4c65-ac0e-a9ba26536107 | | ip | 172.168.10.6 | | name | ab-slave2-2 | | replica_of | 3d39a475-3277-4d24-9467-ebc254e9316f | | status | ACTIVE | Updated | 2017-03-31T06:19:30 | | volume | 5 | volume_used | 0.14 | +-- -+ trove detach-replica ab-slave2-2trove show ab-slave2-2 "Property" Value + | Value | +- -+ | created | 2017-03-31T03:29:20 | | datastore | mysql | | datastore_version | mysql-5.6 | | flavor | 6 | | id | caa908f1-5e14-4c65-ac0e-a9ba26536107 | | ip | 172.168.10.6 | | name | ab-slave2-2 | | status | ACTIVE | | | updated | 0-03-31T06:28:45 | | volume | 5 | | volume_used | 2017 | +-- | -- +

5. Upgrade slave to master

Trove show ab-slave3-1 trove show ab-slave3 + | Property | Value | +-+- -- + | created | 2017-03-31T03:36:16 | | datastore | mysql | | datastore_version | mysql-5.6 | | flavor | 6 | | id | f303fc8f-819b-47b5-b33a-38184c8aff90 | | ip | 172.168.10.14 | | name | ab-slave3-1 | | replica_of | 3d39a475-3277-4d24-9467-ebc254e9316f | | status | ACTIVE | | updated | | | 2017-03-31T06:19:30 | | volume | 5 | | volume_used | 0.14 | +-| -+ trove promote-to-replica-source ab-slave3-ab-slave3-1 has been upgraded to mastertrove show ab-slave3-1 Murray- -+ | Property | Value | + -- + | created | 2017-03-31T03:36:16 | | datastore | mysql | | datastore_version | mysql-5.6 | | flavor | 6 | | id | f303fc8f-819b-47b5-b33a-38184c8aff90 | | | ip | 172.168.10.14 | | name | ab-slave3-1 | | replicas | 3d39a475-3277-4d24-9467-ebc254e9316f | F4b3be64-c204-439d-a9c4-e28cb543a3b9 | | status | ACTIVE | | updated | 2017-03-31T06:33:39 | | volume | 5 | | volume_used | 0.14 | +-| -+ # master has been downgraded to slavetrove show 3d39a475-3277-4d24-9467 Mustang ebc254e9316f + | Property | Value | +-+-+ | created | 2017-03-31T06:14:35 | | datastore | mysql | | datastore_version | mysql-5.6 | | flavor | 6 | | id | 3d39a475-3277-4d24-9467-ebc254e9316f | | ip | 172.168.10.8 | | name | ab | | | replica_of | f303fc8f-819b-47b5-b33a-38184c8aff90 | | status | ACTIVE | | updated | 2017-03-31T06:33:39 | | volume | 5 | volume_used | 0.14 | | | +-+-+ |

6. Remove master

Removing master needs to be done when master has lost its heartbeat. If master still has a heartbeat, master cannot be removed.

You can lose your heartbeat by stopping trove-guestagent on master to simulate master.

Service trove-guestagent stoptrove eject-replica-source

Tags: Mode situation work support fit information can be passed at the same time commands versions nodes selections restrictions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Technology Shulou Information Xiaomi Shulou Tech Info