Restart an OBServer

2024-11-06 03:13:28  Updated

Description

You can call this operation to restart an OBServer in an OceanBase cluster.

Call description

Prerequisites

  • You have the permissions to manage the 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/{id}/servers/{serverId}/restart

Path parameters

Parameter Type Required Example value Description
id Integer Yes 1 The ID of the OceanBase cluster.
serverId Integer Yes 1 The ID of the OBServer to be restarted.

Request parameters

Parameter Type Required Example value Description
force Boolean No False Specifies whether to enable force restart.

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/1/servers/2/restart

Sample response

{
  "data": {
    "clusterId": 12000001,
    "context": {
      "listMap": {
        "server_ids": [
          "13000002"
        ]
      },
      "parallel": false,
      "parallelIdx": -1,
      "stringMap": {
        "cluster_name": "protoss",
        "cluster_id": "12000001",
        "ocpagent_service_name": "agent",
        "prohibit_rollback": "false",
        "former_cluster_status": "RUNNING",
        "target_zone_status": "RUNNING",
        "former_zone_status": "RUNNING",
        "zone_name": "zone2",
        "target_cluster_status": "RUNNING",
        "server_id": "13000002"
      }
    },
    "creator": "admin",
    "executor": "xxx.xxx.xxx.xxx",
    "id": 89027028,
    "name": "Restart OB server",
    "operation": "EXECUTE",
    "startTime": "2021-09-05T22:46:20.22+08:00",
    "status": "RUNNING",
    "subtasks": [
      {
        "className": "com.alipay.ocp.service.task.business.cluster.SyncClusterInfoTask",
        "description": "Sync cluster info",
        "downstreams": [
          89030474
        ],
        "id": 89030480,
        "name": "Sync cluster info",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 4,
        "status": "PENDING",
        "timeout": 30,
        "upstreams": [
          89030478
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.obagent.StartOcpAgentServiceTask",
        "description": "Start ocp agent service",
        "downstreams": [
          89030483
        ],
        "id": 89030472,
        "name": "Start ocp agent service",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 3,
        "status": "PENDING",
        "timeout": 1800,
        "upstreams": [
          89030481
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.server.PrepareRestartObServerTask",
        "description": "Prepare restart observer",
        "downstreams": [
          89030482
        ],
        "id": 89030475,
        "name": "Prepare restart observer",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 6,
        "status": "READY",
        "timeout": 300,
        "upstreams": [
          
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.cluster.UpdateObClusterStatusTask",
        "description": "Update OB cluster status",
        "downstreams": [
          
        ],
        "id": 89030474,
        "name": "Update OB cluster status",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 5,
        "status": "PENDING",
        "timeout": 30,
        "upstreams": [
          89030480
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.server.UpdateObServerStatusTask",
        "description": "Update observer status",
        "downstreams": [
          89030478
        ],
        "id": 89030473,
        "name": "Update observer status",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 0,
        "status": "PENDING",
        "timeout": 300,
        "upstreams": [
          89030483
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.zone.UpdateObZoneStatusTask",
        "description": "Update zone status",
        "downstreams": [
          89030480
        ],
        "id": 89030478,
        "name": "Update zone status",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 9,
        "status": "PENDING",
        "timeout": 1800,
        "upstreams": [
          89030473
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.server.StartObServerProcessTask",
        "description": "Start observer process",
        "downstreams": [
          89030481
        ],
        "id": 89030479,
        "name": "Start observer process",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 10,
        "status": "PENDING",
        "timeout": 1200,
        "upstreams": [
          89030476
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.server.StopObServerTask",
        "description": "Stop server",
        "downstreams": [
          89030476
        ],
        "id": 89030482,
        "name": "Stop server",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 7,
        "status": "PENDING",
        "timeout": 300,
        "upstreams": [
          89030475
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.server.StartObServerTask",
        "description": "Start server",
        "downstreams": [
          89030473
        ],
        "id": 89030483,
        "name": "Start server",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 8,
        "status": "PENDING",
        "timeout": 300,
        "upstreams": [
          89030472
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.server.WaitObServerActiveTask",
        "description": "Wait observer active",
        "downstreams": [
          89030472
        ],
        "id": 89030481,
        "name": "Wait observer active",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 1,
        "status": "PENDING",
        "timeout": 1800,
        "upstreams": [
          89030479
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.server.StopObServerProcessTask",
        "description": "Stop observer process",
        "downstreams": [
          89030479
        ],
        "id": 89030476,
        "name": "Stop observer process",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "prohibitRollback": false,
        "runTime": 1,
        "seriesId": 2,
        "status": "PENDING",
        "timeout": 1200,
        "upstreams": [
          89030482
        ]
      }
    ],
    "taskDefinitionId": -1,
    "type": "MANUAL"
  },
  "duration": 155,
  "server": "a83ad33525",
  "status": 200,
  "successful": true,
  "timestamp": "2021-09-05T22:46:20.277+08:00",
  "traceId": "1f3af8df30ae4733"
}

Contact Us