Symptom
In multi-cluster mode, a follower OCP cluster failed to be registered. An error message is displayed, indicating that the follower OCP cluster manages an OceanBase cluster with the same name as an OceanBase cluster managed by the leader OCP cluster, or that the follower OCP cluster manages an OceanBase cluster with the same ID as an OceanBase cluster managed by the leader OCP cluster.
Possible causes
Check for the following possible causes:
The follower OCP cluster manages an OceanBase cluster with the same name as an OceanBase cluster managed by the leader OCP cluster.
The follower OCP cluster manages an OceanBase cluster with the same ID as an OceanBase cluster managed by the leader OCP cluster.
The communication is disconnected between the IDC in which the leader OCP cluster resides and the IDC in which the follower OCP cluster resides.
Solutions
The follower OCP cluster manages an OceanBase cluster with the same name as an OceanBase cluster managed by the leader OCP cluster
Re-create any of the managed clusters and ensure the name and ID of the newly created cluster are unique.
The follower OCP cluster manages an OceanBase cluster with the same ID as an OceanBase cluster managed by the leader OCP cluster
When the ocp_cluster_id parameter in the mc_ocp_cluster_config file is set to the same value for the leader and follower OCP clusters, a cluster ID conflict occurs. Set the ocp_cluster_id parameter in the mc_ocp_cluster_config file of any cluster involved in the conflict to another integer value, and restart all OCP instances. Note
The OCP cluster ID is independent of the OceanBase cluster ID. In OCP earlier than V3.1.3, the cluster ID value must be smaller than 127. In OCP V3.1.3 and later, the cluster ID can be an integer ranging from 1 to 9223372036854775807.
Communication disconnected between the IDC in which the leader OCP cluster resides and the IDC in which the follower OCP cluster resides
When the follower OCP cluster is registered, records in mc_ocp_cluster and mc_ob_cluster of the leader cluster are synchronized to the local machine. mc_ocp_cluster contains the MetaDB connection information of OCP, which is used for follow-up connection and communication with MetaDB. When the communication is disconnected between the IDC in which the leader OCP cluster resides and the IDC in which the follower cluster resides, the MetaDB connection information synchronized from the leader cluster is invalid in the follower cluster. In this case, you need to modify the hosts file on the OCP host to ensure that the leader and follower OCP clusters can access the MetaDB address used by each other at startup.
To obtain the MetaDB address used for OCP startup, perform the following steps:
Run
docker restart ocpon the OCP host to go to the OCP container.In the OCP container, run
env grep METAto view the environment variables related to MetaDB during OCP startup.