Containerizing ZMC

Table of contents
  1. 1. Prerequisites:

Version as of 17:33, 18 May 2024

to this version.

Return to Version archive.

View current version

Prerequisites:

  1. MaDocker engine
  2. Docker-compose
  3. Pyton 3.x

 

Installation of Docker Engine 

1.     Install yum-utils 

                  sudo yum install-y yum-utils 

2.     Add the Docker repository 

                  sudo yum-config-manager \ 
                    --add-repo\ 
                  https://download.docker.com/linux/centos/docker-ce.repo 

3.     Install Docker  

                  sudo yum install docker-ce docker-ce-cli containerd.io 

       4.     Start Docker  

                  sudo systemctl start docker              

       5.     Run the hello-world image to make sure everything works

                  sudo docker run helo-world

 

Installation of Docker-Compose 

1.     Download Docker Compose 

sudo curl -L "https://github.com/docker/compose/re...ompose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 

2.     Add execution perms to the download 

sudo chmod +x /usr/local/bin/docker-compose 

3.     Link to the docker-compose command 

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose 

4.      Run “docker-compose –version” to confirm

 

Installation of Docker-Compose 

1.  Download Docker Compose 

sudo curl -L "https://github.com/docker/compose/re...ompose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 

2.     Add execution perms to the download 

sudo chmod +x /usr/local/bin/docker-compose 

3.     Link to the docker-compose command 

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose 

4.      Run “docker-compose –version” to confirm 


Installation of Python 

1.     Install the dependencies necessary to build Python: 

sudo apt update 

sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev 

2.     Download the latest release’s source code from the Python download page with wget 

wget https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz 

3.     Once the download is complete, extract the gzipped archive: 

tar -xf Python-3.9.1.tgz 

    4.     Navigate to the Python source directory and execute the configure script: 

cd Python 3.9.1 

./configure --enable-optimizations 

5.     Start the Python 3.9 build process: 

make -j 2 

6.     When the build process is complete, install the Python binaries by typing: 

sudo make altinstall 

7.     That’s it. Python 3.9 has been installed and ready to be used. To verify it, type: 

python3.9 --version 

 

Deployment - Rest server 

1.      tar -xvf zmc_latest.tar 

2.      cd zmc-pre-r [all the following steps have to be executed from within this directory] 

3.      docker load < zmc-pre-release  -> this will create a local copy of the our zmc-rest-server     image 

4.      Delete file zmc-pre-release 

5.      Use zmcDB_docker.sql in "zmc-pre-r" to create the remote db with the following cmd 

a.      mysql -uroot -p [name of empty db] <  zmcDB_docker.sql 

6.      vi db_params/my.cnf then update your remote db connection params 

7.      [DO NOT perform this step if already performed while deploying backup server] Create file 'port_ranges' in the directory path '/var/lib/amanda/', this file must contain the range of port numbers that can be used  by zmc containers. 

Format of the must be: The file will contain only 2 lines, 1st line will be the lower limit of the range and 2nd line will be the upper limit of the range. 

Example: 

                             10020 

                             10030 

8.      Run "./run-docker.py" [python 3 must present on the host system], this will deploy the container. 

9.      Now, go to "https:/[hostname]:8008/", your zmc ui will be accessible with the credentials: Username = admin, password = Bet$0l@2020                      //This can be changed once you login. 

     10.  To check mac address: 

docker-compose exec app ip addr list              //license should be generated using this mac                    address. 

11.  Restart services: 

docker-compose exec app systemctl restart __sub-zmc-rest.service __sub-zmc-ui.service run-zmanda-zmc.service  

  

Deployment - Backup server: 

1.      tar -xvf aee_latest.tar 

2.      Rename the extracted directory 

3.      cd <extracted dir> [all the following steps have to be executed from within this directory] 

4.      docker load < aee-pre-release 

5.      ./create-aee-network                                             //Should be run only once 

6.      Delete file aee-pre-release 

7.      [DO NOT perform this step if already performed while deploying backup server] 

Create file 'port_ranges' in the directory path '/var/lib/amanda/', this file must contain the range of port numbers that can be used  by zmc containers. 

Format of the must be: The file will contain only 2 lines, 1st line will be the lower limit of the range and 2nd line will be the upper limit of the range. 

Example: 

                             10020 

                             10030 

8.      Run "./run-docker.py" [python 3 must present on the host system], this will deploy the container. 

9.      Now, for all successive backup-server container instance creation: 

a.      Follow steps 1 through 3 then jump to step 8