This topic describes how to deploy OceanBase Admin Toolkit (OAT).
Prerequisites
Docker CE 17.03 or later is installed on your server.
Procedure
Check the Docker information.
[root@xxx /] $docker version Client: Version: 18.03.0-ce API version: 1.37 Go version: go1.9.2 Git commit: 0520e24 Built: Wed Mar 21 23:05:52 2018 OS/Arch: linux/amd64 Experimental: false Orchestrator: swarm Server: Engine: Version: 18.03.0-ce API version: 1.37 (minimum version 1.12) Go version: go1.9.4 Git commit: 0520e24 Built: Wed Mar 21 23:14:54 2018 OS/Arch: linux/amd64 Experimental: falseRun the
scpcommand to upload the OAT installation package to the server.Replace
oat_server_ipwith the IP address of the server where OAT is to be installed.scp <oat_directory/oat.tar> <oat_server_user>@<oat_server_ip>:oat_directoryExample:
[root@xxx /home/admin/rpm] #scp oat_4.0.0_20221202_x86.tar admin@xxx.xxx.xxx.xxx:/home/admin/rpm admin@xxx.xxx.xxx.xxx's password: oat_4.0.0_20221202_x86.tar 100% 1292MB 275.4MB/s 00:04Mount the OAT directory.
Create a directory named
/data_diron the server to save persistent data of OAT. After the/data_dirdirectory is mounted to an OAT container, OAT automatically creates the/data_dir/logs,/data_dir/images, and/data_dir/dbdirectories to store OAT system logs, Docker images of components and products, and OAT database files, respectively.Example:
[root@xxx /] #mkdir -p /data_dirLoad the OAT installation package as an image.
docker load -i oat.tarExample:
[root@xxx /home/admin/rpm] #docker load -i oat_4.0.0_20221202_x86.tar 06f6bfff6616: Loading layer [==================================================>] 230.8MB/230.8MB 14c0710ff1a5: Loading layer [==================================================>] 418.5MB/418.5MB 7a259a6e1f07: Loading layer [==================================================>] 5.12kB/5.12kB bd8d5ec152cd: Loading layer [==================================================>] 365.6MB/365.6MB 6a2a4966df4c: Loading layer [==================================================>] 339.5MB/339.5MB Loaded image: reg.docker.alibaba-inc.com/oceanbase/oat:4.0.0_20221202_x86Run the
docker imagescommand to obtain the tag of the OAT image.
Note
The following command is specific to the server that has only one OAT installation package loaded locally. If multiple installation packages are loaded, you can use the docker images command to view the displayed content and connect the first two columns using a colon (:).
oat_image=`docker images | grep oat | awk '{printf $1":"$2"\n"}'`
Example:
[root@xxx /home/admin/rpm]
#oat_image=`docker images | grep oat | awk '{printf $1":"$2"\n"}'`
Run the
docker runcommand to start OAT.docker run -d -v /data_dir:/data -p 7000:7000 --restart on-failure:5 $oat_imageExample:
[root@xxx /home/admin/rpm] #docker run -d -v /data_dir:/data -p 7000:7000 --restart on-failure:5 `docker images | grep oat | awk '{printf $1":"$2"\n"}'` 5fad809157371a9b66aa1ec77bfe3ad904cee070bcd346b97d0702e35c3eb028
What to do next
Verify that OAT is installed and can be started successfully. For more information, see Verify OAT deployment.