After OBProxy is deployed, you can run a command to start a single obproxy process.
Prerequisites
You have deployed OBProxy. For more information about OBProxy deployment, see (Optional) Deploy OBProxy.
Background information
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 AI Database 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 AI Database 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 OBProxy.
Procedure
Log in as the admin user to the server that hosts the OBProxy to be started.
Notice
To start OBProxy, log in as the admin user and run the startup command in the home directory of the OBProxy software. The OBProxy startup fails if you log in as another user or run the startup command in another directory.
Go to the OBProxy installation directory.
Run the following command:
Note
Before you start OBProxy, you can run the
./bin/obproxy -hcommand to view the parameters related to OBProxy startup.Specify the
-rparameter in the startup commandThe syntax of the command is as follows:
$./bin/obproxy -p6789 -r'ip:port' -e -n appname -o obproxy_config_server_url='' -c cluster_nameThe parameters are described as follows:
-pspecifies the port number listened to by OBProxy. The MySQL client uses this port to access OceanBase AI 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 OceanBase AI Database 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 OBProxy. You do not need to specify the parameter in subsequent startups or upgrades.-nspecifies the application name of the OBProxy to be started. This parameter is optional.You can use the
app_nameparameter to change the application name of OBProxy. 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 the OceanBase AI Database cluster.
Here is an 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 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:
-pspecifies the port number listened to by OBProxy. The MySQL client uses this port to access OceanBase AI 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 OBProxy. 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 OBProxy. 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.
Here is an 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