Description
You can call this operation to create an OceanBase cluster.
Call description
Prerequisites
You have the permission to create an OceanBase cluster.
For more information about the permissions, see Overview.
You have passed the authentication for the OceanBase Cloud Platform (OCP) application service.
Request path
POST /api/v2/ob/clusters
Request parameters
Body parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| name | String | Yes | foo | The name of the cluster. |
| vpcName | String | No | - | This parameter is deprecated and will be removed from later versions. |
| vpcId | Long | No | 1L | The ID of the virtual private cloud (VPC) where the cluster resides. If the cluster is in a classic network, set the value to 1. This parameter does not apply to a standby cluster. |
| obClusterId | Integer | No | 1L | The ID of the cluster in OceanBase Database. |
| fullVersion | String | No | 4.3.3.0-200000142024073011 | The full version number of the target version. |
| rpmName | String | Yes | oceanbase-2.2.76-20210219154519.el7.x86_64.rpm | The name of the RPM package. |
| type | String | Yes | PRIMARY | The type of the cluster. Valid values: |
| password | String | Yes | bar | The password of the root account for the sys tenant in the cluster. |
| primaryZone | String | No | Zone1 | The primary zone. |
| zones | Object | Yes | - | The information about zones. |
| ├─name | String | Yes | zone1 | The name of the zone. |
| ├─idcName | String | Yes | idc1 | The name of the IDC. |
| ├─servers | Array | Yes | [1,2] | The list of host IDs. |
| ├─architecture | String | No | x86_64 | The system architecture supported by the software package. |
| ├─rpmName | String | No | oceanbase-3.2.0-20210813141857.el7.x86_64.rpm | The name of the RPM package. |
| ├─rootServer | Long | No | - | The RootServer of the zone. |
| startupParameters | Array | No | - | The startup parameters. |
| ├─name | String | No | - | The name of the parameter. |
| ├─value | String | No | - | The value of the parameter. |
| obproxyClusterIds | Array | No | [1,2] | The IDs of the associated OBProxy clusters. |
| obproxyClusterKeyList | Array | No | - | The list of OBProxy clusters. This parameter takes effect only if you have deployed OCP in multi-cluster mode. |
| ├─ocpClusterId | Long | No | 1L | The ID of the OCP cluster that manages the OBProxy cluster. |
| ├─obproxyClusterId | Long | No | 1L | The ID of the OBProxy cluster. |
| obproxyUserName | String | No | proxyro | The username of the OBProxy user. |
| obproxyUserPassword | String | No | ****** | The password of the proxyro user. If you do not specify this parameter, OCP will generate a random password. This parameter is applicable only for OceanBase Cloud. |
| attributes | Object | No | - | The attributes of the cluster. |
| ├─installPath | String | No | /home/admin/oceanbase |
The installation path of the cluster. |
| ├─runPath | String | No | /home/admin/oceanbase |
The run path. |
| ├─dataDiskPath | String | No | /data/1 |
The data disk path. |
| ├─logDiskPath | String | No | /data/log1 |
The log disk path. |
| ├─diskPathStyle | Enum | No | DEFAULT | |
| ├─operatingSystemUser | String | No | admin | The username of the OS user of the host. |
| ├─svrPort | Integer | No | 2882 | The RPC port number. |
| primaryClusterInfo | Object | No | - | The information about the primary cluster. |
| ├─rootSysPassword | String | No | ****** | The password for the root@sys user. |
| ├─obClusterId | Long | No | 1L | The ID of the cluster in OceanBase Database. |
| ├─vpcName | String | No | - | The name of the VPC to which the OceanBase cluster belongs. |
| ├─vpcId | Long | No | 1L | The ID of the VPC to which the OceanBase cluster belongs. |
| arbitrationServiceId | Long | No | 1L | The ID of the arbitration service. |
| oversellingFactor | Integer | No | 100 | The resource overprovisioning factor. Valid values: [100, 200], indicating that the factor ranges from 100% to 200%. Default value: 100, indicating that resources are not overprovisioned. |
| cgroupEnabled | Boolean | No | true | Specifies whether to enable the cgroup feature for the cluster. If you set the value to false, tenant resources will not be isolated. This parameter takes effect in only OceanBase Database V4.0 and later. |
| createExtraTenant | Boolean | No | false | Specifies whether to create a new tenant, if the cluster is in standalone centralized mode. |
| supportObsBackup | Boolean | No | false | Specifies whether to support backup and restore based on Huawei Cloud Object Storage Service (OBS). |
| simplifiedCreateTenantParam | Object | No | - | The simplified parameters for creating a tenant, if the cluster is in standalone centralized mode. |
| ├─name | String | No | - | The name of the tenant. |
| ├─mode | Enum | No | MYSQL | The mode of the tenant. Valid values: |
| loadType | Enum | No | EXPRESS_OLTP | The type of the load. Valid values: |
Response parameters
Basic data structure
| Parameter | Type | Description |
|---|---|---|
| data | Object | The information about the asynchronous task. For more information, see Task return structure. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The amount of time taken by the server to process the request, in milliseconds. |
| status | Integer | The HTTP status code. |
| traceId | String | The trace ID of the request. This trace ID is used for troubleshooting. |
| server | String | The address of the application server that responded to the request. |
Examples
Sample request
POST /api/v2/ob/clusters
Body:
{
"type": "PRIMARY",
"name": "terran",
"password": "xxxxx",
"primaryZone": "",
"rpmName": "oceanbase-2.2.73-20201211175814.el7.x86_64.rpm",
"zones": [
{
"name": "zone1",
"idcName": "hz2",
"servers": [
1
]
}
]
}
Sample response
{
"data": {
"cluster": {
"id": 22,
"name": "terran",
"obClusterId": 1
},
"context": "Context(parallelIdx=-1, stringMap={cluster_version=2.2.73, cluster_name=terran, startup_option_string=system_memory=5G, ob_version=2.2.73, service_name=terran:1, ob_connect_address=xxx.xxx.xxx.xxx, cluster_type=PRIMARY, ob_cluster_id=1, link_obproxy=false, zone1.idc=hz2, primary_zone=, sql_port=2881, service_type=OB_CLUSTER, cluster_id=22, rpm_name=oceanbase-2.2.73-20201211175814.el7.x86_64.rpm, target_cluster_status=RUNNING}, listMap={root_servers=[1], root_server_ips=[xxx.xxx.xxx.xxx], host_ids=[1], zone1.host_ids=[1], zone_names=[zone1]})",
"creator": {
"id": 100,
"name": "admin"
},
"id": 108088,
"name": "Create primary OB cluster",
"startTime": "2021-03-02T11:39:34.508+08:00",
"status": "RUNNING",
"tasks": [
{
"description": "Trigger compaction",
"downstreams": [
129864
],
"id": 129848,
"name": "Trigger compaction",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129859
]
},
{
"description": "Set sys primary zone",
"downstreams": [
129855
],
"id": 129849,
"name": "Set sys primary zone",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129850
]
},
{
"description": "Create default user",
"downstreams": [
129849
],
"id": 129850,
"name": "Create default user",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129866
]
},
{
"description": "Wait node",
"downstreams": [
129865
],
"id": 129851,
"name": "Wait node",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129853
]
},
{
"description": "Wait node",
"downstreams": [
129870
],
"id": 129852,
"name": "Wait node",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129867
]
},
{
"description": "Make dir for ob",
"downstreams": [
129851
],
"id": 129853,
"name": "Make dir for ob",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129868
]
},
{
"description": "Wait node",
"downstreams": [
129869
],
"id": 129854,
"name": "Wait node",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129862
]
},
{
"description": "Wait cluster accessible",
"downstreams": [
129867
],
"id": 129855,
"name": "Wait cluster accessible",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129849
]
},
{
"description": "Sync all tenant information",
"downstreams": [
129859
],
"id": 129856,
"name": "Sync all tenant information",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129857
]
},
{
"description": "Sync cluster info",
"downstreams": [
129856
],
"id": 129857,
"name": "Sync cluster info",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129870
]
},
{
"description": "Prepare install cluster",
"downstreams": [
129862
],
"id": 129858,
"name": "Prepare install cluster",
"operation": "EXECUTE",
"status": "RUNNING",
"upstreams": [
]
},
{
"description": "Update OB cluster status",
"downstreams": [
129848
],
"id": 129859,
"name": "Update OB cluster status",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129856
]
},
{
"description": "Restart observer process",
"downstreams": [
129861
],
"id": 129860,
"name": "Restart observer process",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129863
]
},
{
"description": "Wait observer accessible",
"downstreams": [
129866
],
"id": 129861,
"name": "Wait observer accessible",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129860
]
},
{
"description": "Pre check for install OB",
"downstreams": [
129854
],
"id": 129862,
"name": "Pre check for install OB",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129858
]
},
{
"description": "Bootstrap ob",
"downstreams": [
129860
],
"id": 129863,
"name": "Bootstrap ob",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129865
]
},
{
"description": "Link obproxy",
"downstreams": [
],
"id": 129864,
"name": "Link obproxy",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129848
]
},
{
"description": "Do io bench",
"downstreams": [
129863
],
"id": 129865,
"name": "Do io bench",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129851
]
},
{
"description": "Set sys password",
"downstreams": [
129850
],
"id": 129866,
"name": "Set sys password",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129861
]
},
{
"description": "Refresh ocp agent config",
"downstreams": [
129852
],
"id": 129867,
"name": "Refresh ocp agent config",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129855
]
},
{
"description": "Wait node",
"downstreams": [
129853
],
"id": 129868,
"name": "Wait node",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129869
]
},
{
"description": "Install rpm",
"downstreams": [
129868
],
"id": 129869,
"name": "Install rpm",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129854
]
},
{
"description": "Start ocp agent service",
"downstreams": [
129857
],
"id": 129870,
"name": "Start ocp agent service",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129852
]
}
]
},
"duration": 446,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-03-02T11:39:34.614+08:00",
"traceId": "ec3bd39a90c748d4"
}