Start an ODP

2024-06-28 05:30:30  Updated

After you deploy an OceanBase Database Proxy (ODP, also known as OBProxy), you can run an SQL command to start a single obproxy process.

Prerequisites

You have deployed an ODP. For more information about ODP deployment, see Deploy ODP.

Background information

You can use one of the following methods to start an obproxy process:

  • Specify the -r parameter in the process startup command to query the RootServer information of the OceanBase cluster. This method does not require other configurations and is usually used in the development and debugging phase.

  • Specify the obproxy_config_server_url parameter in the process startup command to query the RootServer information of the OceanBase cluster. If you use this method, you must configure the obproxy_config_server_url parameter, which depends on the startup of the Config Server. Therefore, we recommend that you use this method to start an ODP.

Procedure

  1. Log on as the admin user to the server that hosts the ODP to be started.

    Notice

    To start the ODP, log on as the admin user and run the startup command in the home directory of the ODP software. The ODP startup fails if you log on as other users or run the startup command in other directories.

  2. Go to the ODP installation directory.

  3. Run the following command:

    Note

    Before you start the ODP, you can run the ./bin/obproxy -h command to view the parameters related to the startup of the ODP.

    • Specify the -r parameter in the startup command

      The syntax of the command is as follows:

      $./bin/obproxy -p6789 -r'ip:port' -e -n appname -o obproxy_config_server_url='' -c cluster_name
      

      The parameters are described as follows:

      • -p specifies the port number listened to by the ODP. The MySQL client uses this port to access OceanBase Database. The parameter is required for the first startup. You do not need to specify this parameter in subsequent startups or upgrades.

      • -r'ip:port': specifies the IP address and port number of the RootServer in the specified OceanBase cluster. The port is the SQL port of the OBServer node, not the RPC port.

      • -e specifies to create a table. We recommend that you specify this parameter only for the first startup of the ODP. You do not need to specify the parameter in subsequent startups or upgrades.

      • -n specifies the application name of the ODP to be started. This parameter is optional.

        You can use the app_name parameter to change the application name of the ODP. The default value is undefined.

      • -o specifies the parameter configurations of the hardware or kernel. If you do not specify this parameter, the default system configurations are used.

        The obproxy_config_server_url='' parameter indicates that the startup does not rely on the Config Server.

      • The -c cluster_name parameter specifies the name of OceanBase cluster.

      Here is an example:

      $./bin/obproxy -r'10.10.10.1:26506;10.10.10.2:26506' -n test -c mycluster
      
    • Specify the obproxy_config_server_url parameter in the startup command

      The syntax of the command is as follows:

      $./bin/obproxy -p6789 -e -n appname -o obproxy_config_server_url='your_config_url'
      

      The parameters in the syntax are described as follows:

      • -p specifies the port number listened to by the ODP. The MySQL client uses this port to access OceanBase Database. The parameter is required for the first startup. You do not need to specify this parameter in subsequent startups or upgrades.

      • -e specifies to create a table. We recommend that you specify this parameter only for the first startup of the ODP. You do not need to specify the parameter in subsequent startups or upgrades.

      • -n specifies the application name.

        You can use the app_name parameter to change the application name of the ODP. The default value is undefined.

      • -o specifies the parameter configurations of the hardware or kernel. If you do not specify this parameter, the default system configurations are used.

      • The obproxy_config_server_url parameter specifies the URL of the Config Server.

      Here is an example:

      $./bin/obproxy -n test -o obproxy_config_server_url='http://xx.xx.xx.xx:8877/obproxy_config'
      
  4. Run the following command to check whether the obproxy process exists:

    $ps -ef|grep obproxy
    

Contact Us