This Appendix contains:
A procedure to install Docker and Docker Compose
A procedure to run Linux containers on Windows Server 2019
A manual procedure to install HERO: it guides you to manually execute the steps run by the automatic installation script.
Information related to particular environments or configurations.
To remove any previous installation and reinstall Docker, run the following commands as a user with root privileges (i.e. sudo):
systemctl stop docker
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine
rm /etc/yum.repos.d/docker*.repo
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io
systemctl start docker
usermod -aG docker YOUR_DOCKER_USER_HERE
systemctl enable docker.service
systemctl daemon-reload
For Docker Compose, run the following commands:
curl -L https://github.com/docker/compose/releases/download/1.24.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
To run Linux containers on Windows Server 2019, run the following procedure:
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
Restart your machine
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"
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
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"
Leave the current Powershell window open and do not use it anymore. This will keep Docker running.
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)
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
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
If there are no errors, it means that Docker is properly installed.
If the following error is displayed:
"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.
From the HERO build folder, run the command:
docker load -i GA_hero_all_images.tar
See Installing and Configuring and follow HERO installation procedure
Notes
If an error occurs during the execution of the installation script, for example the script is not signed, copy&paste the script content into a new document, or run the following command:
Set-ExecutionPolicy -ExecutionPolicy:Unrestricted
If you get a container error such as "Paging file is too small for this operation to complete ", tune mem_limit in docker-compose.yml
If you restart your machine, open another elevated Powershell window and run the command:
dockerd.exe -D --experimental --data-root "$Env:ProgramFiles\docker\lcow"
Then, check the status of your containers.
To manually install HERO, run the following procedure:
Unzip the HERO Docker build file in the <BUILD_DIR> directory.
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:
dashboard.properties
IPdashboard
elasticsearch_external
LaunchInContextUrl
ui.properties
IP
kibanaHost
keycloak
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.
Configure HERO Security as described in Configuring Security.
From the <BUILD_DIR> directory, type docker-compose up -d to start HERO.
Type https://<your_host_machine_address>/Dashboard to access HERO dashboard (can be default access port 443, or your custom port).
Before adding environments to HERO dashboard, create a Kibana default index pattern by running the following steps:
Connect to Kibana console by typing: <kibana host:port>/kibana/
On the navigation bar, click Dev Tools
On the left text area, write the following text: “PUT default”
Click the green arrow
On the navbar, enter Management
Click Index Patterns
In the index pattern field write default* then, click Next Step
Click the Create Index Pattern button
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
If the star is not present, select the index pattern and click the star button at the top right of the page
Hero installation has been completed: you can start adding environments.
To stop HERO, from the <BUILD_DIR> directory, type docker-compose stop
To restart HERO, from the <BUILD_DIR> directory, type docker-compose start
If you want to use DB2 database instead of Derby, run the following steps:
Create the database instance
Run the following scripts on the database instance:
dashboard.sql (to create the default schema)
componentActions.sql (default data)
componentGlobalAction.sql (default data)
scripts.sql
Add the JDBC driver jar files in the <BUILD_DIR>\CONFIGURATION\HERO\lib directory
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>"/>
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;
}
}