OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Deployer

V3.2.0Community Edition

  • What is obd
  • Quick Start
    • Install obd
    • Quickly deploy OceanBase Database
    • Quickly deploy OCP
  • obd Command
    • Quick deployment command
    • Cluster commands
    • Mirror and repository commands
    • Testing commands
    • Tool commands
    • obdiag commands
    • Binlog commands
    • Host commands
    • License commands
    • Password commands
    • Telemetry commands
  • User Guide
    • Overview
    • Deploy through GUI
      • GUI operation overview
      • Mode configuration rules
      • Deploy an OceanBase cluster on the GUI
      • Deploy OCP through the GUI
      • Modify components on the GUI
      • Upgrade OCP on the GUI
    • Deploy through CLI
      • Configuration files
      • Deploy Component
        • Deploy OceanBase Database on a single OBServer node
        • Deploy OCP Express by using commands
        • Deploy and use obconfigserver
        • Deploy the obbinlog
        • Deploy oblogproxy by using the CLI
        • Deploy OCP by using commands
      • Manage Cluster
        • Physical Standby Database
          • Deploy primary and standby tenants by using obd
          • Switch the roles of tenants and decouple a standby tenant from the primary tenant
        • Scale out a cluster and change cluster components
        • Performance test
        • Cluster diagnotistics
        • Add GUI-based monitoring for an existing cluster
      • Takeover Cluster
        • Use OCP to take over a cluster deployed by obd
        • Use obd to take over a cluster
      • Upgrade Component
        • Upgrade OceanBase Database
        • Upgrade ODP
        • Upgrade OCP Express
      • Backup and restore
  • Upgrade obd
  • FAQ
  • Error codes
  • Release Notes
    • Version rules
    • V3.2
      • OceanBase Deployer V3.2.0
    • V3.1
      • OceanBase Deployer V3.1.2
      • OceanBase Deployer V3.1.1
      • OceanBase Deployer V3.1.0
    • V3.0
      • OceanBase Deployer V3.0.1
      • OceanBase Deployer V3.0.0
    • V2.10
      • OceanBase Deployer V2.10.1
      • OceanBase Deployer V2.10.0
    • V2.9
      • OceanBase Deployer V2.9.2
      • OceanBase Deployer V2.9.1
      • OceanBase Deployer V2.9.0
    • V2.8
      • OceanBase Deployer V2.8.0
    • V2.7
      • OceanBase Deployer V2.7.0
    • V2.6
      • OceanBase Deployer V2.6.2
      • OceanBase Deployer V2.6.1
      • OceanBase Deployer V2.6.0
    • V2.5
      • OceanBase Deployer V2.5.0
    • V2.4
      • OceanBase Deployer V2.4.0
    • V2.3
      • OceanBase Deployer V2.3.1
      • OceanBase Deployer V2.3.0
    • V2.2
      • OceanBase Deployer V2.2.0
    • V2.1
      • OceanBase Deployer V2.1.1
      • OceanBase Deployer V2.1.0
    • V2.0
      • OceanBase Deployer V2.0.1
      • OceanBase Deployer V2.0.0
    • V1.6
      • OceanBase Deployer V1.6.2
      • OceanBase Deployer V1.6.1
      • OceanBase Deployer V1.6.0
    • V1.5
      • OceanBase Deployer V1.5.0
    • V1.4
      • OceanBase Deployer V1.4.0
    • V1.3
      • OceanBase Deployer V1.3.3
      • OceanBase Deployer V1.3.2
      • OceanBase Deployer V1.3.0
    • V1.2
      • OceanBase Deployer V1.2.1
      • OceanBase Deployer V1.2.0

Download PDF

What is obd Install obd Quickly deploy OceanBase Database Quickly deploy OCP Quick deployment command Cluster commands Mirror and repository commands Testing commands Tool commands obdiag commands Binlog commands Host commands License commands Password commands Telemetry commands Overview GUI operation overview Mode configuration rules Deploy an OceanBase cluster on the GUI Deploy OCP through the GUI Modify components on the GUI Upgrade OCP on the GUI Configuration files Backup and restore Upgrade obd FAQ Error codes Version rules OceanBase Deployer V3.2.0 OceanBase Deployer V3.1.2 OceanBase Deployer V3.1.1 OceanBase Deployer V3.1.0 OceanBase Deployer V3.0.1 OceanBase Deployer V3.0.0 OceanBase Deployer V2.10.1 OceanBase Deployer V2.10.0 OceanBase Deployer V2.9.2 OceanBase Deployer V2.9.1 OceanBase Deployer V2.9.0 OceanBase Deployer V2.8.0 OceanBase Deployer V2.7.0 OceanBase Deployer V2.6.2 OceanBase Deployer V2.6.1 OceanBase Deployer V2.6.0 OceanBase Deployer V2.5.0 OceanBase Deployer V2.4.0 OceanBase Deployer V2.3.1 OceanBase Deployer V2.3.0 OceanBase Deployer V2.2.0 OceanBase Deployer V2.1.1 OceanBase Deployer V2.1.0 OceanBase Deployer V2.0.1 OceanBase Deployer V2.0.0 OceanBase Deployer V1.6.2 OceanBase Deployer V1.6.1 OceanBase Deployer V1.6.0 OceanBase Deployer V1.5.0 OceanBase Deployer V1.4.0 OceanBase Deployer V1.3.3 OceanBase Deployer V1.3.2 OceanBase Deployer V1.3.0 OceanBase Deployer V1.2.1 OceanBase Deployer V1.2.0
OceanBase logo

