This topic describes how to deploy OceanBase Admin Toolkit (OAT) in a Docker container.
Prerequisites
Before you deploy OAT, make sure that the following conditions are met:
Your operating system meets the conditions described in the following table:
Server type Operating system Supported version x86_64 or ARM aarch64 Red Hat Enterprise Linux (RHEL) and its compatible operating systems such as Rocky Linux and CentOS 7.2 and later x86_64 or ARM aarch64 Anolis and its compatible operating systems such as Alibaba Cloud Linux, Kylin V10, Unity Operating System (UOS), BC-Linux of China Mobile, Linx OS, and NFSChina 8.4 and later x86_64 or ARM AArch64 Debian and its compatible operating systems such as Ubuntu 11 and later x86_64 or ARM AArch64 openSUSE 12SP3 and later x86_64 or ARM AArch64 openSUSE 12SP3 and later x86_64 or ARM AArch64 Linx V6.0.99 and later If you use the OAT image package to install OAT, you must install and start Docker. Docker Community Edition 18.09.9 or later is recommended.
Note
If you use the oat-all-in-one installation package to deploy OAT, the
install.shscript in theoat-all-in-onepackage automatically installs Docker. You do not need to install Docker separately.The default port
7000of OAT is not occupied.
Use the oat-all-in-one installation package to install OAT
Note
We recommend that you use the oat-all-in-one installation package to install OAT.
You can obtain the oat-all-in-one installation package of OAT from OceanBase Download Center > Enterprise Edition > OceanBase Admin Tool. If you cannot find the required installation package, contact technical support.
Perform the following steps to install OAT:
Decompress the oat-all-in-one installation package.
Example:
tar -xf oat-all-in-one-arm-430.tarRun the installation script
install.sh.Example:
sh oat-all-in-one-arm/install.shThis command automatically installs Docker (if Docker is not installed in your environment), deploys OAT, and scans the images and tool packages contained in oat-all-in-one.
As prompted, confirm or specify the following information in sequence:
- Enter the root directory of Docker. We recommend that you specify a dedicated mount directory. The default directory is
/docker. You do not need to manually create this directory. You can customize this directory. If Docker is already installed, this step is skipped. - Enter the data directory of OAT. The default directory is
/oat_data. You do not need to manually create this directory. You can customize this directory. - Enter the HTTP listening port of OAT. The default port is
7000. You can customize this port. - Enter the database port of OAT. The default port is
3306. You can customize this port. - Enter the password of the OAT administrator account (the initial login password). You can customize this password.
- Use the returned URL to access OAT and verify the availability of OAT.
Example:
Note
In this example, Docker has been installed on the server. Therefore, Docker is not installed again during this installation.
Change the data directory of OAT to
/data/oat_data, and then press Enter.Input the OAT data dir: /data/oat_dataUse the default HTTP listening port of OAT and press Enter.
Input the OAT HTTP listen port: 7000Use the default database port of OAT and press Enter.
Input the OAT database port: 3306Change the password of the OAT administrator account
admin(the initial login password) and press Enter.
Input the OAT admin user password(login password): ******- Use the returned URL to access OAT and verify the availability of OAT.
The following output is returned:
Start prepare docker Docker is already exists, start check... Already installed docker check healthy, skip install docker Start prepare OAT Loaded image: xxx/oceanbase/oat:4.3.0_20241025_arm 45fd5a9b31b0af6aeb07b3e485503ad4c64629170b91d1d3c9e8128e8e532125 check OAT url http://127.0.0.1:7000/hc OAT API not ready, please wait, sleep 5s retry... OAT API not ready, please wait, sleep 5s retry... OAT API not ready, please wait, sleep 5s retry... OAT API not ready, please wait, sleep 5s retry... OAT API not ready, please wait, sleep 5s retry... OAT API not ready, please wait, sleep 5s retry... OAT API ready Copy images and binary_packages to OAT data dir Trigger OAT scan api to find images and binary_packages Trigger scan task success, please visit OAT web site and wait for scan task finished OAT is ready for visit url is: http://<current_ip>:7000 user/password is: admin/******- Enter the root directory of Docker. We recommend that you specify a dedicated mount directory. The default directory is
Note
- By default, the
install.shscript starts the OAT container in host network mode by using--net host. If you want to use another network mode, start the container manually by using the OAT image. - The
oat-all-in-oneinstallation package for the x86 (aarch64) architecture contains only the images and software packages for the x86_64 (aarch64) and noarch architectures. If you need images and software packages for the aarch64 (x86_64) architecture, download them and copy them to the directory mounted to the OAT container, and then initiate a scan task to add them.
Use the OAT Docker image to install OAT
Obtain the installation package of OAT.
Note
Contact OAT technical support to obtain the installation package.
Run the
scpcommand to upload the OAT installation package to the server.Here,
oat_serverspecifies the IP address of the server on which OAT is deployed.scp oat.tgz <oat_server_user>@<oat_server_ip>:~/Example:
scp oat_4.3.0_20241025_arm.tgz root@xxx.xxx.xxx.xxx:/home/admin/oat_rpmMount the OAT directory.
Create a directory named
/data_diron the server (you can customize the path;/data_diris used as an example in this topic) to store persistent data of OAT.After
/data_diris mounted to the OAT container, OAT automatically creates the/data_dir/logs,/data_dir/images, and/data_dir/dbdirectories for storing OAT system logs, Docker images of components and products, and database files of OAT.mkdir -p /data_dirLoad the OAT installation package as an image.
docker load -i oat_xxx_xxxxxxxx_xxx.tgzHere,
oat_xxx_xxxxxxxx_xxx.tgzis the name of the installation package.Example:
docker load -i oat_4.3.0_20241025_arm.tgzThe following result is returned:
Loaded image: xxx/oceanbase/oat:4.3.0_20241025_armRun the
docker imagescommand to obtain the tag of the OAT image.Note
If only one OAT installation package is loaded, you can run the sample command. If multiple installation packages are loaded, run the
docker imagescommand to view the displayed content and connect the first two columns with a colon (:).oat_image=`docker images | grep oat | awk '{printf $1":"$2"\n"}'`Run the
docker runcommand to start OAT.Here,
$oat_imagespecifies the tag of the OAT image.docker run -d --net host --name oat -v /data_dir:/data -e OAT_INITIAL_ADMIN_PASSWORD=xxx --restart on-failure:5 $oat_imageNote
The default HTTP listening port of OAT is 7000. You can specify the
-e HTTP_PORT=7001parameter to modify the port.You can specify the
-e OAT_INITIAL_ADMIN_PASSWORD=xxxparameter to change the password of OAT.By default, the built-in MariaDB of OAT listens on port 3306. You can specify the
-e DB_PORT=3307parameter to modify the port.We recommend that you start OAT by specifying the
--net hostparameter because a container started in bridge mode can be affected bydocker0bridge failures or theip_forwardparameter of the operating system.
Example:
docker run -d --net host --name oat -v /data_dir:/data -e OAT_INITIAL_ADMIN_PASSWORD=****** --restart on-failure:5 $oat_imageThe following result is returned:
490344724bfcb2801da271196ebc38b5c15547b796178dc7660553ae62b668c2After OAT is started, enter
http://<oat_server_ip>:7000in the address bar of the browser.Here,
<oat_server_ip>specifies the IP address of the server on which OAT is deployed.If the login page appears, OAT is installed and started.