Pilot Projects

Introduction

Installation of DHuS from shar file distribution using Docker (DHuS v.1.0)

Short guide for installing and executing the DHuS shar distribution, using the Docker S/W.

1. Prerequisites

The following are the prerequisites for the Unix system where the DHuS will be installed:

• Connection to Internet;

•Docker S/W already installed. Please refer to the official Docker documentation at https://docs.docker.com/ for the Docker installation requisites and installation instructions for the different Operating Systems.

•Creation of user and group “dhus” with UID 10125 and GID 10125. If a user/group dhus is already existing on the host with different UID/GID, another name can be used. The user must be also added to the group docker (created as part of the docker s/w installation).

2. DHuS build and execution

Using the dhus account (or the other name assigned to UID 10125):

• In a directory of your choice, create the directories for building the application Docker_Dhus image and to contain the archive and database. Eg:

mkdir /home/dhus/Docker_Dhus (it will contain the configuration files)

mkdir /home/dhus/DHuS_archive (it will contain the archive, the databases and the logs)

cd /home/dhus/Docker_Dhus

The rest of commands below must be run from inside the Docker_Dhus directory.

• In the directory Docker_Dhus, extract the content of the file Docker_Dhus_file_for_shar-1.0.tar :

tar xvf Docker_Dhus_file_for_shar.tar

• Build the Docker DHus image:

docker build -t dhus .

• Start the builded DHuS:

docker run -u dhus -d -p 8081:8081 -t -v /home/dhus/DHuS_archive:/local_dhus dhus

 

The server will be accessible at http://localhost:8081

Credentials are:
username: root
password: password

Note: In case the local port 8081 is being used by another application on the host, start the dhus to be listening on another port:

Eg: “-p 8181:8081”

3. DHuS stop

To stop the DHuS properly, execute the stop.sh script internally to the container:

• Verify the ID of the running docker container executing the DHuS:

docker ps -a

• Stop the DHuS:

docker exec < container ID> /home/dhus/DHUS/stop.sh

Example:

$ docker ps -a:

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9bde14068242  dhus "bash -c 'cd /home/dh"     3 minutes ago       Up 3 minutes             0.0.0.0:8081->8081/tcp big_wozniak
2ffc742b2e92   dhus "bash -c 'cd /home/dh"     41 minutes ago    Exited (0) About an hour ago   angry_thompson
d2a17cefc308  dhus "bash -c 'cd /home/dh"     2 hours ago          Exited (0) About an hour ago   thirsty_babbage

4. DHuS Customization

When started the first time, the DHuS runs with some defaults value and parameters in the followingconfiguration files:

• Dhus.xml

- Parameter varFolder set to “/local_dhus”

-Parameter workingDir set to “/local_dhus/working_dir”

-Parameter executor_enabled set to “true

-Section dataStore commented out

-Default for all the rest

• Log4j2.xml

-log file name set to “/local_dhus/logs/dhus.log”, with file rotation every day saved to "filename-yyyy-MM-dd"

-Default for all the rest

• start.sh

-Memory parameters set to -Xms2g and -Xmx2g, instead of -Xms12g and -Xmx12g

-Default for all the rest

• Server.xml

-Default for all

If a customization is required, modify the basic configuration files dhus.xml, log4j2.xml, server.xml, start.sh present in the /home/dhus/Docker_Dhus directory as needed, following the instructions in the “DHuS Administration Manual” available at: http://sentineldatahub.github.io/DataHubSystem/documents/DHuS%20Administration%20Manual.pdf

To change the configuration:

• Verify the ID of the running docker container executing the DHuS and stop it:

docker ps -a

docker exec <container ID>/home/dhus/DHUS/stop.sh

cd /home/dhus/Docker_Dhus

• Customize the configuration files as needed

• Rebuild the Docker Dhus image:

docker build -t dhus .

• Restart the new builded DHuS:

docker run -u dhus -d -p 8081:8081 -t -v /home/dhus/DHuS_archive:/local_dhus dhus