The Unified Distributed Database for the AI Era.

Follow Us
Products
OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
Resources
DocsBlogLive DemosTraining & Certification
Company
About OceanBaseTrust CenterLegalPartnerContact Us
Follow Us

© OceanBase 2026. All rights reserved

Cloud Service AgreementPrivacy PolicySecurity
Contact Us
Document Feedback
  1. Documentation Center
  2. OceanBase Deployer
  3. V3.2.0
iconOceanBase Deployer
V 3.2.0Community Edition
Community Edition
  • V 3.2.1
  • V 3.2.0
  • V 3.1.0
  • V 3.0.0
  • V 2.10.1
  • V 2.10.0
  • V 2.9.0
  • V 2.8.0
  • V 2.7.0
  • V 2.6.0
  • V 2.5.0
  • V 2.4.0
  • V 2.3.1
  • V 2.3.0
  • V 2.2.0
  • V 2.1.0
  • V 2.0.0
  • V 1.6.1

Deploy and use obconfigserver

Last Updated:2026-04-14 09:56:10  Updated
share
What is on this page
Components
Prerequisites
Procedure
Use obconfigserver
Register an OceanBase cluster with obconfigserver
View registration information in obconfigserver
Start ODP
Delete the registration information of a cluster
FAQ
What do I do if the error prepared statement not supported is returned when obconfigserver is started?
What do I do if an error is returned when I use ODP to connect to a cluster registered with obconfigserver?

folded

share

You can deploy obconfigserver separately or together with OceanBase Database and OceanBase Database Proxy (ODP). This topic describes several common deployment methods.

Components

  • oceanbase-ce

    OceanBase Database Community Edition. OceanBase Database is an enterprise-level, native distributed database independently developed by the OceanBase team. For more information, see OceanBase Database documentation.

  • obproxy-ce

    ODP, also known as OBProxy, which is a dedicated proxy service designed for OceanBase Database. For more information, see ODP documentation.

  • obconfigserver

    obconfigserver, which allows you to register, store, and query metadata of OceanBase Database. For more information, see ob-configserver.

Prerequisites

Make sure that the following conditions are met:

  • To deploy obconfigserver directly, ensure OceanBase Deployer (obd) is at least V2.3.0. Adding obconfigserver to a cluster requires obd V2.5.0 or later. We recommend that you install the latest version. For more information, see Install obd.

    Note

    We recommend that you download the OceanBase All in One package for deployment. The package provides all required components (except obbinlog) of the recommended versions, and the components have passed adaptation tests.

  • Your server can connect to the Internet, or the local image repository of obd contains the installation packages required for deployment.

    You can run the obd mirror list local command to query the installation packages in the local image repository. If obd is installed by using the OceanBase All in One package, the local image repository contains all installation packages required for deployment by default.

Procedure

This section describes how to deploy obconfigserver by using obd commands in different scenarios. You can select a deployment method as needed.

  • Deploy obconfigserver together with OceanBase Database and ODP

    You can deploy obconfigserver, OceanBase Database, and ODP by using the same configuration file. After deployment, the OceanBase cluster will be registered with obconfigserver and ODP will start by using ConfigUrl. In other words, you can use ODP to connect to any clusters registered with obconfigserver.

    Notice

    If you use ODP to connect to OceanBase Database, make sure that the observer_sys_password value in ODP is consistent with the password of the proxyro@sys user in OceanBase Database. Otherwise, an error occurs during connection.

  • Add obconfigserver to a cluster

    You can run the obd cluster component add command to add obconfigserver to an OceanBase cluster managed by obd. Existing ODP in the cluster will start by using the ConfigUrl of obconfigserver after this command is executed and ODP restarts.

  • Deploy obconfigserver only

    You can deploy obconfigserver separately. After the deployment, you need to register the OceanBase cluster with obconfigserver and modify the obproxy_config_server_url parameter of ODP. For more information, see Use obconfigserver.

Deploy obconfigserver together with OceanBase Database and ODP
Add obconfigserver to a cluster
Deploy obconfigserver only

Step 1: Modify the configuration file

