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 You have installed and started Docker. Docker Community Edition 17.03 or later is recommended. If you use the oat-all-in-one installation package to deploy OAT, the
install.shscript in the package will automatically install Docker.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.
The oat-all-in-one package provides images of Docker 18.09.9, OAT V4.2.0, MetaDB V4.2.1, and Network Load Balancer (NLB) 4.0.0, and software packages of common tools. To obtain the oat-all-in-one installation package, go to OceanBase Download Center and click a version based on your business requirements in the OceanBase Administrator Tool card. Then, perform the following steps to install OAT:
- Decompress the oat-all-in-one installation package.
tar -xf oat-all-in-one-x86.tar
- Run the installation script
install.sh.
sh oat-all-in-one-x86/install.sh
If Docker is not installed in your environment, this command automatically installs Docker, deploys OAT to Docker, and scans for existing images and tool packages. 3. Specify the root directory of Docker and the data directory, HTTP listening port, database port, and initial login password of OAT as prompted. You do not need to manually create the specified directories. By default, the HTTP listening port of OAT is 7000 and the database port of OAT is 3306. 4. Use the returned URL to access OAT and verify the availability of OAT.
Note
By default, the
install.shscript starts the OAT container in host network mode by using--net host. If you want to use another mode, download the OAT container and start it manually.By default, the
oat-all-in-oneinstallation package for x86 contains only the images and software packages for the x86_64 and Noarch architectures, and theoat-all-in-oneinstallation package for AArch64 contains only the images and software packages for AArch64 and Noarch architectures. If you have only the oat-all-in-one installation package for x86 or AArch64 and you want to use the images and software packages for the AArch64 or x86_64 architecture, download and copy the required images and software packages to the directory to which the OAT container is mounted, and then initiate a scan task to add the images and packages.
Use the installation package to install OAT
Download the installation package of OAT.
You need to contact OceanBase Technical Support to obtain the installation package.
Run the
scpcommand to upload the OAT installation package to the server.oat_serverspecifies the IP address of the server on which OAT is deployed.scp oat.tgz <oat_server_user>@<oat_server_ip>:~/Mount the OAT directory.
Create a directory named
/data_diron the server to save persistent data of OAT.After the
/data_dirdirectory is mounted to the OAT container, OAT automatically creates the/data_dir/logs,/data_dir/images, and/data_dir/dbdirectories respectively for storing OAT system logs, Docker images of related components and services, and database files of OAT.mkdir -p /data_dirLoad the OAT installation package as an image.
docker load -i oat.tarRun the
docker imagescommand to obtain the tag of the OAT image.Note
If only one OAT installation package is loaded, 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.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.
After OAT is started, enter
http://<<oat_server_ip>:7000in the address bar of the browser.If the login page appears, OAT is installed and started.