# 配置文件说明

OBD 中的配置文件有其固定格式，下面结合示例讲解配置文件中不同模块的含义。

```yaml
# 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:  # 组件名，其下内容是对该组件的配置
  # version: 3.1.3    # 指定组件版本，通常情况下不需要指定
  # package_hash: 589c4f8ed2662835148a95d5c1b46a07e36c2d346804791364a757aef4f7b60d  # 指定组件 hash，通常情况下不需要指定
  # tag: dev    # 指定组件 tag，通常情况下不需要指定
  servers:  # 节点列表
    - name: z1  # name 后可不填，不填默认节点名与 IP 相同，这里指该节点名为 z1
      # Please don't use hostname, only IP can be supported
      ip: 192.168.1.2
    - name: z2
      ip: 192.168.1.3
    - name: z3
      ip: 192.168.1.4
  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
    datafile_disk_percentage: 20
    syslog_level: INFO
    enable_syslog_wf: false
    enable_syslog_recycle: true
    max_syslog_file_count: 4
    cluster_id: 1
    # observer cluster name, consistent with obproxy's cluster_name    
    appname: obcluster
    # root_password: # root user password, can be empty
    # proxyro_password: # proxyro user pasword, 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.
  z1:  # 节点配置，这里是对 z1 节点的配置，也就是 192.168.1.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: /root/observer
    zone: zone1
  z2:  # 节点配置，这里是对 z2 节点的配置，也就是 192.168.1.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: /root/observer
    zone: zone2
  z3:   # 节点配置，这里是对 z3 节点的配置，也就是 192.168.1.4 这台服务器。
    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: /root/observer
    zone: zone3
obproxy-ce:  # 组件名，其下内容是对组件 obproxy 的配置
  # version: 3.2.3    # 指定组件版本，通常情况下不需要指定
  # package_hash: 73cccf4d05508de0950ad1164aec03003c4ddbe1415530e031ac8b6469815fea  # 指定组件 hash，通常情况下不需要指定
  # tag: dev    # 指定组件 tag，通常情况下不需要指定
  servers:
    - 192.168.1.5
  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: /root/obproxy
    # oceanbase root server list
    # format: ip:mysql_port;ip:mysql_port
    rs_list: 192.168.1.2:2881;192.168.1.3:2881;192.168.1.4:2881
    enable_cluster_checkout: false
    # observer cluster name, consistent with oceanbase-ce's appname
    cluster_name: obcluster
    # obproxy_sys_password: # obproxy sys user password, can be empty
    # observer_sys_password: # proxyro user pasword, consistent with oceanbase-ce's proxyro_password, can be empty
```