Create a configuration file named config.yaml. The parameters for the components in the configuration file are described as follows:

  1. User configuration

    ## 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 specifies the username of the account used to log in to the target server. Make sure that this account has the write permission on home_path. password and key_file are used for user verification. Generally, you need to specify only one of them.

    Notice

    After you specify the path of the key, comment out or delete the password parameter if your key does not require a password. Otherwise, the value of the password parameter will be taken as the password of the key and used for login, leading to a login verification failure.

  2. OceanBase Database configuration

    oceanbase-ce:
      depends:
        - ob-configserver
      servers:
        - name: server1
          # Please don't use hostname, only IP can be supported
          ip: 10.10.10.2
        - name: server2
          ip: 10.10.10.3
        - name: server3
          ip: 10.10.10.4
      global:
        # 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
        # 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
        cluster_id: 1
        # please set memory limit to a suitable value which is matching resource.
        memory_limit: 6G # The maximum running memory for an observer
        system_memory: 1G # The reserved system memory. system_memory is reserved for general tenants. The default value is 30G.
        datafile_size: 20G # Size of the data file.
        log_disk_size: 15G # The size of disk space used by the clog files.
        cpu_count: 16
        scenario: htap
        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.
        obshell_port: 2886
        production_mode: false
        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.
        # Cluster name for OceanBase Database. The default value is obcluster. When you deploy OceanBase Database and obproxy, this value must be the same as the cluster_name for obproxy.
        appname: test
        root_password: ****** # root user password
        proxyro_password: ****** # proxyro user password, consistent with obproxy's observer_sys_password, can be empty
      server1:
        zone: zone1
      server2:
        zone: zone2
      server3:
        zone: zone3
    

    For more information about the parameters in configuration files, see the Parameters section in Configuration files. The key parameters are described as follows:

    • depends: You must configure the oceanbase-ce component to depend on the ob-configserver component. Otherwise, your OceanBase cluster cannot be registered with obconfigserver.

    • appname: It specifies the name of your OceanBase cluster. If you do not specify this parameter, your cluster cannot be registered with obconfigserver.

    • scenario: If you do not specify the scenario parameter in the configuration file when you deploy OceanBase Database V4.3.0 or later, obd provides interactive options for you to select a load type.

  3. ODP configuration

    obproxy-ce:
      # Set dependent components for the component.
      # When the associated configurations are not done, obd will automatically get the these configurations from the dependent components.
      depends:
        - oceanbase-ce
        - ob-configserver
      servers:
        - 10.10.10.5
      global:
        listen_port: 2883 # External port. The default value is 2883.
        prometheus_listen_port: 2884 # The Prometheus port. The default value is 2884.
        rpc_listen_port: 2885
        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
        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.
    

    For more information about the parameters in configuration files, see the Parameters section in Configuration files. Do not configure the rs_list parameter. Otherwise, ODP cannot obtain information about clusters registered with obconfigserver.

  4. obconfigserver configuration

    ob-configserver:
      servers:
        - 10.10.10.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:
          # database_type: sqlite3
          # connection_url: "/home/admin/ob-configserver/.data.db?cache=shared&_fk=1"
    
          # mysql:
          # database_type: mysql
          # connection_url: "$user:$password@tcp($IP:$PORT)/$metadb?parseTime=true"
    

    For parameters that are commented out in the configuration file, their default values are used. You can also uncomment the parameters and specify other values for them. The key parameters are described as follows:

    • server_ip: the access allowlist of obconfigserver. The default value is 0.0.0.0, which indicates that access from all IP addresses of the server where obconfigserver resides is allowed.

    • vip_address and vip_port: the IP address and port used for load balancing. If multiple nodes are configured in servers, load balancing is required. After you configure load balancing, specify the IP address and port used for load balancing in the configuration file.

    • database_type: the database type. Valid values are sqlite3 and mysql. The default value is sqlite3. The recommended value is mysql.

    • connection_url: the URL for connecting to the database. The value of connection_url is $home_path/.data.db?cache=shared&_fk=1 by default when the database type is sqlite3, and can be a URL for connecting to an OceanBase database or a MySQL database when the database type is mysql. The specified database user must have the privileges to perform DDL and DML operations on the database corresponding to the URL. If OceanBase Database is used, do not use oceanbase as the database name. Otherwise, a message prompting no privileges is displayed.

