I am in the process of setting up an InnoDB cluster using the following tutorial (https://www.sqlshack.com/deploy-mysql-innodb-clusters-for-high-availability/). So far everything has worked:
- MySQL Server Installation
- dba.configureLocalInstance()
- dba.createCluster() - on the main node
But now I am at the last step, which is to add an instance to the cluster. But this doesn't work because the second instance can't seem to access the primary node via port 33061.
Firewalls are not activated - a connection from Node2 to Node1 via port 33061 (via Telnet) also worked. All three servers are located in a private network.
I get the following error message when I issue the command "cluster.addInstance("");":
MySQL xx-database-01:33060+ ssl JS > cluster.addInstance("dbadmin@xx-database-02");
NOTE: The target instance 'xx-database-02:3306' has not been pre-provisioned (GTID set is empty). The Shell is unable to decide whether incremental state recovery can correctly provision it.
The safest and most convenient way to provision a new instance is through automatic clone provisioning, which will completely overwrite the state of 'xx-database-02:3306' with a physical snapshot from an existing cluster member. To use this method by default, set the 'recoveryMethod' option to 'clone'.
The incremental state recovery may be safely used if you are sure all updates ever executed in the cluster were done with GTIDs enabled, there are no purged transactions and the new instance contains the same GTID set as the cluster or a subset of it. To use this method by default, set the 'recoveryMethod' option to 'incremental'.
Please select a recovery method [C]lone/[I]ncremental recovery/[A]bort (default Clone):
Validating instance configuration at xx-database-02:3306...
This instance reports its own address as xx-database-02:3306
Instance configuration is suitable.
NOTE: Group Replication will communicate with other members using 'xx-database-02:33061'. Use the localAddress option to override.
A new instance will be added to the InnoDB cluster. Depending on the amount of
data on the cluster this might take from a few seconds to several hours.
Adding instance to the cluster...
ERROR: Unable to start Group Replication for instance 'xx-database-02:3306'.
The MySQL error_log contains the following messages:
2021-01-27 13:29:39.527418 [System] [MY-013587] Plugin group_replication reported: 'Plugin 'group_replication' is starting.'
2021-01-27 13:29:39.562511 [System] [MY-010597] 'CHANGE MASTER TO FOR CHANNEL 'group_replication_applier' executed'. Previous state master_host='<NULL>', master_port= 0, master_log_file='', master_log_pos= 4, master_bind=''. New state master_host='<NULL>', master_port= 0, master_log_file='', master_log_pos= 4, master_bind=''.
2021-01-27 13:29:39.870120 [Error] [MY-011735] Plugin group_replication reported: '[GCS] Error on opening a connection to xx-database-01:33061 on local port: 33061.'
2021-01-27 13:29:39.970214 [Error] [MY-011735] Plugin group_replication reported: '[GCS] Error on opening a connection to xx-database-01:33061 on local port: 33061.'
Cluster.addInstance: Group Replication failed to start: MySQL Error 3092 (HY000): xx-database-02:3306: The server is not configured properly to be an active member of the group. Please see more details on error log. (RuntimeError)
cluster.status() returns following:
MySQL xx-database-01:33060+ ssl JS > cluster.status();
{
"clusterName": "xx_cluster",
"defaultReplicaSet": {
"name": "default",
"primary": "xx-database-01:3306",
"ssl": "REQUIRED",
"status": "OK_NO_TOLERANCE",
"statusText": "Cluster is NOT tolerant to any failures.",
"topology": {
"xx-database-01:3306": {
"address": "xx-database-01:3306",
"mode": "R/W",
"readReplicas": {},
"replicationLag": null,
"role": "HA",
"status": "ONLINE",
"version": "8.0.22"
}
},
"topologyMode": "Single-Primary"
},
"groupInformationSourceMember": "xx-database-01:3306"
}
MySQL xx-database-01:33060+ ssl JS >
All nodes (3) are running an Ubuntu 20 with MySQL 8. The configuration property "bind-address" is set to "0.0.0.0" on all nodes. It is also possible to establish a mysql connection from node1 to node2 and vice versa.
I have already spent hours trying to find the cause of the error, but unfortunately have not found it.
Thanks in advance!
This is the same issue reported and answered in https://dba.stackexchange.com/questions/282162/mysql-innodb-cluster-add-instance-issue-with-local-port
You must configure the allowlist.