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 Roles overview and Users Overview.
You have passed the authentication for the OCP application service.
Request path
POST /api/v2/ob/clusters
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| name | String | Yes | foo | The name of the cluster. |
| 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 specified sys tenant in the cluster. |
| zones | Object | Yes | -- | -- |
| ├─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. |
Response parameters
Basic data structure
| Parameter | Type | Description |
|---|---|---|
| data | Object | The information about the asynchronous task. For more information, see Task information. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The time taken by the server to process the request, in milliseconds. |
| status | Integer | An 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"
}