This topic describes how to set cluster-level parameters for 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 node corresponding to the client instance that you use belongs to the uninitialized cluster.
Sample code
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, PasswordAuth("****"))
# Configure the cluster name, the cluster ID, and the password of the root@sys user.
dag = client.v1.config_obcluster_sync("test-sdk", 11, "****")
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, PasswordAuth("****"))
# Configure the cluster name, the cluster ID, and the password of the root@sys user.
dag = client.v1.config_obcluster("test-sdk", 11, "****")
# Wait for the task to complete.
client.v1.wait_dag_succeed(dag.generic_id)
References
For more information about the API operation, see SetClusterConfig.
For more information about how to call the API operation by using obshell-sdk-go, see Set cluster-level configurations.