You can delete an OBServer node from a cluster.
Delete an OBServer node by using an SQL statement
DELETE SERVER
You can perform the DELETE SERVER operation to delete an OBServer node, from a cluster.
Sample statement:
ALTER SYSTEM DELETE SERVER 'ip:port' [,'ip:port'...] [ZONE [=] 'zone']
This statement can be executed only in the sys tenant.
Load balancing is involved when the DELETE SERVER operation is performed. Resource units on the deleted OBServer node are migrated to another OBServer node in the same zone. Resource unit migration implements automatic balancing of resource units, which is controlled by the RootService. After the resource units are migrated, the DELETE SERVER operation succeeds.
However, during the balancing process, resources of other OBServer nodes in the same zone may be insufficient to accommodate the migrated resource units. As a result, the resource unit migration fails, and the OBServer node remains in the deleting state. You can check whether the resource unit migration fails in /home/admin/oceanbase/log/rootservice.log. The error code for migration failure is -4624. If the migration fails, you must perform the CANCEL DELETE SERVER operation, add an OBServer node to the zone to scale out the cluster, and then delete the target OBServer node. For more information about how to add an OBServer node to a zone to scale out a cluster, see Add an OBServer node.
Here is an example:
Log on to the
systenant as therootuser.Execute the following statement to delete the OBServer node.
For example,
obclient> ALTER SYSTEM DELETE SERVER "192.168.100.1:2882" zone='z1'Check the
__all_servertable. If the OBServer node is not found in the table, it has been deleted.obclient> SELECT * FROM oceanbase.__all_server;
CANCEL DELETE SERVER
You can perform the CANCEL DELETE SERVER operation to cancel the DELETE SERVER operation.
Sample statement:
obclient> ALTER SYSTEM CANCEL DELETE SERVER 'ip:port' [,'ip:port'...] [ZONE [=] 'zone']
This statement can be executed only in the sys tenant.
Here is an example:
Log on to the
systenant as therootuser.Execute the following statement to cancel the deletion of the OBServer node.
For example,
obclient> ALTER SYSTEM CANCEL DELETE SERVER '10.10.10.1:2882' zone='zone1';
Delete an OBServer node in the OCP console
You can delete an OBServer node in the OceanBase Cloud Platform (OCP) console. After the OBServer node is deleted, it is removed from the current cluster.
Prerequisites
The target cluster can be managed in the current OCP cluster.
If the cluster has not been added to OCP, request the administrator to add the cluster. For more information, see "Take over a cluster" in the OCP User Guide of the corresponding version.
You have the permissions to manage the cluster.
If you not have the permissions to manage the cluster, request the administrator to assign the required role. For more information, see "Edit a user" in the OCP User Guide of the corresponding version.
Considerations
When you delete an OBServer node, resource units on the OBServer node are automatically migrated to another OBServer node in the same zone. If resources available for other OBServer nodes in the same zone are insufficient, you must add an OBServer node with sufficient resources to support the unit migration. Otherwise, the OBServer node deletion will fail.
Procedure
Log on to the OCP console.
The Clusters page automatically appears.
In the Clusters list, find the target cluster and click its name to go to the Overview page of the cluster.
In the OBServers list, find the row that contains the target OBServer node, and click Delete in the Actions column.

In the dialog box that appears, click Delete.
In the dialog box, you can click View Task to view the progress of the deletion task.
You can also choose System Management > Tasks to view the progress of the task.
When the task status is Completed, and the OBServers list on the Overview page of the cluster does not contain the OBServer node, the OBServer node is deleted.