Step 2: Start obconfigserver

  1. Deploy obconfigserver.

    [admin@obtest ~]$ obd cluster deploy test -c config.yaml
    

    Here is an example of deploying the test cluster by using the config.yaml configuration file. You must change the cluster name and configuration file name based on the actual situation.

  2. Start obconfigserver.

    [admin@obtest ~]$ obd cluster start test
    

    The output is as follows, where you can see the access address of obconfigserver.

    +-----------------------------------------------------------+
    |                      ob-configserver                      |
    +---------+------+---------------+----------+--------+------+
    | server  | port | vip_address   | vip_port | status | pid  |
    +---------+------+---------------+----------+--------+------+
    | 0.0.0.0 | 8080 | 10.10.10.1    | 8080     | active | 6270 |
    +---------+------+---------------+----------+--------+------+
    curl -s 'http://10.10.10.1:8080/services?Action=GetObProxyConfig'
    Wait for observer init ok
    +-------------------------------------------------+
    |                 oceanbase-ce                    |
    +---------------+---------+------+-------+--------+
    | ip            | version | port | zone  | status |
    +---------------+---------+------+-------+--------+
    | 10.10.10.2    | 4.3.5.0 | 2881 | zone1 | ACTIVE |
    +---------------+---------+------+-------+--------+
    | 10.10.10.3    | 4.3.5.0 | 2881 | zone2 | ACTIVE |
    +---------------+---------+------+-------+--------+
    | 10.10.10.4    | 4.3.5.0 | 2881 | zone3 | ACTIVE |
    +---------------+---------+------+-------+--------+
    obclient -h10.10.10.2 -P2881 -uroot -p'********' -Doceanbase -A
    
    +----------------------------------------------------------------+
    |                           obproxy-ce                           |
    +------------+------+-----------------+-----------------+--------+
    | ip         | port | prometheus_port | rpc_listen_port | status |
    +------------+------+-----------------+-----------------+--------+
    | 10.10.10.5 | 2883 | 2884            | 2885            | active |
    +------------+------+-----------------+-----------------+--------+
    obclient -h10.10.10.5 -P2883 -uroot@proxysys -p'********' -Doceanbase -A
    
  1. Create a configuration file.

    When you add obconfigserver to an OceanBase cluster managed by obd, you only need to configure the information about the ob-configserver component in the created configuration file. Here is an example:

    ob-configserver:
      servers:
        - 10.10.10.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:
          # database_type: sqlite3
          # connection_url: "/home/admin/ob-configserver/.data.db?cache=shared&_fk=1"
    
          # mysql:
          # database_type: mysql
          # connection_url: "$user:$password@tcp($IP:$PORT)/$metadb?parseTime=true"
    

    For parameters that are commented out in the configuration file, their default values are used. You can also uncomment the parameters and specify other values for them. The key parameters are described as follows:

    • server_ip: the access allowlist of obconfigserver. The default value is 0.0.0.0, which indicates that access from all IP addresses of the server where obconfigserver resides is allowed.

    • vip_address and vip_port: the IP address and port used for load balancing. If multiple nodes are configured in servers, load balancing is required. After you configure load balancing, specify the IP address and port used for load balancing in the configuration file.

    • database_type: the database type. Valid values are sqlite3 and mysql. The default value is sqlite3. The recommended value is mysql.

    • connection_url: the URL for connecting to the database. The value of connection_url is $home_path/.data.db?cache=shared&_fk=1 by default when the database type is sqlite3, and can be a URL for connecting to an OceanBase database or a MySQL database when the database type is mysql. The specified database user must have the privileges to perform DDL and DML operations on the database corresponding to the URL. If OceanBase Database is used, do not use oceanbase as the database name. Otherwise, a message prompting no privileges is displayed.

  2. Run the following command to add the component:

    obd cluster component add test1 -c configserver.yaml
    

    In this example, the target OceanBase cluster is named test1 and the configuration file for adding obconfigserver is named configserver.yaml. In practice, use the actual names. You can run the obd cluster list command to query the cluster name, which is the value of the Name column in the output.

    The output is as follows:

    Connect to ob-configserver ok
    +-----------------------------------------------------------------+
    |                         ob-configserver                         |
    +---------------+------+---------------+----------+--------+------+
    | server        | port | vip_address   | vip_port | status | pid  |
    +---------------+------+---------------+----------+--------+------+
    | 10.10.10.1    | 8080 | 10.10.10.1    | 8080     | active | 2725 |
    +---------------+------+---------------+----------+--------+------+
    curl -s 'http://10.10.10.1:8080/services?Action=GetObProxyConfig'
    

    If ODP has been deployed in the target cluster, two cases exist:

    • If the version of obd is V3.2.0 or later, obd allows you to choose whether to restart the cluster in an interactive manner. You can enter restart in the output to restart ODP by using obconfigserver.

      Restart `obproxy-ce,oceanbase-ce` for test to take effect. You can do it manually later or enter `restart` now: 
      

      If you directly press Enter or enter another value instead of restart, obd will not restart the cluster. After the process ends, ODP still starts by using the RootService list.

    • If obd is of a version earlier than V3.2.0, an obd cluster restart command is provided in the output. You only need to copy and run the command. After the command is executed, ODP will restart by using obconfigserver.

      obd cluster restart demo -c obproxy-ce
      

