obd has multiple levels of commands. You can use the -h/--help option at each level to view the help information of subcommands. Similarly, when a subcommand at any level fails to execute, you can use the -v/--verbose option to view the detailed execution process of the command.
obd mirror clone
You can use this command to copy an RPM package to the local mirror. After the mirror is created, you can use the related commands of the obd cluster to start the mirror.
obd mirror clone <path> [-f]
The path parameter specifies the path of the RPM package.
The -f option specifies --force. -f is an optional option and is disabled by default. If you enable this option, the existing mirror will be forcibly overwritten if it already exists.
obd mirror list
You can use this command to display the list of mirrors or the list of images in a mirror.
obd mirror list [mirror repo name]
The mirror repo name parameter specifies the name of the mirror repository. This parameter is optional. If this parameter is not specified, the list of mirror repositories will be displayed. If this parameter is specified, the list of images in the specified mirror repository will be displayed.
obd mirror update
You can use this command to synchronize the information of all remote mirror repositories.
obd mirror update
obd mirror disable
You can use this command to disable a remote mirror repository. To disable all remote mirror repositories, run the obd mirror disable remote command.
obd mirror disable <mirror repo name>
The mirror repo name parameter specifies the name of the mirror repository to be disabled. If this parameter is specified as remote, all remote mirror repositories will be disabled.
obd mirror enable
You can use this command to enable a remote mirror repository.
obd mirror enable <mirror repo name>
The mirror repo name parameter specifies the name of the mirror repository to be enabled. If this parameter is specified as remote, all remote mirror repositories will be enabled.
obd mirror add-repo
You can use this command to add a remote mirror repository file to the local environment.
obd mirror add-repo <url>
The url parameter specifies the download address of the image file to be added.
obd mirror create
You can use this command to create a mirror based on a local directory. This command is mainly used to start a self-compiled OceanBase Database by using obd. You can use this command to add the compiled products to the local repository and then use the related commands of obd cluster to start the mirror.
obd mirror create -n <component name> -p <your compile dir> -V <component version> [-t <tag>] [-f]
For example, if you compile OceanBase Database based on the documentation Build OceanBase Database from source code, you can run the make DESTDIR=./ install && obd mirror create -n oceanbase-ce -V <component version> -p ./usr/local command after the compilation is completed to add the compiled products to the obd local repository.
The following table describes the options.
Option |
Required? |
Data type |
Description |
|---|---|---|---|
| -n/--name | Yes | string | The name of the component. If you compile OceanBase Database, set this option to oceanbase-ce. If you compile ODP, set this option to obproxy-ce. |
| -p/--path | Yes | string | The directory in which you run the compilation command. obd automatically obtains the required files from this directory. By default, this directory is the current directory. |
| -V/--version | Yes | string | The version number. |
| -t/--tag | No | string | The tag of the image. You can define multiple tags for the image created by using this command, and separate the tags with commas (,). |
| -f/--force | No | bool | If this option is specified, the existing image or tag will be forcibly overwritten. This option is disabled by default. |
obd mirror clean
You can use this command to clean up the specified files that have been downloaded to the local machine (the ~/.obd/mirror directory) and installed by using obd (the ~/.obd/repository directory).
obd mirror clean [options]
Note
If no option is specified, obd will clean up all unused components and ensure that only the latest version of each component is retained. The latest RPM package is determined based on the version number.
Except for the
--hashoption, each option will clean up all files except the latest version and the currently used version that meet the option conditions.
The following table describes the options.
Option |
Required? |
Data type |
Description |
|---|---|---|---|
| -c/--components | No | string | The name of the component. obd will clean up all packages of the component except the latest version and the currently used version in the ~/.obd/mirror and ~/.obd/repository directories. The latest RPM package is determined based on the version number. If multiple values are specified, separate them with commas (,). |
| -t/--type | No | string | The value can be rpm or repository. If this option is set to rpm, only the files in the ~/.obd/mirror directory will be cleaned up. If this option is set to repository, only the files in the ~/.obd/repository directory will be cleaned up. |
| --hash | No | string | The hash value of the installation package. obd will clean up the files in the ~/.obd/mirror and ~/.obd/repository directories that have the specified hash value. If multiple values are specified, separate them with commas (,).
NoteYou can specify the |
| -y/--confirm | No | bool | Specifies whether to perform a confirmation. |
obd repo list
You can use this command to display the list of repositories stored in obd.
obd repo list
After you run this command, the list of packages installed by using obd will be displayed. Here is an example:
+-------------------------------------------------------------------------------------------------------------------------------------------+
| Local Repository List |
+---------------------------+---------+------------------------+--------+------------------------------------------+--------------+---------+
| name | version | release | arch | md5 | tags | size |
+---------------------------+---------+------------------------+--------+------------------------------------------+--------------+---------+
| oceanbase-ce | 4.3.5.2 | 102030022025073116.el8 | x86_64 | 1148a1174464e514a61892eaf2317f86e4acd0a7 | oceanbase-ce | 916.81M |
| oceanbase-diagnostic-tool | 3.5.0 | 12025062011.el7 | x86_64 | 4e0f91ad1b57072139161cdc89e8cbd42e01e984 | | 68.39M |
| oceanbase-diagnostic-tool | 3.6.0 | 22025080417.el7 | x86_64 | ce431826e5571a6e00d81b9849e32eb53991169f | | 68.52M |
+---------------------------+---------+------------------------+--------+------------------------------------------+--------------+---------+
