Appendix

 This Appendix contains:

  1. A procedure to install Docker and Docker Compose

  2. A procedure to run Linux containers on Windows Server 2019

  3. A manual procedure to install HERO: it guides you to manually execute the steps  run by the automatic installation script.

  4. Information related to particular environments or configurations.

Installing Docker and Docker Compose

To remove any previous installation and reinstall Docker, run the following commands as a user with root privileges (i.e. sudo):  

  1. systemctl stop docker

  2. yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine

  3. rm /etc/yum.repos.d/docker*.repo

  4. yum install -y yum-utils device-mapper-persistent-data lvm2

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

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

  7. systemctl start docker

  8. usermod -aG docker YOUR_DOCKER_USER_HERE

  9. systemctl enable docker.service

  10. systemctl daemon-reload

 

For Docker Compose, run the following commands:

  1. curl -L https://github.com/docker/compose/releases/download/1.24.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

  2. chmod +x /usr/local/bin/docker-compose

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

 

 Running Linux containers on Windows Server 2019

To run Linux containers on Windows Server 2019, run the following procedure:

  1. Run the following commands in an elevated Powershell window (i.e. run as Adminstrator):

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

Enable-WindowsOptionalFeature -Online -FeatureName Containers -All

  1. Restart your machine

  2. Open another elevated Powershell window, and run the following commands:

Install-WindowsFeature Hyper-V –IncludeManagementTools –Restart

Install-WindowsFeature Containers

[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"         

  1. Download and extract Docker and DockerDaemon:

Invoke-WebRequest -UseBasicParsing -OutFile docker.zip https://master.dockerproject.com/windows/x86_64/docker.zip

Expand-Archive docker.zip -DestinationPath $Env:ProgramFiles

rm docker.zip

  1. Download and extract the lcow (LinuxKit):

          Remove-Item $Env:ProgramFiles\docker\lcow -Force -Recurse (only for previous docker installation clean up)

          mkdir $Env:ProgramFiles\docker\lcow   

          $url = "https://github.com/linuxkit/lcow/releases/download/v4.14.35-v0.3.9/release.zip"

          $outfile = "lcowrelease.zip"

          Invoke-WebRequest -Uri $url -OutFile $outfile

          Expand-Archive lcowrelease.zip -DestinationPath "$Env:ProgramFiles\Linux Containers\."

          rm lcowrelease.zip

         cd "$Env:ProgramFiles\docker"

         .\dockerd.exe -D --experimental --data-root "$Env:ProgramFiles\docker\lcow"

  1. Leave the current Powershell window open and do not use it anymore. This will keep Docker running.

  2. Go to Search Bar -> Edit the system environment variables -> Enviroment variables -> Down on System Variabiles -> Edit "Path" and add the docker path (i.e. C:\Program Files\docker)

  3. Open another elevated Powershell window and run the following commands:

          icacls "$Env:ProgramFiles\docker\lcow\volumes" /grant *S-1-5-83-0:"(OI)(CI)F" /T

          Invoke-WebRequest "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-Windows-x86_64.exe"

 -UseBasicParsing -OutFile $Env:ProgramFiles\docker\docker-compose.exe

  1. You should now be able to run Linux containers on Windows. Run the command:

          docker run -it --rm ubuntu:18.04 apt-get update -qq

"http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease is not valid yet"

it means that Docker daemon is not able to connect the internet and, therefore, firewall and web domains whitelists have to be checked. You can only deploy HERO with pre-built images.

  1. From the HERO build folder, run the command:

docker load -i GA_hero_all_images.tar

  1. See Installing and Configuring and follow HERO installation procedure

 

Notes

     Set-ExecutionPolicy -ExecutionPolicy:Unrestricted

     dockerd.exe -D --experimental --data-root "$Env:ProgramFiles\docker\lcow"

 Then, check the status of your containers.

 

Installing HERO manually

To manually install HERO, run the following procedure:

  1. Unzip the HERO Docker build file in the  <BUILD_DIR> directory.

  2. In the <BUILD_DIR>\CONFIGURATION\HERO directory, locate the dashboard.properties and ui.properties configuration files and customize the following  properties with the external hostname and ip address of the workstation where HERO is being installed:

  1. Download the DB2 or Oracle JDBC driver .jar file related to the database that you want to connect and copy it to the <BUILD_DIR>\EXT directory.

  2. Configure HERO Security as described in Configuring Security.

  3. From the <BUILD_DIR> directory, type docker-compose up -d to start HERO.

  4. Type https://<your_host_machine_address>/Dashboard  to access HERO dashboard (can be default access port 443, or your custom port).

  5. Before adding environments to HERO dashboard, create a Kibana default index pattern by running the following steps:

    1. Connect to Kibana console by typing: <kibana host:port>/kibana/  

    2. On the navigation bar, click Dev Tools

    3. On the left text area, write the following text: “PUT default”

    4. Click the green arrow

    5. On the navbar, enter Management

    6. Click Index Patterns

    7. In the index pattern field write default* then, click Next Step

    8. Click the Create Index Pattern button

    9. Now that you have created the index pattern, verify that Kibana uses it as a default: on the left list, if the index pattern presents a star, the configuration is complete  

    10. If the star is not present, select the index pattern and click the star button at the top right of the page

  6. Hero installation has been completed: you can start adding environments.

  7. To stop HERO, from the <BUILD_DIR> directory, type docker-compose stop

  8. To restart HERO, from the <BUILD_DIR> directory, type docker-compose start

 

Using DB2 database instead of Derby

 

If you want to use DB2 database instead of Derby, run the following steps:

 

  1. Create the database instance

  2. Run the following scripts on the database instance:

  1. Add the JDBC driver jar files in the <BUILD_DIR>\CONFIGURATION\HERO\lib directory

  1. In the <BUILD_DIR>\CONFIGURATION\HERO\conf directory, edit the context.xml file and add the following text in the <Context> tag:

 

<Resource name="jdbc/console"

      global="jdbc/console"

      auth="Container"

      type="javax.sql.DataSource"

      driverClassName="com.ibm.db2.jcc.DB2Driver"

      url="jdbc:db2://<host-machine-db2>:<port_db2>/console"

      username="<username_db2>"

      password="<password_db2>"/>

 

 

 

 

 

 

 

 

 

 

NGINX configuration example

The following example shows how to configure an NGINX server for providing authentication and using the HTTPS protocol without configuring each node:

 

upstream tomcat {

     server tomcat:8080 fail_timeout=0;

}

upstream elasticsearch {

   server elasticsearch:9200 fail_timeout=0;

}

upstream kibana {

  server kibana:5601 fail_timeout=0;

}

server { # simple reverse-proxy

      listen       443 ssl default_server;

      ssl_certificate     /usr/share/cert/localhost.cert;

      ssl_certificate_key /usr/share/cert/localhost.key;

      auth_basic_user_file /etc/nginx/.htpasswd;

      auth_basic "Access restricted";

 

      location /Dashboard {

        proxy_pass      http://tomcat;

        proxy_set_header Host $host;

        proxy_set_header X-Real-IP $remote_addr;

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_set_header X-Forwarded-Proto https;

      }

      location /ES {

        rewrite /ES/(.*) /$1  break;

        proxy_pass      http://elasticsearch;

      }

      location /kibana {

        proxy_pass      http://kibana;

      }

}