Description
You can call this operation to take over an OceanBase cluster. Before you take over an OceanBase cluster, you can perform a precheck on the cluster. For more information, see Perform a takeover precheck on an OceanBase cluster.
Call description
Prerequisites
You have the permission to take over the specified 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/takeOver
Request parameters
Body parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| rootSysPassword | String | Yes | ****** | The password of the root@sys user. |
| address | String | Yes | xxx.xxx.xxx.xxx | The address used to connect to the cluster. |
| port | Integer | Yes | 2883 | The port used to connect to the cluster. |
| saveToCredential | Boolean | No | true | Specifies whether to save the password to the password box. Default value: true. |
| connectionMode | String | No | direct | The connection mode. Valid values: direct and proxy. Default value: direct. |
| clusterName | String | No | ob01 | The name of the cluster. If the connectionMode parameter is set to proxy, this parameter is required. |
| obClusterId | Integer | No | 1001 | The ID of the cluster in OceanBase Database. If the connectionMode parameter is set to proxy and the cluster to be taken over is a standby cluster, this parameter is required. |
| switchConfigUrl | Boolean | No | true | Specifies whether to switch the ConfigUrl of the target cluster to the current OCP. Default value: true. |
| hostInfo | Object | No | - | If all hosts in the cluster have been taken over to the OCP, this parameter is not required. If the cluster contains hosts that are not taken over to the OCP, you must configure the following parameters of those hosts. |
| ├─ kind | String | No | DEDICATED_PHYSICAL_MACHINE | The host category. Valid values: DEDICATED_PHYSICAL_MACHINE, DEDICATED_ECS, and DEDICATED_CONTAINER. Default value: DEDICATED_PHYSICAL_MACHINE. |
| ├─ publishPorts | String | No | 22 | The container port mapping. This parameter is valid when the kind parameter is set to DEDICATED_CONTAINER. |
| ├─ hostTypeId | Integer | Yes | 281 | The ID of the host type. |
| ├─ credentialId | Integer | Yes | 32765 | The ID of the host credential. |
| ├─ sshPort | Integer | No | 22 | The SSH port number of the host. Default value: 22. |
| vpcId | Long | No | 1L | The ID of the virtual private cloud (VPC). |
| vpcName | String | No | xxx | The name of the VPC. |
| proxyroPassword | String | No | ***** | The password of the proxyro@sys user. |
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/takeOver
Body:
{
"rootSysPassword":"xxxxx",
"address":"xxxxx",
"port":2888
}
Sample response
{
"data": {
"clusterId": 5000034,
"creator": "admin",
"executor": "xxx.xxx.xxx.xxx",
"id": 13089035,
"name": "Take over primary OB cluster",
"operation": "EXECUTE",
"prohibitRollback": false,
"startTime": "2024-10-10T17:15:17.816+08:00",
"status": "RUNNING",
"subtasks": [
{
"description": "Mc lock ob clusters",
"downstreams": [
13104470
],
"id": 13104477,
"name": "Mc lock ob clusters",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 25,
"status": "READY",
"timeout": 60,
"upstreams": []
},
{
"description": "Create default user",
"downstreams": [
13104480
],
"id": 13104481,
"name": "Create default user",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 0,
"status": "PENDING",
"timeout": 180,
"upstreams": [
13104476
]
},
{
"description": "Update observer status",
"downstreams": [
13104471
],
"id": 13104469,
"name": "Update observer status",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": 0,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 16,
"status": "PENDING",
"timeout": 300,
"upstreams": [
13104468
]
},
{
"description": "Update OB cluster status",
"downstreams": [
13104463
],
"id": 13104465,
"name": "Update OB cluster status",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 12,
"status": "PENDING",
"timeout": 30,
"upstreams": [
13104484
]
},
{
"description": "Active agent modules",
"downstreams": [
13104485
],
"id": 13104482,
"name": "Active agent modules",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": 0,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 6,
"status": "PENDING",
"timeout": 1800,
"upstreams": [
13104461
]
},
{
"description": "Wait node",
"downstreams": [
13104482
],
"id": 13104461,
"name": "Wait node",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 3,
"status": "PENDING",
"timeout": 30,
"upstreams": [
13104475
]
},
{
"description": "Sync cluster info",
"downstreams": [
13104473
],
"id": 13104466,
"name": "Sync cluster info",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 5,
"status": "PENDING",
"timeout": 60,
"upstreams": [
13104485
]
},
{
"description": "Sync all tenant information",
"downstreams": [
13104468
],
"id": 13104473,
"name": "Sync all tenant information",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 15,
"status": "PENDING",
"timeout": 300,
"upstreams": [
13104466
]
},
{
"description": "Mc unlock ob clusters",
"downstreams": [],
"id": 13104478,
"name": "Mc unlock ob clusters",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 23,
"status": "PENDING",
"timeout": 60,
"upstreams": [
13104463
]
},
{
"description": "Prepare take over cluster",
"downstreams": [
13104476
],
"id": 13104470,
"name": "Prepare take over cluster",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 13,
"status": "PENDING",
"timeout": 30,
"upstreams": [
13104477
]
},
{
"description": "Wait node",
"downstreams": [
13104483
],
"id": 13104464,
"name": "Wait node",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 7,
"status": "PENDING",
"timeout": 30,
"upstreams": [
13104472
]
},
{
"description": "Register config url",
"downstreams": [
13104472
],
"id": 13104480,
"name": "Register config url",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 20,
"status": "PENDING",
"timeout": 60,
"upstreams": [
13104481
]
},
{
"description": "Set proxyro password to sys tenant",
"downstreams": [
13104469
],
"id": 13104468,
"name": "Set proxyro password to sys tenant",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 4,
"status": "PENDING",
"timeout": 600,
"upstreams": [
13104473
]
},
{
"description": "Run io calibration",
"downstreams": [
13104464
],
"id": 13104472,
"name": "Run io calibration",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": 0,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 14,
"status": "PENDING",
"timeout": 1800,
"upstreams": [
13104480
]
},
{
"description": "Wait cluster accessible",
"downstreams": [
13104474
],
"id": 13104462,
"name": "Wait cluster accessible",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 8,
"status": "PENDING",
"timeout": 1200,
"upstreams": [
13104483
]
},
{
"description": "Update server process info",
"downstreams": [
13104479
],
"id": 13104474,
"name": "Update server process info",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": 0,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 1,
"status": "PENDING",
"timeout": 5000,
"upstreams": [
13104462
]
},
{
"description": "Refresh ocp agent config",
"downstreams": [
13104461
],
"id": 13104475,
"name": "Refresh ocp agent config",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": 0,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 21,
"status": "PENDING",
"timeout": 3600,
"upstreams": [
13104467
]
},
{
"description": "Reserve host",
"downstreams": [
13104481
],
"id": 13104476,
"name": "Reserve host",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 2,
"status": "PENDING",
"timeout": 1800,
"upstreams": [
13104470
]
},
{
"description": "Wait node",
"downstreams": [
13104467
],
"id": 13104479,
"name": "Wait node",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 10,
"status": "PENDING",
"timeout": 30,
"upstreams": [
13104474
]
},
{
"description": "Record root service list",
"downstreams": [
13104462
],
"id": 13104483,
"name": "Record root service list",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 9,
"status": "PENDING",
"timeout": 60,
"upstreams": [
13104464
]
},
{
"description": "Create resource manager for default user",
"downstreams": [
13104478
],
"id": 13104463,
"name": "Create resource manager for default user",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 11,
"status": "PENDING",
"timeout": 180,
"upstreams": [
13104465
]
},
{
"description": "Update zone status",
"downstreams": [
13104484
],
"id": 13104460,
"name": "Update zone status",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": 0,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 19,
"status": "PENDING",
"timeout": 1800,
"upstreams": [
13104471
]
},
{
"description": "Wait node",
"downstreams": [
13104466
],
"id": 13104485,
"name": "Wait node",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 24,
"status": "PENDING",
"timeout": 30,
"upstreams": [
13104482
]
},
{
"description": "Wait node",
"downstreams": [
13104460
],
"id": 13104471,
"name": "Wait node",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 17,
"status": "PENDING",
"timeout": 30,
"upstreams": [
13104469
]
},
{
"description": "Wait node",
"downstreams": [
13104465
],
"id": 13104484,
"name": "Wait node",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 22,
"status": "PENDING",
"timeout": 30,
"upstreams": [
13104460
]
},
{
"description": "Attach cluster attributes",
"downstreams": [
13104475
],
"id": 13104467,
"name": "Attach cluster attributes",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 18,
"status": "PENDING",
"timeout": 1800,
"upstreams": [
13104479
]
}
],
"taskDefinitionId": -1,
"type": "MANUAL"
},
"duration": 493,
"server": "74f95ea2f4",
"status": 200,
"successful": true,
"timestamp": "2024-10-10T17:15:17.896+08:00",
"traceId": "a555fda01af052c1"
}