Create a configuration file named config-only.yaml. The parameters for the components in the configuration file are described as follows:

  1. Configure user information.

    ## 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 specifies the username of the account used to log in to the target server. Make sure that this account has the write permission on home_path. password and key_file are used for user verification. Generally, you need to specify only one of them.

    Notice

    After you specify the path of the key, comment out or delete the password parameter if your key does not require a password. Otherwise, the value of the password parameter will be taken as the password of the key and used for login, leading to a login verification failure.

  2. Configure the ob-configserver component.

    ob-configserver:
      servers:
        - 10.10.10.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:
          # database_type: sqlite3
          # connection_url: "/home/admin/ob-configserver/.data.db?cache=shared&_fk=1"
    
          # mysql:
          # database_type: mysql
          # connection_url: "$user:$password@tcp($IP:$PORT)/$metadb?parseTime=true"
    

    For parameters that are commented out in the configuration file, their default values are used. You can also uncomment the parameters and specify other values for them. The key parameters are described as follows:

    • server_ip: the access allowlist of obconfigserver. The default value is 0.0.0.0, which indicates that access from all IP addresses of the server where obconfigserver resides is allowed.

    • vip_address and vip_port: the IP address and port used for load balancing. If multiple nodes are configured in servers, load balancing is required. After you configure load balancing, specify the IP address and port used for load balancing in the configuration file.

    • database_type: the database type. Valid values are sqlite3 and mysql. The default value is sqlite3. The recommended value is mysql.

    • connection_url: the URL for connecting to the database. The value of connection_url is $home_path/.data.db?cache=shared&_fk=1 by default when the database type is sqlite3, and can be a URL for connecting to an OceanBase database or a MySQL database when the database type is mysql. The specified database user must have the privileges to perform DDL and DML operations on the database corresponding to the URL. If OceanBase Database is used, do not use oceanbase as the database name. Otherwise, a message prompting no privileges is displayed.

  3. Deploy obconfigserver.

    [admin@obtest ~]$ obd cluster deploy config-only -c config-only.yaml
    

    Here is an example of deploying the config-only cluster by using the config-only.yaml configuration file. In practice, use the actual cluster names and configuration file names.

  4. Start obconfigserver.

    [admin@obtest ~]$ obd cluster start config-only
    

    The output is as follows, where you can see the access address of obconfigserver.

    +-----------------------------------------------------------+
    |                      ob-configserver                      |
    +---------+------+---------------+----------+--------+------+
    | server  | port | vip_address   | vip_port | status | pid  |
    +---------+------+---------------+----------+--------+------+
    | 0.0.0.0 | 8080 | 10.10.10.1    | 8080     | active | 6270 |
    +---------+------+---------------+----------+--------+------+
    curl -s 'http://10.10.10.1:8080/services?Action=GetObProxyConfig'
    

Use obconfigserver

This section describes how to register an OceanBase cluster with obconfigserver, view registration information, start ODP, and delete a cluster registered with obconfigserver.

Register an OceanBase cluster with obconfigserver

You can register an OceanBase cluster with obconfigserver by modifying the configuration file of the cluster or by executing SQL statements. You can select either method as needed.

By modifying the configuration file of the OceanBase cluster
By executing SQL statements

