This topic describes how to use agent commands to manage OceanBase Shell (obshell). You can specify the -h or --help option in a command to query its help information.
obshell agent start
You can run this command to start obshell.
${home_path}/bin/obshell agent start [--ip] [-P] [--takeover]
# example
/home/admin/oceanbase/bin/obshell agent start --ip 10.10.10.1 -P 2886
Here, home_path specifies the installation directory of OceanBase Database. By default, OBShell is installed in the bin directory under the installation directory of OceanBase Database.
The following table describes the options in the command.
| Option | Required? | Data type | Default value | Description |
|---|---|---|---|---|
| --ip | No | String | N/A | The IP address of obshell. |
| -P/--port | No | Integer | 2886 | The port number of obshell. |
| --takeover | No | Integer | 1 | Specifies whether to take over the OceanBase cluster. The value 0 indicates not to take over, and other values, including the default value 1, indicate to take over. |
obshell agent stop
You can run this command to stop obshell.
${home_path}/bin/obshell agent stop
Here, home_path specifies the installation directory of OceanBase Database. By default, obshell is installed in the bin directory under the installation directory of OceanBase Database.
obshell agent restart
You can run this command to restart obshell.
${home_path}/bin/obshell agent restart
Here, home_path specifies the installation directory of OceanBase Database. By default, obshell is installed in the bin directory under the installation directory of OceanBase Database.
obshell agent upgrade
You can run this command to upgrade obshell.
${home_path}/bin/obshell agent upgrade -d [-V] [-t] [-y]
# example
/home/admin/oceanbase/bin/obshell agent upgrade -d /home/admin/oceanbase/upgrade/ -V 4.2.2.0-20231224224959
Here, home_path specifies the installation directory of OceanBase Database. By default, obshell is installed in the bin directory under the installation directory of OceanBase Database.
The following table describes the options in the command.
| Option | Required? | Data type | Default value | Description |
|---|---|---|---|---|
| -d/--pkg_directory | Yes | String | N/A | The storage path to the upgrade packages. |
| -V/--target_version | No | String | N/A | The target version. You must specify the version in a valid format, such as 4.2.2.0 or 4.2.2.0-20231224224959. If you do not specify this option, the latest obshell RPM package in the directory specified by -d is used. |
| -t/--tmp_directory | No | String | ${home_path}/upgrade | The temporary directory to use during the upgrade, which stores the downloaded packages and all files generated during decompression and installation. It must be an absolute path. |
| -y/--yes | No | N/A | N/A | Specifies to cancel secondary confirmation. You do not need to set a value for this option. |
| -v/--verbose | No | N/A | N/A | Specifies to return execution details. You do not need to set a value for this option. |