Install obd

2025-03-21 09:00:59  Updated

This topic describes how to install OceanBase Deployer (obd) by using the OceanBase All in One package, an RPM package, or source code.

Prepare the environment

Make sure that the operating system of your server is supported. For more information about the supported operating systems, see the Hardware resources section in Software and hardware requirements.

Install obd

(Recommend) Install obd by using the OceanBase All in One package
Install obd by using an RPM package
Install obd by using source code

OceanBase Database V4.0.0 and later provide the OceanBase All in One package. You can use this package to install OceanBase Database, OceanBase Cloud Platform (OCP), obd, OceanBase Database Proxy (ODP), OceanBase Command-Line Client (OBClient), OCP Express (supported in V4.1.0 or later), Prometheus, Grafana, and OceanBase Diagnostic Tool (obdiag) at a time.

Note

  • The components provided by the OceanBase All in One package vary with the series. In the V4.3.x series, OCP is provided in V4.3.3 and later. In the V4.2.x series, OCP is provided in V4.2.5 and later. In the V4.2.1 series, OCP is provided in V4.2.1_CE_BP9_HF1 and later.

  • We recommend that you download the OceanBase All in One package for deployment. The package provides all required components (except obbinlog) of the recommended versions, and the components have passed adaptation tests.

Online installation
Offline installation

If your server can connect to the Internet, run the following commands to perform online installation. After the installation is complete, a tmp.xxx folder, such as tmp.jvzpVREAs9, is created as the installation directory under /tmp.

[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 the components offline:

  1. Download the latest OceanBase All in One package from OceanBase Download Center and copy it to the central control server. We recommend that you download the latest version.

  2. In the directory where the package is located, run the following commands 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 the OceanBase All in One package, the install.sh script attempts to install the package by using a user with the administrator privileges. If the current user does not have sudo privileges, you can enter the password of the current user in the password text box or press the Enter key three times when prompted, and then type n to use the current user for installation.

  • If you install obd as the root user or a regular user with sudo privileges, the executable file of obd is stored in the /usr/bin/obd directory after the installation.
  • If you install obd as a regular user, the executable file of obd is stored in the ~/.oceanbase-all-in-one/obd/usr/bin/obd directory after the installation.

You can install obd online or offline, depending on whether your server can connect to the Internet. You can install obd alone by using an RPM package. If your server can connect to the Internet, obd automatically obtains the required installation packages from a remote image source. If your server cannot connect to the Internet, you must configure a local image repository for obd after it is installed.

Online installation
Offline installation

If your server can connect to the Internet and runs on CentOS or RedHat, you can run the following commands to install obd online:

[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 automatically installs the latest version. You can declare a version number to install the specified version. For example, if you use the yum install -y ob-deploy-1.6.2 command to install obd, obd V1.6.2 will be installed. We recommend that you install the latest version.

If your server cannot connect to the Internet, you can download the installation packages for obd and the required components from OceanBase Download Center. We recommend that you download the latest version. Then, copy the downloaded packages to your server.

To install obd on CentOS or RedHat, run the following command:

sudo yum install ob-deploy-*.rpm

To install obd on Ubuntu or Debian, run the following command:

sudo alien --scripts -i ob-deploy-*.rpm

After you install obd and download the installation packages for the required components from OceanBase Download Center, perform the following steps to add the installation packages to the local image repository of obd.

You can perform the following steps as the system user that deployed obd. In this example, the admin user is used.

  1. Run the following command to disable remote repositories:

    obd  mirror disable remote
    

    Run the obd mirror list command to confirm whether the remote repositories are disabled. If the values of the remote repositories in the Enabled column are changed to False, the remote image sources are disabled.

  2. In the directory where the installation package is located, run the following command to upload the installation package to the local repository:

    obd mirror clone *.rpm
    
  3. View the list of installation packages in the local repository.

    obd mirror list local
    

    If the desired installation package is in the list, the installation package is uploaded.

Before you use source code to install obd, make sure that the following dependencies are installed:

  • gcc

  • wget

  • python-devel

  • openssl-devel

  • xz-devel

  • mysql-devel

To compile source code to build obd, you must perform the following steps in the Python 2.7 and Python 3.8 environments:

  1. Run the following command in Python 2.7:

    sh rpm/build.sh executer
    

    Note

    The preceding command compiles the interpreter needed in OceanBase Database upgrades. If no upgrade is needed, skip this step.

  2. Run the following commands in Python 3.8:

    sh rpm/build.sh build_obd
    source /etc/profile.d/obd.sh
    

Note

obd V2.0.0 and later cannot be installed by using source code in Python 2.

Uninstall the OceanBase All in One package

To uninstall the OceanBase All in One package, perform the following steps:

  1. Uninstall the package.

    You need to run the uninstall.sh script in the installation directory of the OceanBase All in One package. The default installation directory for online installation is /tmp/tmp.xxxx/oceanbase-all-in-one, and that for offline installation is ~/oceanbase-all-in-one.

    [admin@test001 ~]$ cd oceanbase-all-in-one/bin/
    [admin@test001 bin]$ ./uninstall.sh
    
  2. Delete environment variables.

    [admin@test001 bin]$ vim ~/.bash_profile
    # Delete the source /home/admin/.oceanbase-all-in-one/bin/env.sh from the file.
    
  3. Make the modification take effect.

    After you delete the environment variables, you must log in to the terminal again or run the source command to make the modification take effect. Here is an example:

    [admin@test001 ~]$ source ~/.bash_profile
    

Contact Us