This topic describes how to delete a standby cluster.
Delete a standby cluster by using the REMOVE CLUSTER statement
To delete a cluster during routine maintenance, you need to verify the cluster role and check whether the cluster is in the primary/standby cluster configuration.
To delete a standby cluster from the primary/standby cluster configuration, you need to execute the REMOVE CLUSTER statement in the primary cluster to remove the target cluster.
The following syntax can be used:
obclient> ALTER SYSTEM REMOVE CLUSTER cluster_name CLUSTER_ID cluster_id [FORCE];
Note:
cluster_nameandcluster_idindicate the cluster name and ID of the cluster to be deleted.To delete a standby cluster, we recommend that you execute the statement in the primary cluster. If you want to execute the statement in a standby cluster, add the
FORCEkeyword to the statement, and make sure that the standby cluster is in the primary/standby cluster configuration and is not the cluster to be deleted.Standby clusters in
SYNCmode cannot be deleted in MAXIMUM PROTECTION or MAXIMUM AVAILABILITY mode.
The target cluster to be deleted does not necessarily play a standby role. For example, after a failover, both the new primary cluster and the original primary cluster play the primary role, and both clusters are in the primary/standby cluster configuration. For more information, see Failover.
You can retain one of the primary clusters as the target primary cluster and delete the other one. For example, you can retain the new primary cluster as the target primary cluster and delete the original primary cluster, or you can restore the services of the original primary cluster and delete the new primary cluster. When you delete one of the primary clusters, you must execute the REMOVE CLUSTER statement in the retained primary cluster to delete the other primary cluster from the primary/standby cluster configuration, thus clearing the related cluster configuration.
Delete a standby cluster in OCP
Notice
OceanBase Cloud Platform (OCP) V2.5.0 or an earlier version executes the
REMOVE CLUSTERstatement in the primary cluster only when the cluster to be deleted is a standby cluster. When one of the primary clusters needs to be deleted after a failover, OCP does not execute theREMOVE CLUSTERstatement in the retained primary cluster. As a result, the configurations of the deleted primary cluster are still retained. Therefore, when you delete a standby cluster on OCP V2.5.0 or an earlier version, you need to log on to the retained primary cluster and execute statements to manually delete unnecessary primary cluster configurations.
Log on to the OCP console. The Clusters page automatically appears.
In the Clusters area on the Cluster Overview page, select the target cluster and click its name.
In the upper-right corner of the Overview page, click the ... icon, and then select Delete Cluster.
In the Delete Cluster dialog box that appears, enter "delete" and click Delete.
