OceanBase logo

OceanBase

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

Product Overview
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

OceanBase

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

Product Overview
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 Database

SQL - V4.3.3

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & CertificationTicket
    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 Database
    3. SQL
    4. V4.3.3
    iconOceanBase Database
    SQL - V 4.3.3
    SQL
    KV
    • V 4.6.0
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    Use obshell to scale out an OceanBase cluster

    Last Updated:2024-12-02 03:48:26  Updated
    share
    What is on this page
    Prerequisites
    Deployment mode
    Scale out an OceanBase cluster by calling the corresponding API operation
    Step 1: Start obshell
    Step 2: Call the scale-out API operation
    Step 3: Check whether the scale-out is successful
    Step 4: Scale out the resources in tenants
    Scale out an OceanBase cluster by running obshell commands
    Step 1: Start obshell
    Step 2: Run the scale-out command to perform a scale-out
    Step 3: Check whether the scale-out is successful
    Step 4: Scale out the resources in tenants

    folded

    share

    OceanBase Shell (obshell) supports the following cluster scale-out methods:

    • Scale out an OceanBase cluster by calling the corresponding API operation

    • Scale out an OceanBase cluster by running obshell commands

    This topic describes how to use obshell to scale out an OceanBase cluster with three replicas.

    Prerequisites

    • The OceanBase cluster is managed by obshell. For more information, see Take over an OceanBase cluster not deployed by obshell.

    • All OBServer nodes and obshell processes in the OceanBase cluster are running normally.

    Deployment mode

    The following table describes the three existing machines in the OceanBase cluster and the machine to be added, with obshell using the default port 2886.

    Role
    Machine
    Description
    Existing OBServer node 10.10.10.1 In OceanBase Database Zone 1
    Existing OBServer node 10.10.10.2 In OceanBase Database Zone 2
    Existing OBServer node 10.10.10.3 In OceanBase Database Zone 3
    OBServer node to be added 10.10.10.4 To be added to OceanBase Database Zone 1

    Scale out an OceanBase cluster by calling the corresponding API operation

    Note

    obshell verifies the security of requested API operations. Therefore, you must encrypt the request before you call an API operation. For more information, see Hybrid encryption for API operations. You must also specify ${request_headers} and ${request_body} in the curl command.

    Step 1: Start obshell

    Start obshell on the OBServer node (10.10.10.4) to be added to the cluster.

    [admin@test004 ~]$ /home/admin/oceanbase/bin/obshell agent start --ip 10.10.10.4 -P 2886
    

    Step 2: Call the scale-out API operation

    Call the /api/v1/ob/scale_out API operation in any obshell process in the cluster to initiate a scale-out.

    CLI
    Python
    Go

    For more information about how to call the corresponding API operation by using the CLI, see AddNode. The API operation creates an asynchronous O&M task. For more information about how to query the task progress, see GetDagDetails. Wait for the scale-out task to complete.

    [admin@test001 ~]$ curl -H "Content-Type: application/json" -H 'X-OCS-Header:${request_headers}' -X POST -d '${request_body}'  http://10.10.10.1:2886/api/v1/ob/scale_out
    

    For more information about how to call the corresponding API operation by using obshell-sdk-python, see Scale out a cluster.

    ···
    client = ClientSet("10.10.10.1", 2886, PasswordAuth("****"))
    configs = {"redoDir":" /data/workspace/redo", "dataDir":" /data/workspace/data", 
               "datafile_size":"24G", "cpu_count":"16", "memory_limit":"16G", 
               "system_memory":"4G", "log_disk_size":"40G"}
    client.v1.scale_out_sync("10.10.10.4", 2886, "zone1", configs)  ## Call /api/v1/ob/scale_out.
    ···
    

    For more information about how to call the corresponding API operation by using obshell-sdk-go, see Scale out a cluster.

    ···
    client, err := services.NewClientWithPassword("10.10.10.1", 2886, "****")
    configs := map[string]string {
        "redoDir":" /data/workspace/redo", "dataDir":" /data/workspace/data", 
        "datafile_size":"24G", "cpu_count":"16", "memory_limit":"16G", 
        "system_memory":"4G", "log_disk_size":"40G"}
    req := client.V1().NewScaleOutRequest("10.10.10.4", 2886, "zone1", configs)
    dag, err := client.V1().ScaleOutSyncWithRequest(req)  // Call /api/v1/ob/scale_out.
    ···
    

    Step 3: Check whether the scale-out is successful

    1. Log in to the sys tenant of OceanBase Database as the root user, and run the following command to query all OBServer nodes in the cluster:

      obclient [oceanbase]> select * from oceanbase.dba_ob_servers;
      

      The output is as follows:

      +------------+----------+----+-------+----------+-----------------+--------+----------------------------+-----------+-----------------------+----------------------------+----------------------------+-------------------------------------------------------------------------------------------+-------------------+
      | SVR_IP     | SVR_PORT | ID | ZONE  | SQL_PORT | WITH_ROOTSERVER | STATUS | START_SERVICE_TIME         | STOP_TIME | BLOCK_MIGRATE_IN_TIME | CREATE_TIME                | MODIFY_TIME                | BUILD_VERSION                                                                             | LAST_OFFLINE_TIME |
      +------------+----------+----+-------+----------+-----------------+--------+----------------------------+-----------+-----------------------+----------------------------+----------------------------+-------------------------------------------------------------------------------------------+-------------------+
      | 10.10.10.1 |     2882 |  1 | zone1 |     2881 | YES             | ACTIVE | 2024-04-09 17:47:47.849965 | NULL      | NULL                  | 2024-04-09 17:47:42.054759 | 2024-04-09 17:47:48.850012 | 4.3.0.1_100000242024032211-0193a343bc60b4699ec47792c3fc4ce166a182f9(Mar 22 2024 13:19:48) | NULL              |
      | 10.10.10.2 |     2882 |  2 | zone2 |     2881 | NO              | ACTIVE | 2024-04-09 17:47:47.749100 | NULL      | NULL                  | 2024-04-09 17:47:42.173519 | 2024-04-09 17:47:48.850012 | 4.3.0.1_100000242024032211-0193a343bc60b4699ec47792c3fc4ce166a182f9(Mar 22 2024 13:19:48) | NULL              |
      | 10.10.10.3 |     2882 |  3 | zone3 |     2881 | NO              | ACTIVE | 2024-04-09 17:47:47.490511 | NULL      | NULL                  | 2024-04-09 17:47:42.567437 | 2024-04-09 17:47:48.850012 | 4.3.0.1_100000242024032211-0193a343bc60b4699ec47792c3fc4ce166a182f9(Mar 22 2024 13:19:48) | NULL              |
      | 10.10.10.4 |     2882 |  4 | zone1 |     2881 | NO              | ACTIVE | 2024-04-10 10:37:47.530894 | NULL      | NULL                  | 2024-04-09 10:27:32.222980 | 2024-04-09 17:47:48.850012 | 4.3.0.1_100000242024032211-0193a343bc60b4699ec47792c3fc4ce166a182f9(Mar 22 2024 13:19:48) | NULL              |
      +------------+----------+----+-------+----------+-----------------+--------+----------------------------+-----------+-----------------------+----------------------------+----------------------------+-------------------------------------------------------------------------------------------+-------------------+
      
    2. Run the following command to query the OBServer nodes managed by obshell:

      obclient [oceanbase]> select * from ocs.all_agent;
      

      The output is as follows:

      +------------+------+---------------+----------------------+-------+--------------+-------+------------+----------+--------------------------+------------------------------------------------------------------------------------------------------+
      | ip         | port | identity      | version              | os    | architecture | zone  | mysql_port | rpc_port | home_path                | public_key                                                                                           |
      +------------+------+---------------+----------------------+-------+--------------+-------+------------+----------+--------------------------+------------------------------------------------------------------------------------------------------+
      | 10.10.10.1 | 2886 | CLUSTER AGENT | 4.2.3.0-102024031414 | linux | x86_64       | zone1 |       2881 |     2882 | /home/admin/oceanbase-ce | MEgCQQCfqaND/dAbH/cJhOuTP8gRUBZh1nqrNtFwB9Plw6YwWiSintZPiC9pN/FKlBeR/Klt2jvu8oqZe+S3p/xq+ckPAgMBAAE= |
      | 10.10.10.2 | 2886 | CLUSTER AGENT | 4.2.3.0-102024031414 | linux | x86_64       | zone2 |       2881 |     2882 | /home/admin/oceanbase-ce | MEgCQQCfqaND/dAbH/cJhOuTP8gRUBZh1nqrNtFwB9Plw6YwWiSintZPiC9pN/FKlBeR/Klt2jvu8oqZe+S3p/xq+ckPAgMBAAE= |
      | 10.10.10.3 | 2886 | CLUSTER AGENT | 4.2.3.0-102024031414 | linux | x86_64       | zone3 |       2881 |     2882 | /home/admin/oceanbase-ce | MEgCQQCfqaND/dAbH/cJhOuTP8gRUBZh1nqrNtFwB9Plw6YwWiSintZPiC9pN/FKlBeR/Klt2jvu8oqZe+S3p/xq+ckPAgMBAAE= |
      | 10.10.10.4 | 2886 | CLUSTER AGENT | 4.2.3.0-102024031414 | linux | x86_64       | zone1 |       2881 |     2882 | /home/admin/oceanbase-ce | MEgCQQCfqaND/dAbH/cJhOuTP8gRUBZh1nqrNtFwB9Plw6YwWiSintZPiC9pN/FKlBeR/Klt2jvu8oqZe+S3p/xq+ckPAgMBAAE= |
      +------------+------+---------------+----------------------+-------+--------------+-------+------------+----------+--------------------------+------------------------------------------------------------------------------------------------------+
      

    If both commands return the information about the OBServer node added to the cluster, the scale-out is successful.

    Step 4: Scale out the resources in tenants

    After you successfully scale out the OceanBase cluster, you can scale out the resources in tenants. For more information, see Overview.

    Scale out an OceanBase cluster by running obshell commands

    Step 1: Start obshell

    Start obshell on the OBServer node (10.10.10.4) to be added to the cluster.

    [admin@test004 ~]$ /home/admin/oceanbase/bin/obshell agent start --ip 10.10.10.4 -P 2886
    

    Step 2: Run the scale-out command to perform a scale-out

    Run the scale-out command on the OBServer node to be added to perform a scale-out. Run the obshell cluster scale-out command on the OBServer node (10.10.10.4) to be added.

    [admin@test004 ~]$ /home/admin/oceanbase/bin/obshell cluster scale-out -s '10.10.10.1:2886' -z 'zone1' -o 'memory_limit=16G,system_memory=8G,log_disk_size=24G,datafile_size=24G' --rp *****
    

    Step 3: Check whether the scale-out is successful

    1. Log in to the sys tenant of OceanBase Database as the root user, and run the following command to query all OBServer nodes in the cluster:

      obclient [oceanbase]> select * from oceanbase.dba_ob_servers;
      

      The output is as follows:

      +------------+----------+----+-------+----------+-----------------+--------+----------------------------+-----------+-----------------------+----------------------------+----------------------------+-------------------------------------------------------------------------------------------+-------------------+
      | SVR_IP     | SVR_PORT | ID | ZONE  | SQL_PORT | WITH_ROOTSERVER | STATUS | START_SERVICE_TIME         | STOP_TIME | BLOCK_MIGRATE_IN_TIME | CREATE_TIME                | MODIFY_TIME                | BUILD_VERSION                                                                             | LAST_OFFLINE_TIME |
      +------------+----------+----+-------+----------+-----------------+--------+----------------------------+-----------+-----------------------+----------------------------+----------------------------+-------------------------------------------------------------------------------------------+-------------------+
      | 10.10.10.1 |     2882 |  1 | zone1 |     2881 | YES             | ACTIVE | 2024-04-09 17:47:47.849965 | NULL      | NULL                  | 2024-04-09 17:47:42.054759 | 2024-04-09 17:47:48.850012 | 4.3.0.1_100000242024032211-0193a343bc60b4699ec47792c3fc4ce166a182f9(Mar 22 2024 13:19:48) | NULL              |
      | 10.10.10.2 |     2882 |  2 | zone2 |     2881 | NO              | ACTIVE | 2024-04-09 17:47:47.749100 | NULL      | NULL                  | 2024-04-09 17:47:42.173519 | 2024-04-09 17:47:48.850012 | 4.3.0.1_100000242024032211-0193a343bc60b4699ec47792c3fc4ce166a182f9(Mar 22 2024 13:19:48) | NULL              |
      | 10.10.10.3 |     2882 |  3 | zone3 |     2881 | NO              | ACTIVE | 2024-04-09 17:47:47.490511 | NULL      | NULL                  | 2024-04-09 17:47:42.567437 | 2024-04-09 17:47:48.850012 | 4.3.0.1_100000242024032211-0193a343bc60b4699ec47792c3fc4ce166a182f9(Mar 22 2024 13:19:48) | NULL              |
      | 10.10.10.4 |     2882 |  4 | zone1 |     2881 | NO              | ACTIVE | 2024-04-10 10:37:47.530894 | NULL      | NULL                  | 2024-04-09 10:27:32.222980 | 2024-04-09 17:47:48.850012 | 4.3.0.1_100000242024032211-0193a343bc60b4699ec47792c3fc4ce166a182f9(Mar 22 2024 13:19:48) | NULL              |
      +------------+----------+----+-------+----------+-----------------+--------+----------------------------+-----------+-----------------------+----------------------------+----------------------------+-------------------------------------------------------------------------------------------+-------------------+
      
    2. Run the following command to query the OBServer nodes managed by obshell:

      obclient [oceanbase]> select * from ocs.all_agent;
      

      The output is as follows:

      +------------+------+---------------+----------------------+-------+--------------+-------+------------+----------+--------------------------+------------------------------------------------------------------------------------------------------+
      | ip         | port | identity      | version              | os    | architecture | zone  | mysql_port | rpc_port | home_path                | public_key                                                                                           |
      +------------+------+---------------+----------------------+-------+--------------+-------+------------+----------+--------------------------+------------------------------------------------------------------------------------------------------+
      | 10.10.10.1 | 2886 | CLUSTER AGENT | 4.2.3.0-102024031414 | linux | x86_64       | zone1 |       2881 |     2882 | /home/admin/oceanbase-ce | MEgCQQCfqaND/dAbH/cJhOuTP8gRUBZh1nqrNtFwB9Plw6YwWiSintZPiC9pN/FKlBeR/Klt2jvu8oqZe+S3p/xq+ckPAgMBAAE= |
      | 10.10.10.2 | 2886 | CLUSTER AGENT | 4.2.3.0-102024031414 | linux | x86_64       | zone2 |       2881 |     2882 | /home/admin/oceanbase-ce | MEgCQQCfqaND/dAbH/cJhOuTP8gRUBZh1nqrNtFwB9Plw6YwWiSintZPiC9pN/FKlBeR/Klt2jvu8oqZe+S3p/xq+ckPAgMBAAE= |
      | 10.10.10.3 | 2886 | CLUSTER AGENT | 4.2.3.0-102024031414 | linux | x86_64       | zone3 |       2881 |     2882 | /home/admin/oceanbase-ce | MEgCQQCfqaND/dAbH/cJhOuTP8gRUBZh1nqrNtFwB9Plw6YwWiSintZPiC9pN/FKlBeR/Klt2jvu8oqZe+S3p/xq+ckPAgMBAAE= |
      | 10.10.10.4 | 2886 | CLUSTER AGENT | 4.2.3.0-102024031414 | linux | x86_64       | zone1 |       2881 |     2882 | /home/admin/oceanbase-ce | MEgCQQCfqaND/dAbH/cJhOuTP8gRUBZh1nqrNtFwB9Plw6YwWiSintZPiC9pN/FKlBeR/Klt2jvu8oqZe+S3p/xq+ckPAgMBAAE= |
      +------------+------+---------------+----------------------+-------+--------------+-------+------------+----------+--------------------------+------------------------------------------------------------------------------------------------------+
      

    If both commands return the information about the OBServer node added to the cluster, the scale-out is successful.

    Step 4: Scale out the resources in tenants

    After you successfully scale out the OceanBase cluster, you can scale out the resources in tenants. For more information, see Overview.

    Previous topic

    Stop an OceanBase cluster
    Last

    Next topic

    Upgrade an OceanBase cluster
    Next
    What is on this page
    Prerequisites
    Deployment mode
    Scale out an OceanBase cluster by calling the corresponding API operation
    Step 1: Start obshell
    Step 2: Call the scale-out API operation
    Step 3: Check whether the scale-out is successful
    Step 4: Scale out the resources in tenants
    Scale out an OceanBase cluster by running obshell commands
    Step 1: Start obshell
    Step 2: Run the scale-out command to perform a scale-out
    Step 3: Check whether the scale-out is successful
    Step 4: Scale out the resources in tenants