---
title: "部署 OCP Express | OceanBase 文档中心"
description: 部署 OCP Express 本文根据环境中是否存在 OceanBase 集群分为三种场景介绍如何使用命令行部署 OCP Express。 注意 OCP Express 要求集群中所有的 OBServer 节点都要有对应的 OBAgent，否则 OCP Express 不能正常工作。 前提条件 OceanBase 数…
---
切换语言

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

文档反馈![](https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*Qq8pT6yBPTcAAAAAAAAAAAAADiGDAQ/original) 安装部署工具 OBDV 3.2.0 社区版

# 部署 OCP Express

更新时间：2026-04-14 17:55:42

[编辑](https://github.com/oceanbase/obd-doc/edit/V3.2.0/zh-CN/400.user-guide/300.command-line-operations/200.deploy-component/300.deploy-ocp-express-by-using-obd.md)  

本文根据环境中是否存在 OceanBase 集群分为三种场景介绍如何使用命令行部署 OCP Express。

#### 注意

OCP Express 要求集群中所有的 OBServer 节点都要有对应的 OBAgent，否则 OCP Express 不能正常工作。

## 前提条件

- OceanBase 数据库：V4.0.0.0 及以上版本。
 - OBAgent：V1.3.0 及以上版本，若 OCP Express 为 V4.2.1 及以上版本，OBAgent 需为 V4.2.1 及以上版本。
 - obd：V2.0.0 及以上版本，若 OCP Express 为 V4.2.1 及以上版本，obd 需为 V2.3.1 及以上版本。安装 obd 的详细操作您可参见 [安装 obd](https://www.oceanbase.com/docs/community-obd-cn-1000000002691290)。
 - Java：部署 OCP Express 的机器上需先安装配置 Java 环境，目前仅支持 JDK1.8 版本。详细操作可参考 [常见问题](https://www.oceanbase.com/docs/community-obd-cn-1000000002691256) 中 **如何配置 Java 环境**。
 - 内存：需为 OCP Express 预留 512 MB 以上内存，长期稳定运行建议 762 MB 以上。

#### 说明

本文默认所使用的机器可以连接公网，或者已配置好所需软件（OceanBase 数据库、OBAgent、ODP、OCP Express 等）。若您通过 OceanBase All in One 安装 obd，本地镜像库中默认包含所有部署所需组件的安装包。

## OCP Express 资源规格

### OCP Express 配置要求

OCP Express 服务在运行过程中会产生大量的计算和存储开销，因此需要根据待管理的对象规格进行资源规划。下表以每个集群中包含 10 个租户为标准，计算出 OCP Express 机器的资源消耗。您可根据实际情况进行计算，选择合适的资源配置。

| 管理的机器数量（台） | CPU（核） | 内存（GB） | 磁盘（GB） |
| --- | --- | --- | --- |
| ≤ 10 | 1 | 2 | 20 |
| ≤ 20 | 2 | 4 | 20 |
| ≤ 50 | 4 | 8 | 20 |

#### 说明

OCP Express 机器的最终配置请结合上述开销数据与系统其他资源消耗综合规划，基于系统稳定性考虑，建议 OCP Express 机器的最低配置为 4 核 8 GB，当单个主机的租户数量 ≤ 10 时，仍建议 CPU 和内存保持为 4 核 8 GB。

### MetaDB 资源

MetaDB 用于存储 OCP Express 的元数据和监控数据，推荐在 OceanBase 集群中创建独立的租户用于 Meta DB。

OCP Express 中管理的 OBServer 数量不同，所需的资源也不相同。下表以每个集群中包含 10 个租户为标准，计算出 MetaDB 租户每个副本的 CPU、内存和磁盘资源。您可根据实际情况进行计算，选择合适的资源配置。

| 管理的机器数量（台） | CPU（核） | 内存（GB） | 磁盘（GB） |
| --- | --- | --- | --- |
| ≤ 10 | 1 | 4 | 50 |
| ≤ 20 | 2 | 8 | 100 |
| ≤ 50 | 4 | 16 | 200 |

#### 说明

这里给出的资源消耗只是一个粗略的预估，实际的 MetaDB 资源消耗根据业务用量会有差异。

## 配置文件

obd 提供了部署 OCP Express 所需的配置文件示例，您可根据自身机器资源情况进行修改。

- 若您机器中的 obd 是通过直接下载的方式安装，则可在 `/usr/obd/example` 目录下查看 obd 提供的配置文件示例。
 - 若您机器中的 obd 是通过解压 all-in-one 安装包的方式安装，则可在 `~/.oceanbase-all-in-one/obd/usr/obd/example` 目录下查看 obd 提供的配置文件示例。
 - 您也可在 obd 的 [GitHub 仓库](https://github.com/oceanbase/obdeploy/tree/master/example) 中查看配置文件示例。

#### 说明

配置文件分为小规格开发和专业开发两种模式，两种模式的配置文件中配置项基本相同，配置的规格略有不同，您可根据实际资源条件进行选择。

- 小规格开发模式：适用于个人设备（内存不低于 8 GB），配置文件名中带有 `mini` 或 `min` 标识。
 - 专业开发模式：适用于高配置 ECS 或物理服务器（可用资源不低于 16 核 64 GB）。

obd 提供的和部署 OCP Express 相关的配置文件示例有如下几个。

- 分布式部署全部组件：all-components-min.yaml、all-components.yaml
 - 分布式部署 + ODP + OCP Express：default-components.yaml、default-components-min.yaml
 - 单独部署 OCP Express：ocp-express-only.yaml

## 场景一：部署 OceanBase 集群和 OCP Express

若您要同时部署 OceanBase 集群和 OCP Express，需在 oceanbase-ce 组件下配置 OCP Express 使用所需的租户信息。ocp-express 组件的配置可直接在配置文件中声明依赖于其他组件（oceanbase-ce、obproxy-ce、obagent），此时您只需配置 `home_path` 和 `memory_size`，其余参数会根据依赖的组件进行获取补全。

此处以 `default-components.yaml` 配置文件为例，oceanbase-ce 组件下相关配置如下：

```yaml
oceanbase-ce:
  servers:
    - name: server1
      ip: 172.xx.xxx.4
  global:
    home_path: xxxx
    ...
    ocp_meta_tenant:
      tenant_name: ocp_meta
      max_cpu: 2
      memory_size: 6442450944
    ocp_meta_db: ocp_express
    ocp_meta_username: ocp_user
    ocp_meta_password:
    ...

```

| 配置项 | 是否必选 | 默认值 | 说明 |
| --- | --- | --- | --- |
| ocp_meta_tenant->tenant_name | 可选 | ocp | 为 OCP Express 创建的 meta 租户名称。 |
| ocp_meta_tenant->max_cpu | 可选 | 1 | 为 meta 租户分配的最大 CPU。 |
| ocp_meta_tenant->memory_size | 可选 | 2147483648 | 为 meta 租户分配的内存容量。 |
| ocp_meta_db | 可选 | ocp_express | OCP Express 中数据存储所需的数据库。 |
| ocp_meta_username | 可选 | meta | OCP Express 的 meta 用户名。 |
| ocp_meta_password | 可选 | - obd V2.1.0 之前版本默认为 oceanbase - obd V2.1.0 及之后版本默认为随机字符串 | 用户密码，使用 V2.1.0 及之后版本的 obd 时，未配置的情况下 obd 会自动生成随机密码，可在部署成功后通过 `obd cluster edit-config` 命令查看配置文件中对应的配置项获取密码。 |

这里举例列举了几个重要配置，`ocp_meta_tenant` 下的配置都会作为创建租户时的参数传入。具体有哪些参数可以参考创建租户命令支持的参数，详情请参见 [集群命令组](https://www.oceanbase.com/docs/community-obd-cn-1000000002691284) 中 `obd cluster tenant create` 命令介绍。

#### 说明

上述配置项都不配置的情况下，obd 会按照默认规格为 OCP Express 创建 meta 租户。但是由于用户的租户数量是无法预知的，所以推荐用户根据需要自行修改 meta 租户的规格，推荐的计算公式如下：

- data_disk=3.5 + 节点数*0.5，单位为 GB。
 - log_disk=4.5 + 节点数*0.5 + 租户数*0.5，单位为 GB。

在 oceanbase-ce 组件的 bootstrap 阶段，如果发现用户配置了上述字段或者当前集群中存在 ocp-express 组件，obd 会自动创建对应的 meta 租户以及用户。

ocp-express 组件配置如下：

```yaml
ocp-express:
  depends:
    - oceanbase-ce
    - obproxy-ce
    - obagent
  servers:
    - name: server2
      ip: 10.10.10.4
  global:
    # The working directory for ocp-express. ocp-express is started under this directory. This is a required field.
    home_path: /home/admin/ocp-server
    # log_dir: /home/admin/ocp-server/log # The log directory of ocp express server. The default value is {home_path}/log.
    memory_size: 1G # The memory size of ocp-express server.  The recommend value is 512MB + (expect node num + expect tenant num) * 60MB.
    logging_file_total_size_cap: 10GB # The total log file size of ocp-express server

```

各配置项介绍如下表：

| 配置项 | 是否必选 | 默认值 | 说明 |
| --- | --- | --- | --- |
| home_path | 必选 | 无 | OCP Express 的工作目录，OCP Express 在该目录下启动。 |
| memory_size | 必选 | 无 | OCP Express 服务器的内存容量，推荐算法为：memory_size = 512MB +（期望的节点数 * 期望的租户数）* 60MB    期望的租户数需要包含 sys 和 ocp meta 租户本身。 |
| logging_file_total_size_cap | 必选 | 1GB | 日志文件总大小，默认为 1GB。   > **注意**：   > 该参数的单位需使用 GB 或 MB，若使用 G 或 M 单位会报错，无法成功部署 OCP Express。 |

修改配置文件之后，执行如下命令部署并启动集群：

```shell
# 部署集群
obd cluster deploy <deploy name> -c config.yaml
# 启动集群
obd cluster start <deploy name>

```

集群启动后，根据输出的 `ocp-express` 的登录地址和账号密码登录 OCP Express 即可使用 OCP Express。

## 场景二：为 OceanBase 集群增加 OCP Express（已部署 OBAgent）

若您本身已经部署了 OceanBase 集群和 OBAgent，想要单独增加 OCP Express，可参考本节内容单独部署。

1. （可选）若集群中 OBAgent 版本低于 V1.3.0，需参考如下命令升级 OBAgent。

   ```shell
   # 查看 OBAgent 的 hash 值
   obd mirror list oceanbase.community.stable | grep -e " obagent "
   # 升级 OBAgent
   obd cluster upgrade test -c obagent -V 1.3.0 --usable=<obagent_hash>

   ```

   您需将命令中的 `obagent_hash` 替换为 OBAgent 对应版本的 hash 值。
 2. 为 OCP Express 创建一个 meta 租户、用户和数据库，并为用户授予所需权限。

      1. 创建 meta 租户

        ```shell
        obd cluster tenant create <deploy name> -n <tenant_name> --max-cpu=2 --memory-size=4G --log-disk-size=3G --max-iops=10000 --iops-weight=2 --unit-num=1 --charset=utf8

        ```

        meta 租户的规格大小需根据自身集群部署情况进行配置，详细情况可参见本文 [MetaDB 资源](#MetaDB%20资源)。`obd cluster tenant create` 命令的详细介绍可参考 [集群命令组](https://www.oceanbase.com/docs/community-obd-cn-1000000002691284) 中 `obd cluster tenant create` 命令介绍。

        您也可以连接到 OceanBase 数据库中为 OCP Express 创建租户，详细操作请参考 [创建用户租户](https://www.oceanbase.com/docs/community-observer-cn-0000000000965467)。
      2. 创建用户并授予权限

        ```shell
        create user <ocp_user> identified by '<ocp_password>';
        grant all on *.* to <ocp_user>;

        ```
      3. 创建数据库

        ```shell
        create database <database_name>;

        ```
 3. 修改配置文件

   此处以 `ocp-express-only.yaml` 配置文件为例，具体配置文件内容如下：

   ```yaml
   ## Only need to configure when remote login is required
   # user:
   #   username: your username
   #   password: your password if need
   #   key_file: your ssh-key file path if need
   #   port: your ssh port, default 22
   #   timeout: ssh connection timeout (second), default 30
   ocp-express:
     servers:
       - name: server1
         ip: xxx.xxx.xxx.xxx
     global:
       # The working directory for ocp-express. ocp-express is started under this directory. This is a required field.
       home_path: /home/admin/ocp-server
       log_dir: /home/admin/ocp-server/log # The log directory of ocp express server. The default value is {home_path}/log.
       memory_size: 1G # The memory size of ocp-express server.  The recommend value is 512MB + (expect node num + expect tenant num) * 60MB.
       jdbc_url: jdbc:oceanbase://IP:PORT/meta_db # jdbc connection string to connect to the meta db
       jdbc_username: user_name@tenant_name # username to connect to meta db
       jdbc_password: '<meta db password>' # password to connect to meta db
       port: 8180 # The http port to use.
       cluster_name: obcluster # the cluster name of oceanbase cluster. Refer to the configuration item appname of oceanbase
       ob_cluster_id: 1  # the cluster id of oceanbase cluster. Refer to the configuration item cluster_id of oceanbase
       root_sys_password: <password for root@sys>
       agent_username: <obagent> #  The username of obagent
       agent_password: <password> # The password of obagent
       logging_file_total_size_cap: 10GB # The total log file size of ocp-express server
       server_addresses:  # The cluster info for oceanbase cluster
       - address: 127.0.0.1 # The address of oceanbase server
         svrPort: 2882 # The rpc port of oceanbase server
         sqlPort: 2881 # The mysql port of oceanbase server
         agentMgrPort: 8089 # The port of obagent manager process
         agentMonPort: 8088 # The port of obagent monitor process

   ```

   | 配置项 | 是否必选 | 说明 |
   | --- | --- | --- |
   | home_path | 必选 | OCP Express 的工作目录，OCP Express 在该目录下启动。 |
   | log_dir | 可选 | OCP Express 服务器的日志目录，默认值为 `home_path` 参数下的 log。 |
   | memory_size | 必选 | OCP Express 服务器的内存容量，推荐算法为：memory_size = 512M +（期望的节点数 * 期望的租户数）* 60MB    期望的租户数需要包含 sys 和 ocp meta 租户本身。 |
   | jdbc_url | 必选 | 连接 meta 租户的 JDBC 连接字符串，请确保连接串中使用到的数据库已创建。 |
   | jdbc_username | 必选 | 连接 meta 租户的用户名，请确保该用户已创建。   > **说明**：   >  这里的用户名格式为 user_name@tenant_name，如果只写 user_name 而省略租户名，则默认使用 user_name@sys 连接。sys 租户不允许被当作 meta 租户使用。 |
   | jdbc_password | 必选 | 连接 meta 租户的用户密码。 |
   | port | 必选 | 访问 OCP Express 的 HTTP 端口。 |
   | cluster_name | 必选 | OceanBase 集群的集群名称，需和 oceanbase-ce 组件中的 `appname` 配置项相同。 |
   | ob_cluster_id | 必选 | OceanBase 集群的集群 ID，需和 oceanbase-ce 组件中的 `cluster_id` 配置项相同。 |
   | root_sys_password | 必选 | OceanBase 集群中 root@sys 用户的密码。 |
   | agent_username | 必选 | OBAgent 的用户名。 |
   | agent_password | 必选 | OBAgent 的密码。 |
   | logging_file_total_size_cap | 必选 | 日志文件总大小，默认为 1GB。   > **注意**：   > 该参数的单位需使用 GB 或 MB，若使用 G 或 M 单位会报错，无法成功部署 OCP Express。 |
   | server_addresses->address | 必选 | OBServer 节点的 IP 地址。 |
   | server_addresses->svrPort | 必选 | OBServer 节点的 rpc 端口，需和 oceanbase-ce 组件中对应节点的 `rpc_port` 配置项相同。 |
   | server_addresses->sqlPort | 必选 | OBServer 节点的 mysql 端口，需和 oceanbase-ce 组件中对应节点的 `mysql_port` 配置项相同。 |
   | server_addresses->agentMgrPort | 必选 | OBAgent 管理进程的端口，需根据 OBAgent 中实际设置的端口进行修改。 |
   | server_addresses->agentMonPort | 必选 | OBAgent 监控进程的端口，需根据 OBAgent 中实际设置的端口进行修改。 |
 4. 修改配置文件后，执行如下命令部署并启动集群。

   ```
 5. 集群启动后，根据输出的 `ocp-express` 的登录地址和账号密码登录 OCP Express 即可使用 OCP Express。

## 场景三：为 OceanBase 集群增加 OCP Express（未部署 OBAgent）

若您本身已经部署了 OceanBase 集群，但未部署 OBAgent，想要单独增加 OCP Express，可参考本节内容单独部署。

#### 说明

OCP Express 强依赖 OBAgent，若集群中未部署 OBAgent，您需同时部署 OBAgent 和 OCP Express。

### 步骤一：创建 meta 租户

您可参考本步骤为 OCP Express 创建一个 meta 租户、用户和数据库，并为用户授予所需权限

   ```

   ```

### 步骤二：修改配置文件

您可参考本节内容配置 OBAgent 和 OCP Express。

1. 配置用户

   ```yaml
   ## Only need to configure when remote login is required
   user:
     username: admin
   #   password: your password if need
     key_file: /home/admin/.ssh/id_rsa
   #   port: your ssh port, default 22
   #   timeout: ssh connection timeout (second), default 30

   ```

   `username` 为登录到目标机器的用户名，确保您的用户名有 `home_path` 的写权限。`password` 和 `key_file` 均用于验证用户，通常情况下只需要填写一个。

   #### 注意

   在配置秘钥路径后，如果您的秘钥不需要口令，请注释或者删除 `password`，以免 `password` 被视为秘钥口令用于登录，导致校验失败。
 2. 配置 OBAgent

   ```yaml
   obagent:
     servers:
       # Please don't use hostname, only IP can be supported
       - 10.10.10.1
       - 10.10.10.2
       - 10.10.10.3
     global:
       # The working directory for obagent. obagent is started under this directory. This is a required field.
       home_path: /home/admin/obagent
       # The port of monitor agent. The default port number is 8088.
       monagent_http_port: 8088
       # The port of manager agent. The default port number is 8089.
       mgragent_http_port: 8089
       # Log path. The default value is log/monagent.log.
       log_path: log/monagent.log
       # The log level of manager agent.
       mgragent_log_level: info
       # The total size of manager agent.Log size is measured in Megabytes. The default value is 30M.
       mgragent_log_max_size: 30
       # Expiration time for manager agent logs. The default value is 30 days.
       mgragent_log_max_days: 30
       # The maximum number for manager agent log files. The default value is 15.
       mgragent_log_max_backups: 15
       # The log level of monitor agent.
       monagent_log_level: info
       # The total size of monitor agent.Log size is measured in Megabytes. The default value is 200M.
       monagent_log_max_size: 200
       # Expiration time for monitor agent logs. The default value is 30 days.
       monagent_log_max_days: 30
       # The maximum number for monitor agent log files. The default value is 15.
       monagent_log_max_backups: 15
       # Username for HTTP authentication. The default value is admin.
       http_basic_auth_user: admin
       # Password for HTTP authentication. The default value is a random password.
       # http_basic_auth_password: ******
       # Monitor password for OceanBase Database. The default value is empty. When a depends exists, obd gets this value from the oceanbase-ce of the depends. The value is the same as the ocp_agent_monitor_password in oceanbase-ce.
       monitor_password: ******
       # The SQL port for observer. The default value is 2881. When a depends exists, obd gets this value from the oceanbase-ce of the depends. The value is the same as the mysql_port in oceanbase-ce.
       sql_port: 2881
       # The RPC port for observer. The default value is 2882. When a depends exists, obd gets this value from the oceanbase-ce of the depends. The value is the same as the rpc_port in oceanbase-ce.
       rpc_port: 2882
       # Cluster name for OceanBase Database. When a depends exists, obd gets this value from the oceanbase-ce of the depends. The value is the same as the appname in oceanbase-ce.
       cluster_name: obcluster
       # Cluster ID for OceanBase Database. When a depends exists, obd gets this value from the oceanbase-ce of the depends. The value is the same as the cluster_id in oceanbase-ce.
       cluster_id: 1
       # The redo dir for Oceanbase Database. When a depends exists, obd gets this value from the oceanbase-ce of the depends. The value is the same as the redo_dir in oceanbase-ce.
       ob_log_path: /home/admin/observer/store
       # The data dir for Oceanbase Database. When a depends exists, obd gets this value from the oceanbase-ce of the depends. The value is the same as the data_dir in oceanbase-ce.
       ob_data_path: /home/admin/observer/store
       # The work directory for Oceanbase Database. When a depends exists, obd gets this value from the oceanbase-ce of the depends. The value is the same as the home_path in oceanbase-ce.
       ob_install_path: /home/admin/observer
       # The log path for Oceanbase Database. When a depends exists, obd gets this value from the oceanbase-ce of the depends. The value is the same as the {home_path}/log in oceanbase-ce.
       observer_log_path: /home/admin/observer/log
       # Monitor status for OceanBase Database.  Active is to enable. Inactive is to disable. The default value is active. When you deploy an cluster automatically, obd decides whether to enable this parameter based on depends.
       ob_monitor_status: active
     10.10.10.1:
       # Zone name for your observer. The default value is zone1. When a depends exists, obd gets this value from the oceanbase-ce of the depends. The value is the same as the zone name in oceanbase-ce.
       zone_name: zone1
     10.10.10.2:
       # Zone name for your observer. The default value is zone1. When a depends exists, obd gets this value from the oceanbase-ce of the depends. The value is the same as the zone name in oceanbase-ce.
       zone_name: zone2
     10.10.10.3:
       # Zone name for your observer. The default value is zone1. When a depends exists, obd gets this value from the oceanbase-ce of the depends. The value is the same as the zone name in oceanbase-ce.
       zone_name: zone3

   ```

   | 配置项 | 是否必选 | 默认值 | 说明 |
   | --- | --- | --- | --- |
   | servers | 必选 | 无 | 每台机器需要用 `- name: 机器标识名（换行）ip: 机器 IP` 指定，多个机器就指定多次，机器标识名不能重复。    在机器 IP 不重复的情况下，也可以使用 `- <ip> （换行）- <ip>` 的格式指定，此时 `- <ip>` 的格式相当于 `- name: 机器 IP（换行）ip: 机器 IP`。   > **注意**   > 使用 OBAgent 监控 OceanBase 数据库时，servers 配置需和 OceanBase 数据库组件下的 servers 保持一致。 |
   | home_path | 必选 | 无 | 组件的工作目录，建议在普通用户 admin 下。 |
   | monagent_http_port | 必选 | 8088 | OBAgent 监控服务端口。 |
   | mgragent_http_port | 必选 | 8089 | OBAgent 管理服务端口。 |
   | log_path | 必选 | log/monagent.log | 日志路径。 |
   | mgragent_log_level | 可选 | 无 | ob_mgragent 日志级别。 |
   | mgragent_log_max_size | 可选 | 30 | ob_mgragent 日志文件大小，单位：MB。 |
   | mgragent_log_max_days | 可选 | 30 | ob_mgragent 日志文件最大保留天数。 |
   | mgragent_log_max_backups | 可选 | 15 | ob_mgragent 日志文件最大备份数。 |
   | monagent_log_level | 可选 | info | ob_monagent 日志级别。 |
   | monagent_log_max_size | 可选 | 200 | ob_monagent 日志文件大小，单位：MB。 |
   | monagent_log_max_days | 可选 | 30 | ob_monagent 日志文件最大保留天数。 |
   | monagent_log_max_backups | 可选 | 15 | ob_monagent 日志文件最大备份数。 |
   | http_basic_auth_user | 必选 | admin | HTTP 服务认证用户名。 |
   | http_basic_auth_password | 可选 | 随机字符串 | HTTP 服务认证密码，自定义情况下要求密码长度最少为一个字符，可包含数字（0~9）、大写字母（A~Z）、小写字母（a~z）、特殊符号（`~^*{}[]_-+`）。未配置的情况下，obd 会自动生成随机字符串。可在部署成功后通过 `obd cluster edit-config` 命令查看配置文件中对应的配置项获取密码。 |
   | monitor_password | 可选 | 空 | OceanBase 数据库监控数据采集用户密码，其值需和 OceanBase 数据库中 `ocp_agent_monitor_password` 配置项相同。 |
   | sql_port | 可选 | 2881 | OBServer 节点的 SQL 端口，其值需和 OceanBase 数据库中 `mysql_port` 配置项相同。 |
   | rpc_port | 可选 | 2882 | OBServer 节点的 RPC 端口，其值需和 OceanBase 数据库中 `rpc_port` 配置项相同。 |
   | cluster_name | 可选 | obcluster | OceanBase 数据库的集群名，其值需和 oceanbase-ce 组件下的 `appname` 配置项相同。 |
   | cluster_id | 可选 | 1 | OceanBase 数据库 ID，其值需和 oceanbase-ce 组件下的 `cluster_id` 配置项相同。 |
   | ob_log_path | 可选 | 无 | OBServer 节点日志盘路径，其值需和 oceanbase-ce 组件下的 `redo_dir` 配置项相同。 |
   | ob_data_path | 可选 | 无 | OBServer 节点数据盘路径，其值需和 oceanbase-ce 组件下的 `data_dir` 配置项相同。 |
   | ob_install_path | 可选 | 无 | OBServer 节点安装目录，其值需和 oceanbase-ce 组件下的 `home_path` 配置项相同。 |
   | observer_log_path | 可选 | 无 | OBServer 节点安装目录下的日志路径，其值需和 oceanbase-ce 组件下的 `{home_path}/log` 相同。 |
   | ob_monitor_status | 必选 | active | OceanBase 监控指标采集状态，active 表示开启，inactive 表示关闭。 |
   | zone_name | 可选 | zone1 | OBServer 节点所在的 Zone 名字。 |
 3. 配置 OCP Express

   ```yaml
   ocp-express:
     depends:
       - obagent
     servers:
       - name: server1
         ip: 10.10.10.4
     global:
       # The working directory for ocp-express. ocp-express is started under this directory. This is a required field.
       home_path: /home/admin/ocp-server
       log_dir: /home/admin/ocp-server/log # The log directory of ocp express server. The default value is {home_path}/log.
       memory_size: 1G # The memory size of ocp-express server.  The recommend value is 512MB + (expect node num + expect tenant num) * 60MB.
       jdbc_url: jdbc:oceanbase://IP:PORT/meta_db # jdbc connection string to connect to the meta db
       jdbc_username: user_name@tenant_name # username to connect to meta db
       jdbc_password: '<meta db password>' # password to connect to meta db
       port: 8180 # The http port to use.
       cluster_name: obcluster # the cluster name of oceanbase cluster. Refer to the configuration item appname of oceanbase
       ob_cluster_id: 1  # the cluster id of oceanbase cluster. Refer to the configuration item cluster_id of oceanbase
       root_sys_password: <password for root@sys>
       logging_file_total_size_cap: 10GB # The total log file size of ocp-express server
       server_addresses:  # The cluster info for oceanbase cluster
       - address: 127.0.0.1 # The address of oceanbase server
         svrPort: 2882 # The rpc port of oceanbase server
         sqlPort: 2881 # The mysql port of oceanbase server

   ```

   | 配置项 | 是否必选 | 说明 |
   | --- | --- | --- |
   | home_path | 必选 | OCP Express 的工作目录，OCP Express 在该目录下启动。 |
   | log_dir | 可选 | OCP Express 服务器的日志目录，默认值为 `home_path` 参数下的 log。 |
   | memory_size | 必选 | OCP Express 服务器的内存容量，推荐算法为：memory_size = 512M +（期望的节点数 * 期望的租户数）* 60MB    期望的租户数需要包含 sys 和 ocp meta 租户本身。 |
   | jdbc_url | 必选 | 连接 meta 租户的 JDBC 连接字符串，请确保连接串中使用到的数据库已创建。 |
   | jdbc_username | 必选 | 连接 meta 租户的用户名，请确保该用户已创建。   > **说明**   >  这里的用户名格式为 user_name@tenant_name，如果只写 user_name 而省略租户名，则默认使用 user_name@sys 连接。sys 租户不允许被当作 meta 租户使用。 |
   | jdbc_password | 必选 | 连接 meta 租户的用户密码。 |
   | port | 可选 | 访问 OCP Express 的 HTTP 端口。 |
   | cluster_name | 必选 | OceanBase 集群的集群名称，需和 oceanbase-ce 组件中的 `appname` 配置项相同。 |
   | ob_cluster_id | 必选 | OceanBase 集群的集群 ID，需和 oceanbase-ce 组件中的 `cluster_id` 配置项相同。 |
   | root_sys_password | 必选 | OceanBase 集群中 root@sys 用户的密码。 |
   | logging_file_total_size_cap | 必选 | 日志文件总大小，默认为 1GB。   > **注意**：   > 该参数的单位需使用 GB 或 MB，若使用 G 或 M 单位会报错，无法成功部署 OCP Express。 |
   | server_addresses->address | 必选 | OBServer 节点的 IP 地址。 |
   | server_addresses->svrPort | 必选 | OBServer 节点的 rpc 端口，需和 oceanbase-ce 组件中对应节点的 `rpc_port` 配置项相同。 |
   | server_addresses->sqlPort | 必选 | OBServer 节点的 mysql 端口，需和 oceanbase-ce 组件中对应节点的 `mysql_port` 配置项相同。 |

### 步骤三：部署 OCP Express

修改配置文件后，可执行如下命令部署并启动 OCP Express。

```shell
# 部署
obd cluster deploy <deploy name> -c config.yaml
# 启动
obd cluster start <deploy name>

```

OCP Express 启动后，根据输出的 `ocp-express` 的登录地址和账号密码登录 OCP Express 即可使用 OCP Express。

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