After you deploy an ODP, 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
You can use one of the following methods to start an obproxy process:
Specify the
-rparameter 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_urlparameter in the process startup command to query the RootServer information of the OceanBase cluster. If you use this method, you must configure theobproxy_config_server_urlparameter, which depends on the startup of the Config Server. Therefore, we recommend that you use this method to start an ODP.
Procedure
Log on as the admin user to the server that hosts the ODP to be started.
Note
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.
Go to the ODP installation directory.
Run the following command:
Note
Before you start the ODP, you can run the
./bin/obproxy -hcommand to view the parameters related to the startup of the ODP.
Specify the
-rparameter in the startup commandSyntax:
$./bin/obproxy -p6789 -r'ip:port' -e -n appname -o obproxy_config_server_url='' -c cluster_nameParameters:
-pspecifies the listening port of 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.-especifies 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.-nspecifies the application name of the ODP to be started. This parameter is optional.You can use the
app_nameparameter to change the application name of the ODP. The default value isundefined.-ospecifies 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_nameparameter specifies the name of OceanBase cluster.
Example:
$./bin/obproxy -r'10.10.10.1:26506;10.10.10.2:26506' -n test -c myclusterSpecify the
obproxy_config_server_urlparameter in the startup commandSyntax:
$./bin/obproxy -p6789 -e -n appname -o obproxy_config_server_url='your_config_url'Parameters:
-pspecifies the listening port of 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.-especifies 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.-nspecifies the application name.You can use the
app_nameparameter to change the application name of the ODP. The default value isundefined.-ospecifies 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_urlparameter specifies the URL of the Config Server.
Example:
$./bin/obproxy -n test -o obproxy_config_server_url='http://xx.xx.xx.xx:8877/obproxy_config'
Run the following command to check whether the obproxy process exists:
$ps -ef|grep obproxy