Notice

  • You must configure the appname parameter in the configuration file of the OceanBase cluster to be registered. Otherwise, an error is returned during a restart after obconfig_url is configured.

  • The OceanBase cluster to be registered must have been started. At present, you cannot register a cluster that is not started.

  1. Run the obd cluster edit-config command to edit the configuration file of an existing cluster and configure obconfig_url in the global section of the oceanbase-ce component.

    Here is an example:

    obconfig_url: 'http://10.10.10.1:8080/services?Action=ObRootServiceInfo&ObCluster=test1'
    
    • 10.10.10.1:8080: the access address of obconfigserver. The address provided here is only for reference. You must change it based on the actual situation.

    • test1: the appname value of the OceanBase cluster to be registered. The value provided here is only for reference. You must change it based on the actual situation.

  2. Run the obd cluster reload command to restart the cluster. Here is an example of restarting the test1 cluster:

    obd cluster reload test1
    
  3. After the restart, verify whether the cluster has been successfully registered with obconfigserver by referring to View registration information in obconfigserver.

  1. Log in as the root user to the sys tenant of the cluster to be registered.

    obclient -h<IP> -P<PORT> -uroot@sys -p -c -A
    #example
    obclient -h10.10.10.4 -P4883 -uroot@sys -p -c -A
    

    Here, IP specifies the IP address for connecting to OceanBase Database. PORT specifies the port for connecting to OceanBase Database, which takes the value of the mysql_port parameter in the case of direct connection, or the value of the listen_port parameter in the case of connection through ODP.

    For more information about how to use OBClient to connect to an OceanBase cluster, see Connect to an OceanBase Database tenant by using OBClient.

  2. View the value of the obconfig_url parameter.

    obclient> SHOW PARAMETERS LIKE 'obconfig_url';
    

    The output is as follows, indicating that obconfig_url is not configured for the cluster.

    +-------+----------+---------------+----------+--------------+-----------+-------+--------------------------+----------+---------+---------+-------------------+---------------+-----------+
    | zone  | svr_type | svr_ip        | svr_port | name         | data_type | value | info                     | section  | scope   | source  | edit_level        | default_value | isdefault |
    +-------+----------+---------------+----------+--------------+-----------+-------+--------------------------+----------+---------+---------+-------------------+---------------+-----------+
    | zone3 | observer | 10.10.10.4   |     2882  | obconfig_url | STRING    |       | URL for OBConfig service | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |               |         1 |
    | zone1 | observer | 10.10.10.2   |     2882  | obconfig_url | STRING    |       | URL for OBConfig service | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |               |         1 |
    | zone2 | observer | 10.10.10.3   |     2882  | obconfig_url | STRING    |       | URL for OBConfig service | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |               |         1 |
    +-------+----------+---------------+----------+--------------+-----------+-------+--------------------------+----------+---------+---------+-------------------+---------------+-----------+
    
  3. Configure obconfig_url.

    alter system set obconfig_url = 'http://10.10.10.1:8080/services?Action=ObRootServiceInfo&ObCluster=test1';
    

    10.10.10.1:8080 is the access address of obconfigserver. test1 is the appname value of the OceanBase cluster to be registered, which you can obtain by executing the SHOW PARAMETERS LIKE 'cluster'; statement after connecting to the cluster. The value provided here is only for reference. You must change it based on the actual situation.

  4. Log out of the OceanBase cluster and verify whether obconfigserver can parse the information about the cluster.

    curl -s 'http://10.10.10.1:8080/services?Action=ObRootServiceInfo&ObCluster=test1' |jq .
    

    Note

    After you register an OceanBase cluster with obconfigserver, you can query related information in obconfigserver after a few minutes.

The output is as follows, showing that the IP addresses and ports of OBServer nodes in the cluster are successfully parsed.

{
  "Code": 200,
  "Message": "successful",
  "Success": true,
  "Data": {
    "ObClusterId": 1,
    "ObRegionId": 1,
    "ObCluster": "test1",
    "ObRegion": "test1",
    "ReadonlyRsList": [],
    "RsList": [
      {
        "address": "10.10.10.4:4882",
        "role": "LEADER",
        "sql_port": 4881
      }
    ],
    "Type": "PRIMARY",
    "timestamp": 1692699586370950
  },
  "Trace": "362172a2d5de734c",
  "Server": "10.10.10.1",
  "Cost": 1
}  

