首批通过分布式安全可靠测评,为关键业务系统打造
配置文件说明
更新时间:2026-04-14 17:56:04
本文介绍 OBD 中的配置文件,以及配置文件中各个配置项的含义。
名词解释
OBD
OceanBase Deployer,OceanBase 安装部署工具,简称为 OBD。详细信息请参考 OBD 文档。
ODP
OceanBase Database Proxy,OceanBase 数据库代理,是 OceanBase 数据库专用的代理服务器,简称为 ODP(又称为 OBProxy,后文统称为 ODP)。详细信息请参见官网 OceanBase 数据库代理 文档。
OBAgent
OBAgent 是 OceanBase 数据库监控采集框架,支持推、拉两种数据采集模式,可以满足不同的应用场景。
OCP Express
基于 Web 的 OceanBase 数据库 4.x 管理工具,融合在 OceanBase 数据库集群中,支持对数据库集群关键性能及基本数据库管理功能。详细信息请参考 OceanBase 云平台 Express (OCP Express)。
Config Server
OceanBase Configserver,Config Server 可提供 OceanBase 的元数据注册,存储和查询服务。详细信息请参见 ob-configserver。
Grafana
Grafana 是一款开源的数据可视化工具,它可以将数据源中的各种指标数据进行可视化展示,以便更直观地了解系统运行状态和性能指标。详细信息可参见 Grafana 官网。
Prometheus
Prometheus 是一个开源的服务监控系统和时序数据库,其提供了通用的数据模型以及快捷数据采集、存储和查询接口。详细信息可参见 Prometheus 官网。
获取配置文件示例
OBD 提供了部署集群所需的配置文件示例,您可根据自身机器资源情况进行修改。
若您机器中的 OBD 是通过直接下载的方式安装,则可在
/usr/obd/example目录下查看 OBD 提供的配置文件示例。若您机器中的 OBD 是通过解压 all-in-one 安装包的方式安装,则可在
~/.oceanbase-all-in-one/obd/usr/obd/example目录下查看 OBD 提供的配置文件示例。您也可在 OBD 的 GitHub 仓库 中查看配置文件示例。
说明
配置文件分为小规格开发和专业开发两种模式,两种模式的配置文件中配置项基本相同,配置的规格略有不同,您可根据实际资源条件进行选择。
小规格开发模式:适用于个人设备(内存不低于 8 GB),配置文件名中带有
mini或min标识。专业开发模式:适用于高配置 ECS 或物理服务器(可用资源不低于 16 核 64 GB)。
部署 OceanBase 数据库时常用的配置文件有如下几个。
| 配置文件 | 说明 | 包含组件 |
|---|---|---|
mini-local-example.yaml/local-example.yaml |
本地单机部署配置文件示例,无需配置用户信息,可在本地单机部署一个 OceanBase 数据库 | OceanBase 数据库 |
mini-single-example.yaml/single-example.yaml |
单机部署配置文件示例,需要配置用户信息,可在任意一台机器中单机部署一个 OceanBase 数据库 | OceanBase 数据库 |
mini-single-with-obproxy-example.yaml/single-with-obproxy-example.yaml |
单机部署 + ODP 配置文件示例 | OceanBase 数据库、ODP |
mini-distributed-example.yaml/distributed-example.yaml |
分布式部署配置文件示例 | OceanBase 数据库 |
mini-distributed-with-obproxy-example.yaml/distributed-with-obproxy-example.yaml |
分布式部署 + ODP 配置文件示例 | OceanBase 数据库、ODP |
default-components-min.yaml/default-components.yaml |
分布式部署 + ODP + OCP Express 配置样例 | OceanBase 数据库、ODP、OBAgent、OCP Express |
all-components-min.yaml/all-components.yaml |
分布式部署全部组件 | OceanBase 数据库、ODP、OBAgent、OCP Express、Config Server、Prometheus、Grafana |
说明
若您计划部署 OCP Express,则无需部署 Prometheus 和 Grafana。
除上述配置文件之外,example 目录下有不同的文件夹存放不同的配置文件示例,以方便应对各种场景,具体内容如下。
autodeploy:该目录下的配置文件示例是为 obd cluster autodeploy 命令准备的,您只需修改配置文件示例中的 IP 和目录,OBD 会根据目标机器资源自动生成最大规格的完整配置并部署启动集群。
grafana:该目录下的配置文件示例是为部署 Grafana 准备的,您可使用这些配置文件示例单独部署 Grafana,或同时部署 Grafana 和 Prometheus。
ob-configserver:该目录下的配置文件示例是为部署 Config Server 准备的,您可使用这些配置文件示例单独部署 Config Server,或同时部署 OceanBase 数据库 + ODP + Config Server。
obagent:该目录下的配置文件示例是为部署 OBAgent 准备的,您可根据自己希望部署的 OBAgent 版本选择对应的配置文件示例部署 OBAgent。
obproxy:该目录下的配置文件示例是为部署 ODP 准备的,您可使用这些配置文件示例单独部署 ODP,或部署 OceanBase 数据库和 ODP。
oceanbase-3.x:该目录下的配置文件是适配 3.x 版本 OceanBase 数据库的配置文件示例。
ocp-express:该目录下的配置文件示例是为部署 OCP Express 准备的,您可使用这些配置文件示例单独部署 OCP Express。
prometheus:该目录下的配置文件示例是为部署 Prometheus 准备的,您可使用这些配置文件示例单独部署Prometheus,或同时部署 OceanBase 数据库、OBAgent 和 Prometheus。
配置文件格式
OBD 中的配置文件有其固定格式,下面讲解配置文件中不同模块的含义。
# Only need to configure when remote login is required
# user: # ssh 登录配置
# 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
oceanbase-ce: # 组件名,其下内容是对该组件的配置
servers: # 节点列表
- name: server1 # name 后可不填,不填默认节点名与 IP 相同,这里指该节点名为 server1
# Please don't use hostname, only IP can be supported
ip: 10.10.10.1
- name: server2
ip: 10.10.10.2
- name: server3
ip: 10.10.10.3
global: # 全局配置,同一组件中相同的配置可以写在这里
# 如果节点的配置中有与全局配置相同的配置项,则使用节点的配置
devname: eth0
......
# 省略具体配置项
# In this example, support multiple ob process in single node, so different process use different ports.
# If deploy ob cluster in multiple nodes, the port and path setting can be same.
server1: # 节点配置,这里是对 server1 节点的配置,也就是 10.10.10.1 这台服务器,节点的配置优先级是最高的。
mysql_port: 2881 # External port for OceanBase Database. The default value is 2881.
rpc_port: 2882 # Internal port for OceanBase Database. The default value is 2882.
# The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.
home_path: /home/admin/observer
zone: zone1
server2: # 节点配置,这里是对 server2 节点的配置,也就是 10.10.10.2 这台服务器。
mysql_port: 2881 # External port for OceanBase Database. The default value is 2881.
rpc_port: 2882 # Internal port for OceanBase Database. The default value is 2882.
# The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.
home_path: /home/admin/observer
zone: zone2
server3: # 节点配置,这里是对 server3 节点的配置,也就是 10.10.10.3 这台服务器。
mysql_port: 2881 # External port for OceanBase Database. The default value is 2881.
rpc_port: 2882 # Internal port for OceanBase Database. The default value is 2882.
# The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.
home_path: /home/admin/observer
zone: zone3
各模块介绍如下。
| 模块名 | 说明 |
|---|---|
| user | 配置用户信息,建议使用 admin 用户。该模块下需关注的配置项介绍如下:
注意 |
| oceanbase-ce | 组件名,其下的内容是对该组件的配置。 |
| servers | 节点信息,每台机器需要用 - name: 机器标识名(换行)ip: 机器 IP 指定,多个机器就指定多次,机器标识名不能重复。在机器 IP 不重复的情况下,也可以使用 - <ip> (换行)- <ip> 的格式指定,此时 - <ip> 的格式相当于 - name: 机器标识名(换行)ip: 机器 IP。 |
| global | 表示其下配置为全局配置,同一组件中相同的配置可以写在这里。如果节点的配置中有与全局配置相同的配置项,则使用节点中配置项的配置。 |
| server1 | 表示其下配置为节点配置,此处是以 server1 为例,您需修改为 servers 下配置的 name 名,这里表示对 10.10.10.1 这台服务器。
说明 |
配置项说明
本节介绍配置文件中的各个组件涉及到的配置项。
此处以 example/distributed-with-obproxy-example.yaml 文件中 oceanbase-ce 组件部分为例介绍部署 OceanBase 数据库时需注意的配置项。通过配置文件部署 OceanBase 数据库流程可参见 单机部署 OceanBase 数据库。
oceanbase-ce:
# version: 4.2.0.0
# package_hash: 1cbd1fde8c6d7695015265da09738478c97e0e2f908fca6745dc9cc531860e74
# tag: dev
servers:
- name: server1
# Please don't use hostname, only IP can be supported
ip: 10.10.10.1
- name: server2
ip: 10.10.10.2
- name: server3
ip: 10.10.10.3
global:
# Please set devname as the network adaptor's name whose ip is in the setting of severs.
# if set severs as "127.0.0.1", please set devname as "lo"
# if current ip is 192.168.1.10, and the ip's network adaptor's name is "eth0", please use "eth0"
# devname: eth0
# if current hardware's memory capacity is smaller than 50G, please use the setting of "mini-single-example.yaml" and do a small adjustment.
memory_limit: 64G # The maximum running memory for an observer
# The reserved system memory. system_memory is reserved for general tenants. The default value is 30G.
system_memory: 30G
datafile_size: 192G # Size of the data file.
datafile_next: 200G # the auto extend step. Please enter an capacity, such as 2G
datafile_maxsize: 1T # the auto extend max size. Please enter an capacity, such as 20G
log_disk_size: 192G # The size of disk space used by the clog files.
enable_syslog_wf: false # Print system logs whose levels are higher than WARNING to a separate log file. The default value is true.
max_syslog_file_count: 4 # The maximum number of reserved log files before enabling auto recycling. The default value is 0.
# observer cluster name, consistent with obproxy's cluster_name
appname: obcluster
root_password: ****** # root user password
proxyro_password: ****** # proxyro user password, consistent with obproxy's observer_sys_password, can be empty
# In this example , support multiple ob process in single node, so different process use different ports.
# If deploy ob cluster in multiple nodes, the port and path setting can be same.
server1:
# local_ip: 10.10.10.1
mysql_port: 2881 # External port for OceanBase Database. The default value is 2881. DO NOT change this value after the cluster is started.
rpc_port: 2882 # Internal port for OceanBase Database. The default value is 2882. DO NOT change this value after the cluster is started.
# The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.
home_path: /home/admin/observer
# The directory for data storage. The default value is $home_path/store.
# data_dir: /data
# The directory for clog, ilog, and slog. The default value is the same as the data_dir value.
# redo_dir: /redo
zone: zone1
server2:
# local_ip: 10.10.10.2
mysql_port: 2881 # External port for OceanBase Database. The default value is 2881. DO NOT change this value after the cluster is started.
rpc_port: 2882 # Internal port for OceanBase Database. The default value is 2882. DO NOT change this value after the cluster is started.
# The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.
home_path: /home/admin/observer
# The directory for data storage. The default value is $home_path/store.
# data_dir: /data
# The directory for clog, ilog, and slog. The default value is the same as the data_dir value.
# redo_dir: /redo
zone: zone2
server3:
# local_ip: 10.10.10.3
mysql_port: 2881 # External port for OceanBase Database. The default value is 2881. DO NOT change this value after the cluster is started.
rpc_port: 2882 # Internal port for OceanBase Database. The default value is 2882. DO NOT change this value after the cluster is started.
# The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.
home_path: /home/admin/observer
# The directory for data storage. The default value is $home_path/store.
# data_dir: /data
# The directory for clog, ilog, and slog. The default value is the same as the data_dir value.
# redo_dir: /redo
zone: zone3
您需关注的配置项如下表所示,详细的配置项介绍可参见 OceanBase 数据库配置项。
| 配置项 | 是否必选 | 默认值 | 说明 |
|---|---|---|---|
| version | 可选 | 默认部署最新版本 | 指定待部署组件版本,通常情况下不需要指定。 |
| package_hash | 可选 | 默认部署最新版本 | 指定待部署组件软件包 hash,通常情况下不需要指定。 |
| tag | 可选 | 无 | 指定待部署组件 tag,通常情况下不需要指定。当您为自己编译的 OceanBase 数据库安装包设置了 tag 时,可以使用 tag 来指定。 |
| servers | 必选 | 无 | 每台机器需要用 - name: 机器标识名(换行)ip: 机器 IP 指定,多个机器就指定多次,机器标识名不能重复。在机器 IP 不重复的情况下,也可以使用 - <ip> (换行)- <ip> 的格式指定,此时 - <ip> 的格式相当于 - name: 机器标识名(换行)ip: 机器 IP。 |
| devname | 可选 | 无 | 和 servers 里指定的 IP 对应的网卡,通过 ip addr 命令可以查看 IP 和网卡对应关系。
说明自 OceanBase 数据库 V4.2.0 版本起,不建议配置该配置项。 |
| local_ip | 可选 | 无 | 用于安装 OBServer 节点机器的 IP 地址。部署集群时,无需手动配置,OBD 会自动获取 servers 模块配置的 IP 地址为该配置项赋值。OceanBase 数据库部署会首先根据 local_ip 配置项进行配置,不再关注 devname 配置项。详细介绍可参见 《OceanBase 数据库》中 local_ip 一文。
说明
|
| memory_limit | 可选 | 0 | observer 进程能从环境中获取的最大内存,未配置的情况下以 memory_limit_percentage 配置项为准,配置项详细介绍请参考 memory_limit 和 memory_limit_percentage。 |
| system_memory | 可选 | 0M | 保留的系统内存,该参数值会占用 memory_limit 的内存,未配置的情况下 OceanBase 数据库会自适应。 |
| datafile_size | 可选 | 0 | 指定对应节点数据文件(block_file)大小,未配置的情况下以 datafile_disk_percentage 配置项为准,详细介绍请参见 datafile_size 和 datafile_disk_percentage。 |
| datafile_next | 可选 | 0 | 控制磁盘空间的增长步长,用于设置自动扩容,未配置的情况下若要开启自动扩容功能可参见 配置磁盘数据文件的动态扩容。 |
| datafile_maxsize | 可选 | 0 | 限制磁盘空间的最大可用上限,用于设置自动扩容,未配置的情况下若要开启自动扩容功能可参见 配置磁盘数据文件的动态扩容。 |
| log_disk_size | 可选 | 0 | 用于设置 Redo 日志磁盘的大小,未配置的情况下以log_disk_percentage 配置项为准,详细介绍请参考 log_disk_size 和 log_disk_percentage。 |
| enable_syslog_wf | 可选 | true | 设置是否把 WARN 以上级别的系统日志打印到一个单独的日志文件中。 |
| max_syslog_file_count | 可选 | 0 | 设置在回收日志文件之前可以容纳的日志文件数量。值为 0 时表示不自动清理。 |
| appname | 可选 |
|
OceanBase 集群名。 |
| mysql_port | 必选 | 2881 | 设置 SQL 服务协议端口号,默认为 2881。 |
| rpc_port | 必选 | 2882 | 设置远程访问的协议端口号,是 observer 进程跟其他节点进程之间的 RPC 通信端口,默认为 2882。 |
| home_path | 必选 | 无 | OceanBase 数据库安装路径。 |
| data_dir | 可选 | $home_path/store | 设置存储 SSTable 等数据的目录,建议配置为独立的磁盘。
说明 |
| redo_dir | 可选 | 默认与 data_dir 相同 |
部署 3.x 版本 OceanBase 数据库时,该配置项为 clog、ilog 和 slog 的目录。部署 4.x 版本 OceanBase 数据库时,该配置项为 clog 的目录。该配置项默认与 data_dir 值相同,建议配置为独立的磁盘。 |
| root_password | 可选 |
|
OceanBase 集群的超级管理员(root@sys)的密码,建议设置复杂的密码。使用 OBD V2.1.0 及之后版本时,未设置的情况下会自动生成随机字符串。 |
| proxyro_password | 可选 |
|
ODP 连接 OceanBase 集群使用的账户名(proxyro@sys)的密码。使用 OBD V2.1.0 及之后版本时,未设置的情况下会自动生成随机字符串。 |
| zone | 必选 | zone1 | OBServer 节点所在的 Zone 名字。 |
此处以 example/obproxy/obproxy-only-example.yaml 文件为例介绍部署 ODP 时需注意的配置项。
obproxy-ce:
servers:
- 10.10.10.4
global:
listen_port: 2883 # External port. The default value is 2883.
prometheus_listen_port: 2884 # The Prometheus port. The default value is 2884.
home_path: /home/admin/obproxy
# oceanbase root server list
# format: ip:mysql_port;ip:mysql_port. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.
rs_list: 10.10.10.1:2881;10.10.10.2:2881;10.10.10.3:2881
# obproxy_config_server_url: http://10.10.10.1:9999/services?Action=GetObProxyConfig
enable_cluster_checkout: false
# observer cluster name, consistent with oceanbase-ce's appname. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.
cluster_name: obcluster
skip_proxy_sys_private_check: true
enable_strict_kernel_release: false
obproxy_sys_password: ***** # obproxy sys user password, can be empty. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.
observer_sys_password: ***** # proxyro user password, consistent with oceanbase-ce's proxyro_password, can be empty. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.
您需关注的配置项如下表所示,详细的配置项介绍可参见 ODP 配置项。
| 配置项 | 是否必选 | 默认值 | 说明 |
|---|---|---|---|
| servers | 必选 | 无 | 每台机器需要用 - name: 机器标识名(换行)ip: 机器 IP 指定,多个机器就指定多次,机器标识名不能重复。在机器 IP 不重复的情况下,也可以使用 - <ip> (换行)- <ip> 的格式指定,此时 - <ip> 的格式相当于 - name: 机器标识名(换行)ip: 机器 IP。 |
| listen_port | 必选 | 2883 | ODP 监听端口,默认 2883。 |
| prometheus_listen_port | 必选 | 2884 | ODP prometheus 监听端口,默认 2884。 |
| home_path | 必选 | 无 | ODP 安装路径。 |
| rs_list | 可选 | 无 | OceanBase 集群的 OBServer 节点列表,格式为 ip:mysql_port;ip:mysql_port,使用 rs_list 配置部署的情况下您只可代理所配置的这一个集群。
注意
|
| obproxy_config_server_url | 可选 | 无 | Config Server 的 url,配置后可使用 ODP 代理 Config Server 中注册的所有集群。未部署 Config Server 且未配置依赖 ob-configserver 组件的情况下,您也可使用 rs_list 配置项。 |
| enable_cluster_checkout | 可选 | true | 控制是否需要校验 cluster name,开启后,ODP 会在登陆时发送集群名到 OBServer 节点进行检查。 |
| cluster_name | 可选 | 无 | 表示 ODP 可以代理的 OceanBase 集群的名字,当存在依赖项时,OBD 将会从依赖项 oceanbase-ce 中获取该值。 |
| enable_strict_kernel_release | 必选 | false | 是否需要校验 OS 内核,如果为 true,则ODP 仅支持 5u/6u/7u 版本的 RedHat。为 false 时不关心 Linux 内核版本的发布,ODP 可能不稳定。 |
| obproxy_sys_password | 可选 |
|
ODP 管理员账户(root@proxysys)的密码。使用 OBD V2.1.0 及之后版本时,未设置的情况下会自动生成随机字符串。 |
| observer_sys_password | 可选 | 配置依赖于 OceanBase 数据库组件时默认与 proxyro_password 相同,未配置依赖于 OceanBase 数据库组件时根据 OBD 版本不同有如下两种情况:
|
ODP 连接 OceanBase 集群使用的账户名(proxyro@sys)的密码,配置密码需和 OceanBase 数据库中 proxyro_password 的值相同。 |
此处以 example/obagent/obagent-only-example.yaml 文件为例介绍部署 OBAgent 时需注意的配置项。
obagent:
servers:
- name: server1
# Please don't use hostname, only IP can be supported
ip: 10.10.10.1
- name: server2
ip: 10.10.10.2
- name: server3
ip: 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.
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
server1:
# 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
server2:
# 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
server3:
# 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
您需关注的配置项如下表所示,详细的配置项介绍可参见 OBAgent 配置项。
| 配置项 | 是否必选 | 默认值 | 说明 |
|---|---|---|---|
| servers | 必选 | 无 | 每台机器需要用 - name: 机器标识名(换行)ip: 机器 IP 指定,多个机器就指定多次,机器标识名不能重复。在机器 IP 不重复的情况下,也可以使用 - <ip> (换行)- <ip> 的格式指定,此时 - <ip> 的格式相当于 - name: 机器标识名(换行)ip: 机器 IP。
注意 |
| home_path | 必选 | 无 | 组件的工作目录。 |
| 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 | 必选 | root | HTTP 服务认证密码。 |
| 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 名字。 |
此处以 example/ocp-express/ocp-express-only.yaml 文件为例介绍部署 OCP Express 时需注意的配置项。通过配置文件部署 OCP Express 流程可参见 使用命令行部署 OCP Express。
ocp-express:
servers:
- name: server1
ip: 10.10.10.1
global:
# The working directory for ocp express. ocp express is started under this directory. This is a required field.
home_path: /home/admin/ocp-express
log_dir: /home/admin/ocp-express/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> # the pass of oceanbase cluster. Refer to the configuration item cluster_id of oceanbase
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
# logging_file_max_history: 1 # The maximum of retention days the log archive log files to keep. The default value is unlimited
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
withRootServer: true # Is the oceanbase server a root server of cluster.
agentMgrPort: 8089 # The port of obagent manager process
agentMonPort: 8088 # The port of obagent monitor process
您需关注的配置项如下表所示,详细的配置项介绍可参见 OCP Express 配置项。
| 配置项 | 是否必选 | 默认值 | 说明 |
|---|---|---|---|
| servers | 必选 | 无 | 每台机器需要用 - name: 机器标识名(换行)ip: 机器 IP 指定,多个机器就指定多次,机器标识名不能重复。在机器 IP 不重复的情况下,也可以使用 - <ip> (换行)- <ip> 的格式指定,此时 - <ip> 的格式相当于 - name: 机器标识名(换行)ip: 机器 IP。 |
| home_path | 必选 | 无 | 组件的工作目录。 |
| log_dir | 可选 | {home_path}/log | OCP Express 服务器的日志目录,默认值为 home_path 参数下的 log。 |
| memory_size | 必选 | 无 | OCP Express 服务器的内存容量,推荐算法为:memory_size = 512M +(期望的节点数 * 期望的租户数)* 60MB 期望的租户数需要包含 sys 和 ocp meta 租户本身。 |
| jdbc_url | 可选 | 无 | 连接 meta 租户的 JDBC 连接字符串,请确保连接串中使用到的数据库已创建。当 OCP Express 单独部署时该配置项为必选项。 |
| jdbc_username | 可选 | 无 | 连接 meta 租户的用户名,请确保该用户已创建。当 OCP Express 单独部署时该配置项为必选项。
说明: |
| jdbc_password | 必选 | 连接 meta 租户的用户密码。 | |
| port | 必选 | 8180 | 访问 OCP Express 的 HTTP 端口。 |
| cluster_name | 可选 | obcluster | OceanBase 集群的集群名称,需和 oceanbase-ce 组件中的 appname 配置项相同。当 OCP Express 单独部署时该配置项为必选项。 |
| ob_cluster_id | 可选 | 无 | OceanBase 集群的集群 ID,需和 oceanbase-ce 组件中的 cluster_id 配置项相同。当 OCP Express 单独部署时该配置项为必选项。 |
| root_sys_password | 可选 | 无 | OceanBase 集群中 root@sys 用户的密码。当 OCP Express 单独部署时该配置项为必选项。 |
| agent_username | 必选 | 无 | OBAgent 的用户名。 |
| agent_password | 必选 | 无 | OBAgent 的密码。 |
| logging_file_total_size_cap | 必选 | 1GB | 日志文件总大小,默认为 1GB。
注意: |
| 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 中实际设置的端口进行修改。 |
此处以 example/ob-configserver/ob-configserver-only-example.yaml 文件为例介绍部署 Config Server 时需注意的配置项。通过配置文件部署 Config Server 流程可参见 使用命令行部署 Config Server。
ob-configserver:
servers:
- 127.0.0.1
global:
listen_port: 8080 # The port of ob-configserver web
# server_ip: 0.0.0.0 # Listen to the ob-configserver server IP。When you want to listen to the specified IP address,use it.
home_path: /home/admin/ob-configserver # The working directory for prometheus. ob-configserver is started under this directory. This is a required field.
## log config
# log_level: info # Log printing level of ob-configserver。The default value is `info`
# log_maxsize: 30 # The total size of manager ob-configserver.Log size is measured in Megabytes.The default value is 30
# log_maxage:7 # The days of manager expired ob-configserver.Log retention days. The default value is 7
# log_maxbackups: 10 #The number of manager expired ob-configserver.Log. The default value is 10
# log_localtime: true # Switch of ob-configserver.Log naming with localtime. The default value is true
# log_compress: true # Compress ob-configserver.Log switch. The default value is true
## vip config, configserver will generate url with vip_address and port and return it to the client
## do not use some random value that can't be connected
# vip_address: "10.10.10.1"
# vip_port:8080
## storage config
# storage:
## database type, support sqlite3 or mysql
## sqlite3 Usage:
# database_type: sqlite3
# connection_url: "/home/admin/ob-configserver/.data.db?cache=shared&_fk=1" # connection_url can be empty When database_type used sqlite3
## mysql Usage:
# database_type: mysql
# connection_url: "user:password@tcp(ip:port)/metadb?parseTime=true"
您需关注的配置项如下表所示,详细的配置项介绍可参见 Config Server 配置项。
| 配置项 | 是否必选 | 默认值 | 说明 |
|---|---|---|---|
| servers | 必选 | 无 | 每台机器需要用 - name: 机器标识名(换行)ip: 机器 IP 指定,多个机器就指定多次,机器标识名不能重复。在机器 IP 不重复的情况下,也可以使用 - <ip> (换行)- <ip> 的格式指定,此时 - <ip> 的格式相当于 - name: 机器标识名(换行)ip: 机器 IP。 |
| listen_port | 必选 | 8080 | obconfigserver 服务监听的端口。 |
| server_ip | 必选 | 0.0.0.0 | 监听访问服务的 IP,只监听指定的 IP,如果有白名单需求,可以修改此项。 |
| home_path | 必选 | 无 | 组件的工作目录。 |
| log_level | 必选 | info | Config Server 打印的日志级别,默认为 INFO 级别。Config Server 的日志级别从低到高依次为 Debug(调试)、Info(信息)、Warn(告警)、Error(错误)、Fatal(致命)。 |
| log_maxsize | 必选 | 30 | Config Server 日志的大小,单位 MB,默认值为 30。 |
| log_maxage | 必选 | 7 | Config Server 日志保留过期文件最长时间间隔,默认值 7 天。 |
| log_maxbackups | 必选 | 10 | Config Server 最多能保留的过期日志个数。 |
| log_localtime | 必选 | true | 控制是否使用本地时间来命名日志,默认为 true。 |
| log_compress | 必选 | true | 控制是否开启滚动日志压缩,默认为 true。 |
| vip_address | 可选 | 无 | VIP 的 IP 地址,仅在使用 VIP 时配置。 |
| vip_port | 可选 | 无 | VIP 的端口号,仅在使用 VIP 时配置。 |
| database_type | 必选 | sqlite3 | 元数据库的数据库类型,可取值为 mysql 或 sqlite3,取值为 mysql 时可以选择使用 MySQL 数据库或 OceanBase 数据库作为 Config Server 的元数据库。 |
| connection_url | 可选 | $home_path/.data.db?cache=shared&_fk=1 | 元数据库的路径,当 database_type 取值为 mysql 时,该配置项为必填项。当 database_type 取值为 sqlite3 时,若不配置则使用默认值;若您自行配置,请填写绝对路径。 |
此处以 example/prometheus/prometheus-only-example.yaml 文件为例介绍部署 Prometheus 时需注意的配置项。通过配置文件部署 Prometheus 流程可参见 为现有集群增加白屏监控。
prometheus:
servers:
- 10.10.10.4
global:
# The working directory for prometheus. prometheus is started under this directory. This is a required field.
home_path: /home/admin/prometheus
address: 0.0.0.0 # The ip address to bind to. Along with port, corresponds to the `web.listen-address` parameter.
port: 9090 # The http port to use. Along with address, corresponds to the `web.listen-address` parameter.
enable_lifecycle: true # Enable shutdown and reload via HTTP request. Corresponds to the `web.enable-lifecycle` parameter.
data_dir: /home/admin/prometheus/data # Base path for metrics storage. Corresponds to the `storage.tsdb.path` parameter.
# basic_auth_users: # Usernames and passwords that have full access to the web server via basic authentication. Corresponds to the `basic_auth_users` parameter.
# <username>: <password> # The format of `basic_auth_users` : the key is the user name and the value is the password.
# web_config: # Content of Prometheus web service config file. The format is consistent with the file. However, `basic_auth_users` cannot be set in it. Please set `basic_auth_users` above if needed. Corresponds to the `web.config.file` parameter.
# tls_server_config:
# # Certificate and key files for server to use to authenticate to client.
# cert_file: <filename>
# key_file: <filename>
config: # Configuration of the Prometheus service. The format is consistent with the Prometheus config file. Corresponds to the `config.file` parameter.
rule_files:
- rules/*rules.yaml
scrape_configs:
- job_name: prometheus
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- localhost:9090
- job_name: node
basic_auth:
username: ********
password: ********
metrics_path: /metrics/node/host
scheme: http
file_sd_configs: # Set the targets to be collected by reading local files. The example is to collect targets corresponding to all yaml files in the 'targets' directory under $home_path.
- files:
- 'targets/*.yaml'
- job_name: ob_basic
basic_auth:
username: ********
password: ********
metrics_path: /metrics/ob/basic
scheme: http
file_sd_configs:
- files:
- 'targets/*.yaml'
- job_name: ob_extra
basic_auth:
username: ********
password: ********
metrics_path: /metrics/ob/extra
scheme: http
file_sd_configs:
- files:
- 'targets/*.yaml'
- job_name: agent
basic_auth:
username: **********
password: ********
metrics_path: /metrics/stat
scheme: http
file_sd_configs:
- files:
- 'targets/*.yaml'
# additional_parameters: # Additional parameters for Prometheus service, among which `web.listen-address`, `web.enable-lifecycle`, `storage.tsdb.path`, `config.file` and `web.config.file` cannot be set. Please set them in the corresponding configuration above if needed.
# - log.level: debug
您需关注的配置项如下表所示,详细的配置项介绍可参见 Prometheus 配置项。
| 配置项 | 是否必选 | 默认值 | 说明 |
|---|---|---|---|
| servers | 必选 | 无 | 每台机器需要用 - name: 机器标识名(换行)ip: 机器 IP 指定,多个机器就指定多次,机器标识名不能重复。在机器 IP 不重复的情况下,也可以使用 - <ip> (换行)- <ip> 的格式指定,此时 - <ip> 的格式相当于 - name: 机器标识名(换行)ip: 机器 IP。 |
| home_path | 必选 | 无 | 组件的工作目录。 |
| address | 必选 | 0.0.0.0 | Prometheus 监听地址。 |
| port | 必选 | 9090 | Prometheus 监听端口。 |
| enable_lifecycle | 必选 | true | 控制是否启用通过 HTTP 请求关闭和重新加载的功能。 |
| data_dir | 可选 | 无 | 指标存储的基本路径。 |
| basic_auth_users | 可选 | 无 | Prometheus Web 服务的认证信息,键名为用户名,值为密码。 |
| web_config | 可选 | 无 | Prometheus 的 Web 服务配置,可在其下配置服务器用于向客户端进行身份验证的证书和密钥文件。 |
| config | 可选 | 无 | Prometheus 的配置,格式与 Prometheus 配置文件一致。对应于 config.file 参数。 |
| additional_parameters | 可选 | 无 | Prometheus 启动参数。 |
此处以 example/grafana/grafana-only-example.yaml 文件为例介绍部署 Grafana 时需注意的配置项。通过配置文件部署 Grafana 流程可参见 为现有集群增加白屏监控。
grafana:
servers:
- 10.10.10.4
global:
home_path: /home/admin/grafana
login_password: ******** # Grafana login password.
data_dir: # Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used).$data_dir can be empty. The default value is $home_path/data.
logs_dir: # Directory where grafana can store logs, can be empty. The default value is $data_dir/log.
plugins_dir: # Directory where grafana will automatically scan and look for plugins, can be empty. The default value is $data_dir/plugins.
provisioning_dir: # folder that contains provisioning config files that grafana will apply on startup and while running, can be empty. The default value is $home_path/conf/provisioning.
temp_data_lifetime: 24h # How long temporary images in data directory should be kept. Supported modifiers h (hours), m (minutes), Use 0 to never clean up temporary files, can be empty. The default value is 24h.
log_max_days: 7 # Expired days of log file(delete after max days), can be empty. The default value is 7.
# domain: # The public facing domain name used to access grafana from a browser, can be empty. The default value is $server.ip.
# port: # The http port to use, can be empty. The default value is 3000.
# # list of datasources to insert/update depending on what's available in the database, can be empty.
# # For more parameter settings, please refer to https://grafana.com/docs/grafana/latest/administration/provisioning/#datasources
# datasources:
# name: # name of the datasource. Required and should not be 'OB-Prometheus'
# type: # datasource type. Required
# access: # access mode. direct or proxy. Required
# url: # the url of datasource
# list of dashboards providers that load dashboards into Grafana from the local filesystem, can be empty.
# For more information, please refer to https://grafana.com/docs/grafana/latest/administration/provisioning/#dashboards
# providers:
# name: # an unique provider name. Required and should not be 'OceanBase Metrics'
# type: # provider type. Default to 'file'
# options:
# path: # path to dashboard files on disk. Required when using the 'file' type
# # customize your Grafana instance by adding/modifying the custom configuration as follows
# # for more information, please refer to https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#configure-grafana
# # Here, setting parameters is required for format conversion.
# # For example, if the original grafana configuration format is
# #
# # [section1.section2]
# # key1 = value1
# # key2 = value2
# #
# # Then when writing the configuration below, you need to write it as
# #
# # section1:
# # section2:
# # key1: value1
# # key2: value2
# #
# # Here we only list one item, because there are more than 500 items. Please add them according to your own needs.
# customize_config:
# # original grafana configuration format is
# # [server]
# # protocol = http
# server:
# protocol: http
您需关注的配置项如下表所示,详细的配置项介绍可参见 Grafana 配置项。
| 配置项 | 是否必选 | 默认值 | 说明 |
|---|---|---|---|
| servers | 必选 | 无 | 每台机器需要用 - name: 机器标识名(换行)ip: 机器 IP 指定,多个机器就指定多次,机器标识名不能重复。在机器 IP 不重复的情况下,也可以使用 - <ip> (换行)- <ip> 的格式指定,此时 - <ip> 的格式相当于 - name: 机器标识名(换行)ip: 机器 IP。 |
| home_path | 必选 | 无 | 组件的工作目录。 |
| login_password | 必选 |
|
Grafana 登录密码。 |
| data_dir | 可选 | $home_path/data | Grafana 用来存储 sqlite3、临时文件、会话等路径。 |
| logs_dir | 可选 | $data_dir/log | Grafana 用来存放日志的目录。 |
| plugins_dir | 可选 | $data_dir/plugins | Grafana 自动扫描并查找插件的目录。 |
| provisioning_dir | 可选 | $home_path/conf/provisioning | 包含 Grafana 将在启动和运行时应用的配置文件的文件夹。 |
| temp_data_lifetime | 可选 | 24h | Grafana 数据目录中的临时图像保留时间。支持的单位有 h(小时)、m(分钟),配置为 0 时表示从不清理临时文件。 |
| log_max_days | 可选 | 7 | 日志文件的过期天数阈值,日志文件存放天数达到该值后删除对应日志文件。 |