This topic describes three methods for installing obd: installing obd with OceanBase All in One, installing obd with RPM packages, and installing obd from source code.
Prerequisites
The operating system of the server where you run the commands must meet the requirements.
Install obd
OceanBase Database V4.0.0 and later provide a unified installation package called OceanBase All in One. This package includes OceanBase Database, OCP, obd, OBProxy (also known as ODP), OBClient, Prometheus, Grafana, and diagnostic and testing tools.
Note
The products included in OceanBase All in One vary by series. OCP is included in the V4.3.x series starting from V4.3.3, in the V4.2.x series starting from V4.2.5, and in the V4.2.1 series starting from V4.2.1_CE_BP9_HF1.
We recommend that you install obd by using OceanBase All in One. This package provides all the components required for deployment (except for the obbinlog component), and the components have been tested for compatibility. This is the recommended version by OceanBase Database.
If your server can connect to the Internet, run the following command to install obd online. After the installation is completed, a tmp.xxx folder is created in the /tmp directory as the installation directory, for example, tmp.jvzpVREAs9.
[admin@test001 ~]$ bash -c "$(curl -s https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/download-center/opensource/oceanbase-all-in-one/installer.sh)"
[admin@test001 ~]$ source ~/.oceanbase-all-in-one/bin/env.sh
If your server cannot connect to the Internet, perform the following steps to install obd offline.
Download the latest OceanBase All in One from OceanBase Download Center and copy it to the control server. We recommend that you use the latest version of the installation package.
Run the following command in the directory where the installation package is stored to decompress and install the package.
[admin@test001 ~]$ tar -xzf oceanbase-all-in-one-*.tar.gz [admin@test001 ~]$ cd oceanbase-all-in-one/bin/ [admin@test001 bin]$ ./install.sh [admin@test001 bin]$ source ~/.oceanbase-all-in-one/bin/env.sh
Note
When you install obd by using OceanBase All in One, the install.sh script will attempt to install obd as the root user by default. If you do not have the sudo privilege, you can enter the password of the current user at the password prompt or press the Enter key three times, and then enter n to install obd as the current user. The installation directory varies based on the user and privilege. The following two cases are described.
- If you use the root user or an ordinary user with administrator privileges (such as
sudo), the installation directory of the obd executable file is/usr/bin/obd. - If you use an ordinary user, the installation directory of the obd executable file is
~/.oceanbase-all-in-one/obd/usr/bin/obd.
Depending on whether your server can connect to the Internet, you can install obd by using the following two methods: Online installation and Offline installation. Note that when you install obd by using an RPM package, only obd is installed. If your server can connect to the Internet, obd will access a remote image source to obtain the installation packages required for cluster deployment. If your server cannot connect to the Internet, after obd is installed, you must manually configure the local image source for obd.
If your server can connect to the Internet, run the following command to install obd online on CentOS or Red Hat systems.
[admin@test001 ~]$ sudo yum install -y yum-utils
[admin@test001 ~]$ sudo yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo
[admin@test001 ~]$ sudo yum install -y ob-deploy
[admin@test001 ~]$ source /etc/profile.d/obd.sh
Note
The YUM command will install the latest version by default. You can specify the version by declaring the version number. For example, you can run the yum install -y ob-deploy-1.6.2 command to install obd V1.6.2. We recommend that you install the latest version.
If your server cannot connect to the Internet, you can download the obd installation package and the installation packages of the components required for cluster deployment from OceanBase Download Center. We recommend that you download the latest version of the installation package. After the installation package is downloaded, copy it to your server.
On CentOS or Red Hat systems, run the following command to install obd:
sudo yum install ob-deploy-*.rpm
On Ubuntu or Debian systems, run the following command to install obd:
sudo alien --scripts -i ob-deploy-*.rpm
If you have already downloaded the installation packages of the required components from the official website OceanBase Download Center, you can follow the steps below to add the installation packages to the local image source of obd.
You can perform the following steps as the user who deploys and runs obd. In this example, the user is admin.
Run the following command to disable the remote repository:
obd mirror disable remoteAfter the remote repository is disabled, you can run the
obd mirror listcommand to check whether theEnabledcolumn of the row corresponding to Type=remote isFalse. If so, the remote image source is disabled. Example:+-----------------------------------------------------------------------------+ | Mirror Repository List | +----------------------------+--------+---------+----------+------------------+ | SectionName | Type | Enabled | Avaiable | Update Time | +----------------------------+--------+---------+----------+------------------+ | local | local | - | True | 2025-02-19 15:56 | | oceanbase.community.stable | remote | False | False | 2025-02-19 15:54 | | oceanbase.development-kit | remote | False | False | 2025-02-19 15:54 | +----------------------------+--------+---------+----------+------------------+Run the following command in the directory where the installation package is stored to upload the installation package to the local repository:
obd mirror clone *.rpmRun the following command to view the list of installation packages in the local repository:
obd mirror list localIf the installation packages required for deployment are displayed in the output, the upload is successful.
Before you install obd by using the source code, make sure that the following dependencies are installed:
gcc
wget
python-devel
openssl-devel
xz-devel
mysql-devel
To compile and install obd by using the source code, you need to use Python 2.7 and Python 3.8 environments. The installation steps are as follows:
Run the following command in the Python 2.7 environment.
sh rpm/build.sh executerNote
The preceding command is used to compile the interpreter required for OceanBase Database upgrades. If you do not use the upgrade feature, you can skip this command.
Run the following command in the Python 3.8 environment.
sh rpm/build.sh build_obd source /etc/profile.d/obd.sh
Note
obd V2.0.0 and later do not support installation by using the source code in a Python 2 environment.
References
Uninstall OceanBase All in One
To uninstall OceanBase All in One, perform the following steps:
Uninstall the installation package
To uninstall OceanBase All in One, run the
uninstall.shscript in the installation directory. The default installation directory for online installation is/tmp/tmp.xxxx/oceanbase-all-in-one, and the default installation directory for offline installation is~/oceanbase-all-in-one.[admin@test001 ~]$ cd oceanbase-all-in-one/bin/ [admin@test001 bin]$ ./uninstall.shDelete the environment variables
[admin@test001 bin]$ vim ~/.bash_profile # Delete the line source /home/admin/.oceanbase-all-in-one/bin/env.sh from this file.Make the changes take effect
After deleting the environment variables, you need to log in to the terminal again or execute the source command to make the changes take effect. You can refer to the following command.
[admin@test001 ~]$ source ~/.bash_profile
Upgrade OceanBase All in One
To use the new version of OceanBase All in One, perform the following steps:
Uninstall the original OceanBase All in One
To uninstall OceanBase All in One, run the
uninstall.shscript in the installation directory. The default installation directory for online installation is/tmp/tmp.xxxx/oceanbase-all-in-one, and the default installation directory for offline installation is~/oceanbase-all-in-one.[admin@test001 ~]$ cd oceanbase-all-in-one/bin/ [admin@test001 bin]$ ./uninstall.shInstall the new OceanBase All in One
[admin@test001 ~]$ bash -c "$(curl -s https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/download-center/opensource/oceanbase-all-in-one/installer.sh)"This command installs the latest version of OceanBase All in One by default. If you have specific requirements for the OceanBase All in One version, you can upgrade OceanBase All in One by following the steps in Offline upgrade.
Obtain the new installation package
Visit OceanBase Download Center, search for OceanBase Community Edition One-Click Installation Package, download the required installation package based on your actual situation, and copy it to any directory on the control node.
Uninstall the original OceanBase All in One
To uninstall OceanBase All in One, run the
uninstall.shscript in the installation directory. The default installation directory for online installation is/tmp/tmp.xxxx/oceanbase-all-in-one, and the default installation directory for offline installation is~/oceanbase-all-in-one.[admin@test001 ~]$ cd oceanbase-all-in-one/bin/ && bash uninstall.shClear the original OceanBase All in One installation directory
This step is only required for offline installation. Clearing the original OceanBase All in One installation directory is to avoid conflicts when decompressing the new installation package.
[admin@test001 ~]$ rm -rf ~/oceanbase-all-in-oneDecompress the new installation package
[admin@test001 ~]$ tar -xzf oceanbase-all-in-one-*.tar.gzInstall the new OceanBase All in One
Run the install.sh script in the installation directory of OceanBase All in One to start the installation program.
[admin@test001 bin]$ cd oceanbase-all-in-one/bin/ && bash install.sh
References
If you installed obd by using an RPM package, you can refer to Upgrade obd for the procedure.
