Сервер MySQL 5.7 - Невозможно добавить новый экземпляр кластера с помощью оболочки mysql 'cluster.addInstance()'
Здравствуйте, я пытаюсь настроить кластерную архитектуру mysql InnoDB, пока я установил mysql server 5.7 на 3 разных серверах и настроил кластеризацию mysql, используя следующие команды:
dba.checkInstanceConfiguration();
dba.configureLocalInstance();
var cluster = dba.createCluster("myCluster");
cluster.addInstance("admin@db2:3306") // My username is admin, and the instance hostname is db2.
Проблема в том, что при выполнении последней команды оболочка mysql показывает эту ошибку:
WARNING: A GTID set check of the MySQL instance at 'db2:3306' determined that it contains transactions that do not originate from the cluster, which must be discarded before it can join the cluster.
db2:3306 has the following errant GTIDs that do not exist in the cluster:
26224bda-bc5b-11ea-9a6e-000c29646186:1-27,
799fe52b-bd3b-11ea-a5ee-005056241c59:1-31,
f1e4837b-b6ce-11ea-b1c5-000c29646186:1
WARNING: Discarding these extra GTID events can either be done manually or by completely overwriting the state of db2:3306 with a physical snapshot from an existing cluster member. To use this method by default, set the 'recoveryMethod' option to 'clone'.
Having extra GTID events is not expected, and it is recommended to investigate this further and ensure that the data can be removed prior to choosing the clone recovery method.
ERROR: The target instance must be either cloned or fully provisioned before it can be added to the target cluster.
Built-in clone support is available starting with MySQL 8.0.17 and is the recommended method for provisioning instances.
Cluster.addInstance: Instance provisioning required (MYSQLSH 51153)
Я попытался сбросить всю базу данных с помощью команды mysqldump -uroot -proot --all-databases --triggers --routines --events --master-data > /dump.sql
и импортировал его в целевой экземпляр, но проблема не исчезла.
- Я не могу перейти на mysql 8 и использовать упомянутый инструмент клонирования, потому что наши приложения совместимы только с mysql 5.7.
Как я могу решить эту проблему с помощью mysql 5.7, пожалуйста?
1 ответ
Решение
Хорошо, я решил это, очистив таблицу: mysql.gtid_executed, затем перезапустил сервер и теперь он правильно связан.