This topic describes how to add a specified node to an initialized cluster.
API details
Constraints
The obshell server performs security verification on this API. For more information, see API hybrid encryption.
Request path
POST /api/v1/ob/scale_out
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| agentInfo | AgentInfo | Yes | { "ip": "10.10.10.4", "port": 2886 } |
Information of the node to be added to the cluster, including the following parameters:
|
| obConfigs | map[string]string | Yes | { "mysql_port": "2881", "rpc_port": "2882", "memory_limit": "16G", "system_memory": "8G" } |
The configurations of the OBServer node to be added to the cluster. |
| zone | string | Yes | "zone1" | The zone to which the node belongs. |
| targetAgentPassword | string | No | ***** | If the node has a password, specify the password by using this parameter.
NoteThis parameter is supported starting with obshell V4.2.6. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| successful | bool | Indicates whether the request was successful. |
| timestamp | time.Time | The timestamp when the server finishes the request. |
| duration | int | The time taken by the server to process the request, in milliseconds. |
| status | int | The HTTP status code that conforms to the HTTP status specification. |
| traceId | string | The Trace ID of the request. |
| data | DagDetailDTO | For more information, see the DagDetailDTO data structure section below. |
| error | ApiError | The error generated by the request, including the following parameters:
|
The data structure of DagDetailDTO is as follows:
| Parameter | Type | Description |
|---|---|---|
| id | string | The general ID of the DAG. |
| dag_id | int | The DAG ID, which is the primary key recorded in OceanBase Database. |
| name | string | The name of the DAG. |
| stage | int | The current execution stage of the DAG. |
| max_stage | int | The total number of stages in the DAG execution process. |
| state | string | The execution status of the DAG. |
| operator | string | The type of DAG execution operation. |
| start_time | time.Time | The start time of DAG execution. |
| end_time | time.Time | The end time of DAG execution. |
| additional_data | map[string]any | Other data of the DAG. |
| nodes | []NodeDetailDTO | The information of all nodes in the DAG. For more information, see Get node details. |
Examples
Request example
POST 10.10.10.1:2886/api/v1/ob/scale_out
{
"agentInfo": {
"ip": "10.10.10.4",
"port": 2886
},
"obConfigs": {
"mysqlPort": "2881",
"rpcPort": "2882",
"memory_limit": "16G",
"system_memory": "8G",
"log_disk_size": "24G",
"datafile_size": "24G"
},
"zone": "zone2"
}
The example shows a request sent to the node at 10.10.10.1:2886 to add the node at 10.10.10.4:2886 into the cluster.
Response example
{
"successful": true,
"timestamp": "2024-01-09T20:40:00.86290666+08:00",
"duration": 51,
"status": 200,
"traceId": "29b9c2717c65d7bc",
"data": {
"id": "11",
"dag_id": 1,
"name": "Cluster scale out",
"stage": 1,
"max_stage": 9,
"state": "READY",
"operator": "RUN",
"start_time": "0001-01-01T00:00:00Z",
"end_time": "0001-01-01T00:00:00Z",
"additional_data": null,
"nodes": null
}
}
References
In addition to using the CLI to call the API, you can also use the SDK.
For more information about how to request API methods through obshell-sdk-python, see Scale out a cluster.
For more information about how to request API methods through obshell-sdk-go, see Scale out a cluster.