View registration information in obconfigserver

  1. View cluster details.

    obd cluster display test
    

    Here takes the test cluster where obconfigserver is deployed as an example. You can run the obd cluster list command to view the actual cluster name, which is the value of the Name column in the output. You must change the cluster name based on the actual situation.

    The output is as follows:

    Connect to ob-configserver ok
    +-------------------------------------------------------------------+
    |                          ob-configserver                          |
    +---------------+-------+---------------+----------+--------+-------+
    | server        | port  | vip_address   | vip_port | status | pid   |
    +---------------+-------+---------------+----------+--------+-------+
    | 10.10.10.1    | 8080  | 10.10.10.1    | 8080     | active | 13616 |
    +---------------+-------+---------------+----------+--------+-------+
    curl -s 'http://10.10.10.1:8080/services?Action=GetObProxyConfig'
    Connect to observer 10.10.10.1:2881 ok
    Wait for observer init ok
    +-------------------------------------------------+
    |                   oceanbase-ce                  |
    +---------------+---------+------+-------+--------+
    | ip            | version | port | zone  | status |
    +---------------+---------+------+-------+--------+
    | 10.10.10.2    | 4.3.5.0 | 2881 | zone1 | ACTIVE |
    | 10.10.10.3    | 4.3.5.0 | 2881 | zone2 | ACTIVE |
    | 10.10.10.4    | 4.3.5.0 | 2881 | zone3 | ACTIVE |
    +---------------+---------+------+-------+--------+
    obclient -h10.10.10.1 -P2881 -uroot -p'********' -Doceanbase -A
    
    cluster unique id: 253244ab-94b9-5def-9cbd-7a46e6c19621-1953714c460-00050304
    
    Connect to obproxy ok
    +-------------------------------------------------------------------+
    |                             obproxy-ce                            |
    +---------------+------+-----------------+-----------------+--------+
    | ip            | port | prometheus_port | rpc_listen_port | status |
    +---------------+------+-----------------+-----------------+--------+
    | 10.10.10.5    | 2883 | 2884            | 2885            | active |
    +---------------+------+-----------------+-----------------+--------+
    obclient -h10.10.10.1 -P2883 -uroot@proxysys -p'********' -Doceanbase -A
    
    Trace ID: ea4340b6-f35a-11ef-a019-00163e4cf51e
    
  2. View the clusters registered with obconfigserver.

    Copy the access information of the ob-configserver component to view the OceanBase clusters registered with obconfigserver. You can use the jq command to format the JSON output in a shell. To install jq, run sudo yum install jq.

    curl -s 'http://10.10.10.1:8080/services?Action=GetObProxyConfig' | jq .
    

    The output is as follows. ObRootServiceInfoUrlList contains information about the OceanBase cluster named test, indicating that the cluster has been registered with obconfigserver.

    {
      "Code": 200,
      "Message": "successful",
      "Success": true,
      "Data": {
        "ObProxyBinUrl": "http://10.10.10.1:8080/client?Action=GetObProxy",
        "ObProxyDatabaseInfo": {
          "DataBase": "***",
          "MetaDataBase": "http://10.10.10.1:8080/services?Action=ObRootServiceInfo&User_ID=alibaba&UID=admin&ObRegion=obdv1",
          "Password": "***",
          "User": "***"
        },
        "ObRootServiceInfoUrlList": [
          {
            "ObRegion": "test",
            "ObRootServiceInfoUrl": "http://10.10.10.1:8080/services?Action=ObRootServiceInfo&ObCluster=test"
          }
        ],
        "Version": "4660b4b1f237893ba1da50a302e4c3e6"
      },
      "Trace": "07a7cac129713d00",
      "Server": "10.10.10.1",
      "Cost": 0
    }
    
  3. View details of the OceanBase cluster.

    Visit the URL provided in the ObRootServiceInfoUrl section of the command output to view the details of the OceanBase cluster. Here is an example:

    curl -s 'http://10.10.10.1:8080/services?Action=ObRootServiceInfo&ObCluster=test' | jq .
    

    The output is as follows, showing that the IP addresses and ports of OBServer nodes in the cluster are successfully parsed.

    {
      "Code": 200,
      "Message": "successful",
      "Success": true,
      "Data": {
        "ObClusterId": 1,
        "ObRegionId": 1,
        "ObCluster": "test",
        "ObRegion": "test",
        "ReadonlyRsList": [],
        "RsList": [
          {
            "address": "10.10.10.4:2882",
            "role": "LEADER",
            "sql_port": 2881
          },
          {
            "address": "10.10.10.3:2882",
            "role": "FOLLOWER",
            "sql_port": 2881
          },
          {
            "address": "10.10.10.2:2882",
            "role": "FOLLOWER",
            "sql_port": 2881
          }
        ],
        "Type": "PRIMARY",
        "timestamp": 1694084002271443
      },
      "Trace": "2b2ee036276b068e",
      "Server": "10.10.10.1",
      "Cost": 3
    }
    

Start ODP

ODP can start by using rs_list or obproxy_config_server_url. If you configure ODP to start by using rs_list, it can connect to only an OceanBase cluster specified by rs_list. If you configure ODP to start by using obproxy_config_server_url, it can connect to all OceanBase clusters registered with obconfigserver.

To enable ODP to start by using obproxy_config_server_url, run the obd cluster edit-config command to open the configuration file and add the following content to the global section of the obproxy-ce component:

obproxy_config_server_url: http://10.10.10.1:8080/services?Action=GetObProxyConfig

In this example, 10.10.10.1:8080 is the access address of obconfigserver. You must change it based on the actual situation.

Delete the registration information of a cluster

You can run the following command to delete the registration information of a cluster from obconfigserver. Here is an example of deleting the registration information of the test1 cluster:

curl -X DELETE 'http://10.10.10.1:8080/services?Action=ObRootServiceInfo&ObCluster=test1&ObClusterId=1&version=2' |jq .

In this example, 10.10.10.1:8080 is the access address of obconfigserver, which you can obtain by running the obd cluster display command. test1 is the name of the cluster whose registration information is to be deleted, which you can obtain from the appname value in the configuration file of the cluster, or by executing the SHOW PARAMETERS LIKE 'cluster'; statement after connecting to the cluster. You can obtain the value of ObClusterId from the cluster_id value in the configuration file of the cluster, or from the cluster details by referring to View registration information in obconfigserver.

The output is as follows:

{
  "Code": 200,
  "Message": "successful",
  "Success": true,
  "Data": "success",
  "Trace": "caba1209b3a00c56",
  "Server": "10.10.10.1",
  "Cost": 4
}

View the cluster registration information in obconfigserver again.

curl -s 'http://10.10.10.1:8080/services?Action=GetObProxyConfig' |jq .

The output is as follows, showing that the registration information about the test1 cluster disappears.

