The server_id '1' is already used by instance|MySQL8.0集群错误解决

ERROR: Cannot add instance ':3306' 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: The server_id '1' is already used by instance 'LAPTOP-QM0IF54I:3306'. (RuntimeError)。

Solution

为每个mysql节点配置server_id:

[root@localhost ~]# find / -name my.cnf
/etc/my.cnf
[root@localhost ~]# vim /etc/my.cnf

Every server/node must have a different server_id so just open my.cnf and change /add under [mysqld] the following variable。

server_id=xx

Save and restart Mysql after change:

[root@localhost ~]# systemctl restart mysqld