---
title: "OceanBase 集群新建 Zone | OceanBase 文档中心"
description: OceanBase 集群新建 Zone 功能说明 该接口用于为 OceanBase 集群新增 Zone。 调用说明 接口约束 调用者需具备对目标 OceanBase 集群的管理权限。 关于调用者的权限，详情可参见 安全概述 。 调用者需要通过 OCP 应用服务鉴权。 请求路径 POST /api/v2/ob/clus…
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

文档反馈![](https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*lJTmRZ61jSUAAAAAAAAAAAAADiGDAQ/original) 云平台 OCPV 4.0.3 企业版

# OceanBase 集群新建 Zone

更新时间：2023-08-16 15:51:32

## 功能说明

该接口用于为 OceanBase 集群新增 Zone。

## 调用说明

### 接口约束

- 调用者需具备对目标 OceanBase 集群的管理权限。

  关于调用者的权限，详情可参见 [安全概述](https://www.oceanbase.com/docs/enterprise-oceanbase-ocp-cn-10000000001538756)。
 - 调用者需要通过 OCP 应用服务鉴权。

### 请求路径

`POST /api/v2/ob/clusters/{id}/zones`

**path：**

| 参数 | 类型 | 必选 | 示例值 | 描述 |
| --- | --- | --- | --- | --- |
| id | Integer | 是 | 1 | 目标集群的 ID。 |

### 请求参数

| 参数 | 类型 | 必选 | 示例值 | 描述 |
| --- | --- | --- | --- | --- |
| name | String | 是 | foo | Zone 名 |
| idcName | String | 是 | idc1 | 机房名 |
| servers | Array | 是 | [1,2] | 主机 ID 列表 |

### 返回结果

基础数据结构

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| data | Object | 异步任务信息，详情参见 [任务信息](https://www.oceanbase.com/docs/enterprise-oceanbase-ocp-cn-10000000001540216)。 |
| successful | Boolean | 请求是否成功。 |
| timestamp | Datetime | 服务端完成请求的时间戳。 |
| duration | Integer | 服务端处理请求的时间（毫秒）。 |
| status | Integer | 符合 HTTP Status 规范的编码。 |
| traceId | String | 请求的 Trace ID，用于排查问题。 |
| server | String | 响应请求的应用服务的地址。 |

## 示例

### 请求示例

`POST /api/v2/ob/clusters/1/zones`

body:

```unknow
{
  "name": "zone2",
  "idcName": "hz2",
  "servers": [
    1
  ]
}

```

### 返回示例

```unknow
{
  "data": {
    "cluster": {
      "id": 21,
      "name": "ob_upgrade",
      "obClusterId": 22
    },
    "context": "Context(parallelIdx=-1, stringMap={cluster_name=ob_upgrade, cluster_id=21, service_type=OB_CLUSTER, rpm_name=oceanbase-2.2.75-20210108170301.el7.x86_64.rpm, service_name=ob_upgrade:22, service_version=2.2.75, host.1.zone=zone2, ob_cluster_id=22, zone2.idc=hz2, zone2.region=hangzhou}, listMap={root_server_ips=[xxx.xxx.xxx.xxx], server_ids=[6], host_ids=[1], zone_names=[zone2]})",
    "creator": {
      "id": 100,
      "name": "admin"
    },
    "id": 107618,
    "name": "Add OB Zone",
    "startTime": "2021-03-02T10:57:45.471+08:00",
    "status": "RUNNING",
    "tasks": [
      {
        "description": "Pre check for install OB",
        "downstreams": [
          129213
        ],
        "id": 129202,
        "name": "Pre check for install OB",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129220
        ]
      },
      {
        "description": "Start Zone",
        "downstreams": [
          129215
        ],
        "id": 129203,
        "name": "Start Zone",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129210
        ]
      },
      {
        "description": "Add Zone",
        "downstreams": [
          129210
        ],
        "id": 129204,
        "name": "Add Zone",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129213
        ]
      },
      {
        "description": "Wait node",
        "downstreams": [
          129211
        ],
        "id": 129205,
        "name": "Wait node",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129216
        ]
      },
      {
        "description": "Wait observer active",
        "downstreams": [
          129221
        ],
        "id": 129206,
        "name": "Wait observer active",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129211
        ]
      },
      {
        "description": "Make dir for ob",
        "downstreams": [
          129208
        ],
        "id": 129207,
        "name": "Make dir for ob",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129212
        ]
      },
      {
        "description": "Wait node",
        "downstreams": [
          129216
        ],
        "id": 129208,
        "name": "Wait node",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129207
        ]
      },
      {
        "description": "Prepare add Zone",
        "downstreams": [
          129220
        ],
        "id": 129209,
        "name": "Prepare add Zone",
        "operation": "EXECUTE",
        "status": "RUNNING",
        "upstreams": [

        ]
      },
      {
        "description": "Wait node",
        "downstreams": [
          129203
        ],
        "id": 129210,
        "name": "Wait node",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129204
        ]
      },
      {
        "description": "Add observer",
        "downstreams": [
          129206
        ],
        "id": 129211,
        "name": "Add observer",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129205
        ]
      },
      {
        "description": "Wait node",
        "downstreams": [
          129207
        ],
        "id": 129212,
        "name": "Wait node",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129219
        ]
      },
      {
        "description": "Wait node",
        "downstreams": [
          129204
        ],
        "id": 129213,
        "name": "Wait node",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129202
        ]
      },
      {
        "description": "Wait observer active",
        "downstreams": [
          129218
        ],
        "id": 129214,
        "name": "Wait observer active",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129221
        ]
      },
      {
        "description": "Set Zone idc info",
        "downstreams": [
          129219
        ],
        "id": 129215,
        "name": "Set Zone idc info",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129203
        ]
      },
      {
        "description": "Start observer process with param",
        "downstreams": [
          129205
        ],
        "id": 129216,
        "name": "Start observer process with param",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129208
        ]
      },
      {
        "description": "Wait node",
        "downstreams": [
          129226
        ],
        "id": 129217,
        "name": "Wait node",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129218
        ]
      },
      {
        "description": "Start ocp agent service",
        "downstreams": [
          129217
        ],
        "id": 129218,
        "name": "Start ocp agent service",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129214
        ]
      },
      {
        "description": "Install rpm",
        "downstreams": [
          129212
        ],
        "id": 129219,
        "name": "Install rpm",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129215
        ]
      },
      {
        "description": "Reserve host",
        "downstreams": [
          129202
        ],
        "id": 129220,
        "name": "Reserve host",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129209
        ]
      },
      {
        "description": "Restart observer process",
        "downstreams": [
          129214
        ],
        "id": 129221,
        "name": "Restart observer process",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129206
        ]
      },
      {
        "description": "Wait node",
        "downstreams": [
          129223
        ],
        "id": 129222,
        "name": "Wait node",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129226
        ]
      },
      {
        "description": "Update Zone status",
        "downstreams": [
          129224
        ],
        "id": 129223,
        "name": "Update Zone status",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129222
        ]
      },
      {
        "description": "Sync cluster info",
        "downstreams": [
          129225
        ],
        "id": 129224,
        "name": "Sync cluster info",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129223
        ]
      },
      {
        "description": "Update OB cluster status",
        "downstreams": [

        ],
        "id": 129225,
        "name": "Update OB cluster status",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129224
        ]
      },
      {
        "description": "Update observer status",
        "downstreams": [
          129222
        ],
        "id": 129226,
        "name": "Update observer status",
        "operation": "EXECUTE",
        "status": "PENDING",
        "upstreams": [
          129217
        ]
      }
    ]
  },
  "duration": 217,
  "server": "a83ad33525",
  "status": 200,
  "successful": true,
  "timestamp": "2021-03-02T10:57:45.572+08:00",
  "traceId": "1d3f515c734942a3"
}

```

 上一篇 下一篇 ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
