MySQL 8.0 – ServerID Non-Unique Error in InnoDB Cluster

innodbMySQLmysql-8.0mysql-innodb-cluster

I Get the following error when adding the second instance to a MYSQL Innodb Cluster

ERROR: Cannot add instance 'XXX' to the cluster because it has the same server ID of a member of the cluster. Please change the server ID of the instance to add: all members must have a unique server ID.
Cluster.addInstance: Access denied for user 'XXX'@'XXX' (using password: YES) (RuntimeError)

However if I check the two serverid's I can confirm that they are different

Server 1

mysql> show variables like 'server_id';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| server_id     | 3     |
+---------------+-------+
1 row in set (0.00 sec)

Server 2

show variables like 'server_id';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| server_id     | 1     |
+---------------+-------+
1 row in set (0.00 sec)

Please advise?

Best Answer

Are you using different accounts to administer the cluster? i.e. did you use an account to create the cluster and are you using a different one to add the instance to it? Or is it the same account with a different password?

If that's the case, then that's the reason you're hitting this issue. The account used to administer the cluster must have the same credentials on all cluster members.

The recommendation is to create a clusterAdmin account, using dba.configureInstance(). More info in the docs.

The current error message is misleading and confusing. This will be improved soon and the documentation will also be improved to outline this requirement.

Cheers, Miguel

Related Question