---
title: "增加租户副本 - 云平台 OCP V4.3.0 | OceanBase 文档中心"
description: "增加租户副本 功能说明 为指定租户新增副本。 调用说明 接口约束 调用者需要通过 OCP 应用服务鉴权。 请求路径 POST /api/v2/ob/clusters/{id}/tenants/{tenantId}/addReplica 请求参数 path： 参数 类型 必选 示例值 描述 id Long 是 1000…"
---
切换语言

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

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

# 增加租户副本

更新时间：2026-04-14 11:55:54

[编辑](https://github.com/oceanbase/ocp-doc/edit/V4.3.0/zh-CN/1900.reference-guide/200.api-reference/500.tenant-information/1100.add-tenant-replicas.md)  

## 功能说明

为指定租户新增副本。

## 调用说明

### 接口约束

调用者需要通过 OCP 应用服务鉴权。

### 请求路径

`POST /api/v2/ob/clusters/{id}/tenants/{tenantId}/addReplica`

### 请求参数

**path：**

| 参数 | 类型 | 必选 | 示例值 | 描述 |
| --- | --- | --- | --- | --- |
| id | Long | 是 | 1000001 | 目标租户所属集群在 OCP 端的集群 ID。 |
| tenantId | Long | 是 | 1000005 | 目标租户在 OCP 端的租户 ID。 |

**body：**

| 参数 | 类型 | 必选 | 示例值 | 描述 |
| --- | --- | --- | --- | --- |
| zoneName | String | 是 | foo | 租户名称，集群下唯一。 |
| replicaType | String | 是 | FULL | 副本类型，取值范围：- FULL - LOGONLY - READONLY - COLUMNSTORE |
| resourcePool | Object | 是 | -- | 资源池信息。 |
| ├─unitSpecName | Object | 是 | S1 | 可在 “Unit 规格管理” 页面上查看规格列表。 |
| ├─unitCount | Integer | 是 | 1 | Unit 个数。 |

### 返回结果

**基础数据结构**

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

## 示例

### 请求示例

`POST /api/v2/ob/clusters/1000001/tenants/1000005/addReplica`

```json
[
  {
    "zoneName": "zone1",
    "replicaType": "FULL",
    "resourcePool": {
      "unitSpecName": "S0",
      "unitCount": 1
    }
  }
]

```

### 返回示例

```json
{
  "data": {
    "clusterId": 1000001,
    "context": {
      "listMap": {

      },
      "parallel": false,
      "parallelIdx": -1,
      "stringMap": {
        "tenant_id": "1000005",
        "cluster_id": "1000001",
        "zone_name": "zone2"
      }
    },
    "creator": "admin",
    "executor": "xxx.xxx.xxx.xxx",
    "id": 239151,
    "name": "Add tenant replica",
    "operation": "EXECUTE",
    "startTime": "2021-06-30T11:33:14.296+08:00",
    "status": "RUNNING",
    "subtasks": [
      {
        "className": "com.alipay.ocp.service.task.business.tenant.WaitAlterLocalityTask",
        "description": "Wait alter locality",
        "downstreams": [
          304131
        ],
        "id": 304130,
        "name": "Wait alter locality",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "runTime": 1,
        "seriesId": 0,
        "status": "PENDING",
        "timeout": 3600,
        "upstreams": [
          304129
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.tenant.PrepareAlterTenantTask",
        "description": "Prepare alter tenant",
        "downstreams": [
          304130
        ],
        "id": 304129,
        "name": "Prepare alter tenant",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "runTime": 1,
        "seriesId": 3,
        "status": "READY",
        "timeout": 300,
        "upstreams": [

        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.tenant.SyncTenantInfoTask",
        "description": "Sync tenant information",
        "downstreams": [
          304132
        ],
        "id": 304131,
        "name": "Sync tenant information",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "runTime": 1,
        "seriesId": 1,
        "status": "PENDING",
        "timeout": 300,
        "upstreams": [
          304130
        ]
      },
      {
        "className": "com.alipay.ocp.service.task.business.tenant.UpdateTenantStatusTask",
        "description": "Update tenant status",
        "downstreams": [

        ],
        "id": 304132,
        "name": "Update tenant status",
        "nodeType": "JAVA_TASK",
        "operation": "EXECUTE",
        "parallelIdx": -1,
        "runTime": 1,
        "seriesId": 2,
        "status": "PENDING",
        "timeout": 300,
        "upstreams": [
          304131
        ]
      }
    ],
    "taskDefinitionId": -1,
    "tenantId": 18,
    "type": "MANUAL"
  },
  "duration": 220,
  "server": "a83ad33525",
  "status": 200,
  "successful": true,
  "timestamp": "2021-06-30T11:33:14.316+08:00",
  "traceId": "3c390d0597744316"
}

```

 上一篇 下一篇 ![有帮助](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) 咨询热线
