This topic describes how to remove an OBServer node from an uninitialized OceanBase cluster by using obshell-sdk-python.
Note
We recommend that you read Quick start for a better understanding of how to use obshell-sdk-python.
Considerations
Make sure that OceanBase Shell (obshell) runs normally.
Make sure that the OBServer node to be removed belongs to the uninitialized cluster.
Sample code
The following code removes the OBServer node with the IP address of 10.10.10.2 and the port number of 2886 from the cluster.
from obshell import ClientSet
# Create a client instance, with the IP address of "10.10.10.1" and the port number of 2886.
client = ClientSet("10.10.10.1", 2886)
# Remove the OBServer node with the IP address of `10.10.10.2` and the port number of 2886 from the cluster where the node with the IP address of '10.10.10.1' resides.
client.v1.remove_sync("10.10.10.2", 2886)
from obshell import ClientSet
# Create a client instance, with the IP address of "10.10.10.1" and the port number of 2886.
client = ClientSet("10.10.10.1", 2886)
# Remove the OBServer node with the IP address of `10.10.10.2` and the port number of 2886 from the cluster where the node with the IP address of '10.10.10.1' resides.
client.v1.remove("10.10.10.2", 2886)
# Wait for the task to complete.
client.v1.wait_dag_succeed(dag.generic_id)
References
For more information about the API operation, see DeleteNodeBeforeClusterInitialization.
For more information about how to call the API operation by using obshell-sdk-go, see Remove a node before cluster initialization.