Configure TAS server hosts

Configure the Docker engine on all the TAS servers — Management, Application, and Datastore servers.

Before you begin 

Copy PEM and generated SSL certificates to TAS servers

Procedure 

  1. Deploy the docker_unmount.sh script to /etc/docker folder:

    1. Create /etc/docker:

      Copy
      mkdir -p /etc/docker
    2. Deploy docker_unmount.sh:

      Copy
      echo "cat /proc/mounts | grep 'mapper/docker' | awk '{print \$2}' \
      | xargs -r umount" > /etc/docker/docker_unmount.sh
    3. Change permissions:

      Copy
      chmod 755 /etc/docker/docker_unmount.sh
  2. Create a configuration file for the Docker service:

    Copy
    vi /etc/sysconfig/docker 
  3. Add the following content to the configuration file (insecure Docker registry):

    Copy
    OPTIONS="--dns=<dns_ip> --insecure-registry=<fqdn_docker_registry>:5000 \
    --bip=172.17.0.1/16 --selinux-enabled" 

    All parameters for OPTIONS must be defined in a single line.

    where:

    • <fqdn_docker_registry> is the FQDN of the TAS Management server.

  4. Add the log rotation options for the Alarm Monitor:

    1. Run:

      Copy
      vi /etc/logrotate.d/prometheus
    2. Add the following content to the file:

      Copy
      /<data_folder>/log/prometheus/*.log {
      daily
      rotate 14
      missingok
      notifempty
      compress
      delaycompress
      copytruncate
      }

      where:

      • <data_folder> is the folder defined for data storage, and is by default opt/app/data.

  5. Add the log rotation options for the Alarm Manager:

    1. Run:

      Copy
      vi /etc/logrotate.d/alertmanager
    2. Add the following content to the file:

      Copy
      /<data_folder>/log/alertmanager/*.log {
      daily
      rotate 14
      missingok
      notifempty
      compress
      delaycompress
      copytruncate
      }

      where:

      • <data_folder> is the folder defined for data storage, and is by default opt/app/data.

  6. Add the log rotation options for the Alarms and Monitoring Agent:

    1. Run:

      Copy
      vi /etc/logrotate.d/cadvisor_exporter
    2. Add the following content to the file:

      Copy
      /<data_folder>/log/cadvisor_exporter/*.log {
      daily
      rotate 14
      missingok
      notifempty
      compress
      delaycompress
      copytruncate
      }

      where:

      • <data_folder> is the folder defined for data storage, and is by default opt/app/data.

  7. Run:

    Copy
    sysctl -q -w vm.max_map_count=262144
  8. Open the /etc/sysctl.conf file, and add the following line:

    Copy
    vm.max_map_count=262144
  9. Deploy the Docker service file:

    1. Create directory for the Docker service:

      Copy
      mkdir /etc/systemd/system/docker.service.d
    2. Set permissions for the Docker service:

      Copy
      chmod g+rx /etc/systemd/system/docker.service.d
    3. Open the override.conf file:

      Copy
      vi /etc/systemd/system/docker.service.d/override.conf
    4. Add the following content to the file:

      Copy
      [Service]
      ExecStartPre=/usr/bin/bash /etc/docker/docker_unmount.sh
      EnvironmentFile=-/etc/sysconfig/docker
      ExecStart=
      ExecStart=/usr/bin/dockerd $OPTIONS
      ExecStartPost=/usr/bin/chown root:docker /var/lib/docker/overlay2
  10. Clear all existing logs, if any:

    Copy
    truncate -s 0 /var/lib/docker/containers/*/*-json.log
  11. Configure the storage driver and log rotation for the Docker-engine service:

    1. If the daemon.json file does not exist, create the file in /etc/docker.

    2. Add the following lines to the file:

      Copy
      {            
        "storage-driver": "overlay2",
        "log-driver": "json-file",
        "log-opts":         
             { 
             "max-size": "10m",
             "max-file": "3"
           }    
      }            
    3. To support overlay2 on an XFS backing filesystem, d_type must be set to true. To verify, run xfs_info [mount point] and validate the d_type value of the partition.

      [mount point] is mount path for the Docker home directory, set by default to /var/lib/docker.

  12. Validate the status of the Docker-engine service:

    Copy
    systemctl daemon-reload
    systemctl enable docker
    systemctl start docker
    systemctl status docker

    Example of expected output:

    docker.service - Docker Application Container Engine

    Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)

    Drop-In: /etc/systemd/system/docker.service.d

    └─override.conf

    Active: active (running) since Tue 2016-11-22 18:17:35 IST; 4s ago

  13. Configure additional required permissions for the Docker-engine service:

    Copy
    chmod 654  /var/lib/docker/overlay2
    chown root:docker /var/lib/docker/image
    chmod 750  /var/lib/docker/image
    chmod 750 /var/lib/docker/image/overlay2
    chown root:docker /var/lib/docker/image/overlay2
    chown root:docker  /var/lib/docker/image/overlay2/layerdb
    chmod 750  /var/lib/docker/image/overlay2/layerdb
  14. Relogin with SSH to the TAS server you are configuring:

    Copy
    ssh tas_inst@<fqdn_tas_server>

    where:

    • <fqdn_tas_server> is the FQDN of the TAS server that you are configuring.

  15. Validate that the daemon is using the overlay2 storage driver:

    Copy
    docker info

    Example of expected output:

    Containers: 0

    Running: 0

    Paused: 0

    Stopped: 0

    Images: 0

    Server Version: 17.06.1-ce

    Storage Driver: overlay2

    Pool Name: docker-202:1-8413957-pool

    ...

  16. Verify that docker is configured correctly:

    Copy
    docker ps

    Example of expected output:

    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

  17. Repeat step 1 through step 17 for each of the TAS servers in your deployment.

  18. On the Management server only, do the following:

    1. Generate the certificate:

      Copy
      ssh-keygen -t rsa
    2. In answer to the prompts, click Enter, as required.

    3. Copy the key to the TAS Management server and to all the other TAS servers, using the target's server's FQDN.

      Copy
      ssh-copy-id tas_inst@<target_server_fqdn>

      where:

      • <target_server_fqdn> is the FQDN of the TAS server to which you are copying the key.

  19. Do the following:

    1. Copy ca.pem to /etc/pki/ca-trust/source/anchors:

      Copy
      cp /home/tas_inst/.docker/ca.pem /etc/pki/ca-trust/source/anchors
    2. Update the CA trust:

      Copy
      /usr/bin/update-ca-trust
  20. Restart the Docker engine:

    Copy
    systemctl daemon-reload
    systemctl restart docker
  21. Repeat step 19 and step 20 on each of the TAS Application and TAS Datastore servers in your deployment.

What to do next 

Unmount and delete RPM ISO file