This topic describes how to deploy and initialize an OceanBase cluster by using CreateClusterWithRequest of 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 does not belong to any 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)
client.v1.agg_create_cluster(
{
'10.10.10.1:2886': {
"zone": "zone1", "datafile_size": "24G", "cpu_count": "16",
"memory_limit": "16G", "system_memory": "4G", "log_disk_size": "24G",
"enable_syslog_recycle": "true", "enable_syslog_wf": "true"
},
'10.10.10.2:2886': {
"zone": "zone2", "datafile_size": "24G", "cpu_count": "16",
"memory_limit": "16G", "system_memory": "4G", "log_disk_size": "24G",
"enable_syslog_recycle": "true", "enable_syslog_wf": "true"
},
},
"test-sdk", 123456, "1111"
)