OceanBase Deployer (obd) provides a series of tool commands, including general commands that deliver a better experience for developers.
You can use the -h/--help option to view the help information of sub-commands. Similarly, you can also use -v/--verbose to view the detailed execution process of commands when the execution of sub commands reports an error.
obd devmode enable
You can run this command to enable the developer mode, which is a prerequisite for using other tool commands. After you enable the developer mode, obd will downgrade the level of some exceptions and ignore some parameter exceptions. If you are not a kernel developer, use this command with caution.
obd devmode enable
obd devmode disable
You can run this command to disable the developer mode.
obd devmode disable
obd env show
You can run this command to display the environment variables of obd.
obd env show
obd env set
You can run this command to set the environment variables of OceanBase Deployer (obd). Environment variables can affect the performance of obd. Therefore, we recommend that you use this command only when necessary.
obd env set [key] [value]
The following table describes the environment variables of obd.
| Environment variable | Value range | Description |
|---|---|---|
| OBD_DISABLE_RSYNC | {0, 1} | Specifies whether to disable the rsync command. obd allows you to run the rsync command for remote data transmission when the prerequisites are met. If this environment variable is set to 1, the rsync command is disabled. |
| OBD_DEV_MODE | {0, 1} | Specifies whether to enable the developer mode. |
| TELEMETRY_MODE | {0, 1} | Specifies whether to enable the telemetry mode. |
| TELEMETRY_LOG_MODE | {0, 1} | Specifies whether to enable telemetry data logging. |
| IO_DEFAULT_CONFIRM | {0, 1} | Specifies whether to enable automatic confirmation. obd requires you to reconfirm the execution of some commands before the execution. If this environment variable is set to 1, the execution is automatically confirmed for all subsequent commands. |
| ENV_LOCK_MODE | {0, 1, 2} | The lock level. obd provides the following three types of locks: mirror repository locks, deployment configuration locks, and global locks. By default, obd uses shared global locks, exclusive deployment configuration locks, and shared mirror repository locks. When you run the obd mirror and obd cluster deploy commands, shared mirror repository locks are changed to exclusive mirror repository locks. The default value of this variable is 2. Valid values are described as follows:
|
| OBD_DISABLE_RSA_ALGORITHMS | {0, 1} | Specifies whether to disable the rsa-sha2-512 and rsa-sha2-256 algorithms for logging in to OBServer nodes. |
| OBD_INSTALL_PRE | N/A | The parent directory for installing obd. The default value is /, which indicates the root directory. |
| OBD_INSTALL_PATH | N/A | The installation directory of obd. If this environment variable is not specified, the value of OBD_INSTALL_PRE is automatically concatenated with usr/obd/ to form the installation directory. |
obd env unset
You can run this command to delete the specified environment variable.
obd env unset [key] [value]
obd env clear
You can run this command to clear environment variables of obd. Use this command with caution.
obd env clear
obd tool command
You can use this command to run some general commands.
obd tool command <deploy name> <command> [options]
Valid values of the command field:
pid: allows you to view the process ID (PID) of a service. This is a non-interactive command.ssh: allows you to log on to the specified server and enter the log directory. This is an interactive command.less: allows you to view the logs of the specified service. This is an interactive command.gdb: allows you to attach GNU Debugger (GDB) to a template service. This is an interactive command.
The following table describes the options of the command.
| Option | Required | Data type | Default value | Description |
|---|---|---|---|---|
| -c/--components | No | String | In an interactive command, the first component specified in the configuration file is used by default. In a non-interactive command, all components are used. | The name of the component on which the command is executed. Separate multiple component names with commas (,). |
| -s/--servers | No | String | In an interactive command, the first node of the current component specified in the configuration file is used by default. In a non-interactive command, all available nodes are used. | The name of the node under the specified component. Separate multiple node names with commas (,). |
obd tool db_connect
You can run this command to create a connection to the database.
obd tool db_connect <deploy name> [options]
The deploy name parameter indicates the name of the deployed cluster, which is also the alias of the configuration file.
The following table describes the options of the command.
| Option | Required | Data type | Default value | Description |
|---|---|---|---|---|
| -c or --component | No | String | By default, the first component specified in the configuration file is used. | The name of the component to be connected. Valid values: obproxy, obproxy-ce, oceanbase, and oceanbase-ce. |
| -s or --server | No | String | By default, the first node of the current component specified in the configuration file is used. | The name of the node under the specified component. |
| -u or --user | No | String | root | The username for connecting to the database. |
| -p or --password | No | String | Empty | The password for connecting to the database. |
| -t or --tenant | No | String | sys | The tenant for connecting to the database. |
| -D or --database | No | String | Empty | The name of the database to be connected. |
| --obclient-bin | No | String | obclient | The path to the directory where the binary files of OBClient are stored. |
obd tool list
You can use this command to display tools installed by using OceanBase Deployer (obd).
obd tool list
obd tool install
You can use this command to install tools by using obd. At present, you can use this command to install only OceanBase Client (OBClient) and obdiag.
obd tool install <tool name> [options]
The tool name parameter specifies the name of the tool to be installed. Valid values are obclient and obdiag.
The following table describes the options.
| Option | Required | Data type | Default value | Description |
|---|---|---|---|---|
| -V/--version | No | String | The latest version | The version of the tool to be installed. |
| -p/--prefix | No | String | The home directory of the current user | The path where the tool is to be installed. |
| -y/--assumeyes | No | Boolean | false | Specifies whether to automatically skip issues that occur during the installation. |
| -f/--force | No | Boolean | false | Specifies whether to forcibly install the tool in the case of conflicts. |
obd tool uninstall
You can use this command to uninstall a tool that is installed by using obd.
obd tool uninstall <tool name> [options]
The tool name parameter specifies the name of the tool to be uninstalled. Valid values are obclient and obdiag.
The following table describes the options.
| Option | Required | Data type | Default value | Description |
|---|---|---|---|---|
| -y/--assumeyes | No | Boolean | false | Specifies whether to automatically skip issues that occur during the uninstallation. |
| -f/--force | No | Boolean | false | Specifies whether to forcibly uninstall the tool in the case of conflicts. |
obd tool update
You can use this command to upgrade a tool that is installed by using obd.
obd tool update <tool name> [options]
The tool name parameter specifies the name of the tool to be upgraded. Valid values are obclient and obdiag.
The following table describes the options.
| Option | Required | Data type | Default value | Description |
|---|---|---|---|---|
| -V/--version | No | String | The latest version | The target version to which the tool is to be upgraded. |
| -p/--prefix | No | String | The current installation address of the tool | The installation path of the tool after the upgrade. |
| -y/--assumeyes | No | Boolean | false | Specifies whether to automatically skip issues that occur during the upgrade. |
| -f/--force | No | Boolean | false | Specifies whether to forcibly upgrade the tool in the case of conflicts. |
obd display-trace
You can run this command to display the details of logs corresponding to the specified task ID to facilitate log search.
obd display-trace <trace_id>
# example
obd display-trace 080b8ffc-9f7c-11ed-bec1-00163e030e58
The trace_id parameter specifies the task ID. After you run another obd command, the corresponding task ID is generated, and a prompt is displayed to show you how to view the task ID. Here is an example.
[admin@centos7 ~]$ obd cluster list
Local deploy is empty
Trace ID: a3cf9020-be42-11ed-b5b0-00163e030e58
If you want to view detailed obd logs, please run: obd display-trace a3cf9020-be42-11ed-b5b0-00163e030e58