{
  "Code": 200,
  "Message": "successful",
  "Success": true,
  "Data": {
    "ObProxyBinUrl": "http://10.10.10.1:8080/client?Action=GetObProxy",
    "ObProxyDatabaseInfo": {
      "DataBase": "***",
      "MetaDataBase": "http://10.10.10.1:8080/services?Action=ObRootServiceInfo&User_ID=alibaba&UID=admin&ObRegion=obdv1",
      "Password": "***",
      "User": "***"
    },
    "ObRootServiceInfoUrlList": [
      {
        "ObRegion": "test",
        "ObRootServiceInfoUrl": "http://10.10.10.1:8080/services?Action=ObRootServiceInfo&ObCluster=test"
      }
    ],
    "Version": "4840ade8a158753aa5b9ea69ba014fc1"
  },
  "Trace": "d4b4b27fae24e7b4",
  "Server": "10.10.10.1",
  "Cost": 1
}

FAQ

What do I do if the error prepared statement not supported is returned when obconfigserver is started?

Symptom

If OceanBase Database serves as the MetaDB, the error prepared statement not supported is returned when obconfigserver is started. The log is as follows:

2022-11-16T09:52:14.47799+08:00 ERROR [12258,] caller=cmd/main.go:36:func1: start configserver failed: start config server: create configserver schema: sql/schema: reading schema information Error 1235: while parameter _ob_enable_prepared_statement is disabled, prepared statement not supported
[10.10.10.1:2882] [2022-11-16 09:52:14.459102] [YB42AC1EC731-0005EB5F1D83A0A7] fields: args:="[]"

Possible causes

When obconfigserver is started, the Prepared Statement (PS) feature is not enabled for OceanBase Database.

Solution

You can resolve the issue in the following ways:

  • Method 1: Add interpolateParams=true to the value of connection_url for obconfigserver in the configuration file. Here is an example:

    connection_url: "user:password@tcp(IP:PORT)/test?parseTime=true&interpolateParams=true"
    
  • Method 2: Connect to the OceanBase cluster and set the _ob_enable_prepared_statement parameter to True.

    • Check whether the _ob_enable_prepared_statement parameter is set to True.

      obclient> select name,value,svr_ip,svr_port from oceanbase.__all_virtual_sys_parameter_stat where name='_ob_enable_prepared_statement';
      +-------------------------------+-------+---------------+----------+
      | name                          | value | svr_ip        | svr_port |
      +-------------------------------+-------+---------------+----------+
      | _ob_enable_prepared_statement | False | 10.10.10.1    |     2882 |
      +-------------------------------+-------+---------------+----------+
      1 row in set
      
    • Set the _ob_enable_prepared_statement parameter to True.

      obclient> alter system set _ob_enable_prepared_statement='True';
      

What do I do if an error is returned when I use ODP to connect to a cluster registered with obconfigserver?

Symptom

An error is returned when ODP is used to connect to a cluster registered with obconfigserver. Here is an example:

$ obclient -h10.10.10.2 -P2883 -uroot@sys#cluster -p -Doceanbase -A
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 11

Possible causes

ODP cannot use the configured username and password to access the OceanBase cluster.

Solution

You can resolve the issue in the following ways:

  • Method 1: Run the obd cluster edit-config command to view the configuration file. Check whether the proxyro_password parameter in the configuration file of the OceanBase cluster and the observer_sys_password parameter in the configuration file of ODP are set to the same value. If not, set the two parameters to the same value and perform a restart by using the command provided in the output. After the restart, you can use ODP to connect to the cluster.

  • Method 2: Check whether the proxyro user exists in the OceanBase cluster.

    • Log in as the root user to the sys tenant of the OceanBase cluster.

      obclient -h10.10.10.2 -P2881 -uroot@sys -p -Doceanbase -A
      
    • Check whether the proxyro user exists in the cluster.

      select user,password from mysql.user;
      
    • Take the following actions based on the return result:

      • If the proxyro user does not exist in the cluster, run the following command to create the proxyro user and set the password to the value of the observer_sys_password parameter in the configuration file of ODP:

        create user 'proxyro' identified by '*****';
        
      • If the proxyro user exists in the cluster, run the following command to change the password of the proxyro user to the value of the observer_sys_password parameter in the configuration file of ODP:

        alter user 'proxyro' identified by '*****';
        

Previous topic

Deploy OCP Express by using commands
Last

Next topic

Deploy the obbinlog
Next
What is on this page
Components
Prerequisites
Procedure
Use obconfigserver
Register an OceanBase cluster with obconfigserver
View registration information in obconfigserver
Start ODP
Delete the registration information of a cluster
FAQ
What do I do if the error prepared statement not supported is returned when obconfigserver is started?
What do I do if an error is returned when I use ODP to connect to a cluster registered with obconfigserver?