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.2.0

    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.2.0
    iconOceanBase Database
    SQL - V 4.2.0
    Databases
    • OceanBase Database
    • OceanBase Cloud
    • OceanBase Tugraph
    • Interactive Tutorials
    • OceanBase Best Practices
    Tools
    • OceanBase Cloud Platform
    • OceanBase Migration Service
    • OceanBase Developer Center
    • OceanBase Migration Assessment
    • OceanBase Admin Tool
    • OceanBase Loader and Dumper
    • OceanBase Deployer
    • Kubernetes operator for OceanBase
    • OceanBase Diagnostic Tool
    • OceanBase Binlog Service
    Connectors and Middleware
    • OceanBase Database Proxy
    • Embedded SQL in C for OceanBase
    • OceanBase Call Interface
    • OceanBase Connector/C
    • OceanBase Connector/J
    • OceanBase Connector/ODBC
    • OceanBase Connector/NET
    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

    Install and deploy oblogproxy by using the installation package

    Last Updated:2024-04-19 08:32:35  Updated
    Share
    What is on this page
    Background information
    Install oblogproxy
    Download and install oblogproxy
    Configure the sys tenant
    Run oblogproxy
    Use oblogclient for data subscription
    More information

    folded

    Share

    You can deploy oblogproxy by using the installation package or using the source code. This topic describes how to deploy oblogproxy by using the installation package.

    Background information

    oblogproxy is a proxy service for managing incremental logs of OceanBase Database. It is a part of OceanBase Migration Service (OMS). Designed based on obcdc, oblogproxy provides links for applications to access and manage real-time incremental logs of OceanBase Database.

    oblogproxy allows you to subscribe to incremental logs in isolated networks and supports multiple access methods. You can perform the following steps to configure and use oblogproxy.

    Install oblogproxy

    Notice

    • You do not need to specify information about OceanBase clusters when you configure oblogproxy. Technically, oblogproxy can subscribe to multiple OceanBase clusters when it is connected to all OBServer nodes by using the specified account and password of the sys tenant of each cluster. For security, the account and password are not exposed to oblogclient users.
    • oblogproxy is stateless. It obtains information about databases and tables for data subscription from oblogclient. The information such as the timestamps of incremental logs is also stored by oblogclient. When oblogproxy resumes the connection to an OBServer node after disconnection, it is equivalent to creating a new connection.
    • oblogproxy consumes a large amount of memory. We recommend that you deploy oblogproxy and the OBServer nodes on different servers to avoid affecting the database performance.

    Download and install oblogproxy

    You can download the package of oblogproxy V1.1.0 from the GitHub open-source community.

    Decompress the package to the installation directory, which is /usr/local in this example.

    Run the following command to decompress the package:

    tar -zxf oblogproxy-ce-for-4x-xxxx.tar.gz -C /usr/local
    

    After decompression, specify the temporary environment variables.

    • Specify the path for running logproxy.

      export PATH=$PATH:/usr/local/oblogproxy/bin
      
    • Specify the dependency path.

      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/oblogproxy/liboblog
      

    Configure the sys tenant

    For security, you must specify the username and password of a user for oblogproxy. Only a user in the sys tenant of OceanBase Database can be connected.

    Notice

    The username here does not contain the cluster name or tenant name.

    sh run.sh config_sys sys_user sys_pwd
    

    where

    • sys_user specifies the username.
    • sys_pwd specifies the user password.

    Here is an example:

    sh run.sh config_sys sys passwd
    

    Run oblogproxy

    Go to the oblogproxy directory.

    cd /usr/local/oblogproxy
    

    Run the following command to start the service:

    ./run.sh start
    

    By default, the 2983 port is listened to. You can set the service_port field in the conf.json file to change the port. The service logs of oblogproxy are stored in the logs/ directory. The service logs of the LogReader thread are stored in the run/{client-id}/logs/ directory.

    Note

    You can then use oblogclient for OceanBase data subscription. For more information, see oblogclient documentation.

    Use oblogclient for data subscription

    You can use oblogclient to subscribe to data from OceanBase Database. Make sure that you have installed Maven dependencies before use.

    <dependency>
      <groupId>com.oceanbase.logclient</groupId>
      <artifactId>logproxy-client</artifactId>
      <version>1.0.7</version>
    </dependency>
    

    After that, you can configure the oblogclient by referencing the following sample code:

    ObReaderConfig config = new ObReaderConfig();
    // Specify the IP addresses of OceanBase root servers and separate multiple IP addresses with semicolons (;) in the following format: ip1:rpc_port1:sql_port1;ip2:rpc_port2:sql_port2
    config.setRsList("xxx.xxx.xxx.1:2882:2881;xxx.xxx.xxx.2:2882:2881");
    // Specify the username and password (user tenant).
    config.setUsername("r***");
    config.setPassword("****");
    // Specify the UNIX start timestamp in seconds. A value of 0 specifies to start the client from the current time.
    config.setStartTimestamp(0L);
    // Specify the subscription allowlist in the tenant.db.table format. Use asterisks (*) as wildcards.
    config.setTableWhiteList("sys.*.*");
    
    // Specify the IP address of the server where oblogproxy is deployed to create the client instance.
    LogProxyClient client = new LogProxyClient("xxx.xxx.xxx.1", 2983, config);
    // Add the RecordListener.
    client.addListener(new RecordListener() {
        @Override
        public void notify(LogMessage message){
            // Process the message.
        }
    
        @Override
        public void onException(LogProxyClientException e) {
            // Handle the error.
            if (e.needStop()) {
                // Stop the client when an unrecoverable exception occurs.
                client.stop();
            }
        }
    });
    
    // Start the client.
    client.start();
    client.join();
    

    More information

    For more information about oblogclient, see oblogclient.

    Previous topic

    FAQ about obcdc
    Last

    Next topic

    Build oblogproxy by using the source code
    Next
    What is on this page
    Background information
    Install oblogproxy
    Download and install oblogproxy
    Configure the sys tenant
    Run oblogproxy
    Use oblogclient for data subscription
    More information