Skip to content

Installation guide

jvanvolsem edited this page Jul 15, 2020 · 8 revisions

Introduction

This document will guide you on deploying a new instance of the RHIES Client Registry server. It will cover these sections:

  1. Server requirements
  2. Server prerequisites
    1. Nano
    2. Docker
    3. Docker-compose
  3. Server environment settings
  4. Bringing the Client Registry server up
    1. Deploying the Client Registry server
    2. Configuring the Client Registry components
  5. Stop, Start, restart
    1. Managing the whole Client Registry server
    2. Managing a component of the Client Registry server
  6. Updating any server component

At the end of the deployment process, we will have a server running with:

1. Server requirements

To install Docker Engine, you need at least a 64-bit a version of Ubuntu versions 16 with

  • 2 cores
  • 4GB of RAM
  • 5GB of disk space

So, we suggest:

  • 2 cores
  • 8GB of RAM
  • 500GB of disk space

2. Server prerequisites

2.1. Nano

Nano is a lightweight text editor for Linux. It will be useful to edit the components config files.

2.2. Docker

Docker is a tool designed to easily create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and deploy it as one package.

Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration.

3. Servers environment settings

To get the server ready for the deployment follow these few steps:

  • Create the user "botics" or any other username and set the password "xxxxxxxxx": sudo adduser botics
  • Create the folder : /opt/data/[project_short_name]/ Ex. /opt/data/rhies/
  • Give the ownership of the folder: sudo chown botics:botics -R rhies
  • Give the permission of the created folder to botics user: sudo chmod 750 rhies
  • Install git and configure Git User: https://linuxize.com/post/how-to-install-git-on-ubuntu-18-04/
  • Install Docker: curl https://get.docker.com/ | sh -
  • Install compose: sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  • Permission on install folder: sudo chmod +x /usr/local/bin/docker-compose
  • Test compose: docker-compose --version
  • Enabling Botics Users to Run Docker Commands: usermod -a -G docker botics
  • Restart the docker service: service docker restart

The server environment now is ready for deployment

4. Bringing the Client Registry server up

The Client Registry supports the unique identification and management of patient identities, each client or patient needs to be represented in a standard way. To have our Client Registry server running, we will create the containers in the system and configure them.

4.1. Deploying the Client Registry server

Once the server ready after step 3, let's follow these points to create the containers:

  • Copy or upload the docker-compose.yml file from rhies_Interoperability_Layer_Deployment repository to the /opt/data/[project_short_name]/ directory
  • Open a console at this location: /opt/data/[project_short_name]/
  • Run the following command: docker-compose up -d to create the all interoperability layer components containers
  • Run the following command: docker ps to check the running containers.

You should, now, have these following containers running on your interoperability layer server:

  • rhies-client-registry-server
  • rhies-client-registry-mongo

4.2. Configuring the Client Registry components

The containers are created but they are not working correctly. The next step is to configure each component to make them work properly. It is important to notify that docker volumes are created in the /opt/data/[project_short_name]/disc/ folder to store persistent data on the host. That folder is also where config files are stored. The only configuration to do here is to link our server to its Mongo database. Follow these few steps to achieve that:

  • Open the console at the /opt/data/[project_short_name]/ directory
  • Run the following command nano ./disc/rhies-client-registry-server/RhiesCRConfig.properties to open the server config file
  • Set the database host like this db.url=rhies-client-registry-mongo
  • Set the port like this db.port=27017
  • Set the database name like this db.name=rhiesClientRegistry
  • Save your changes
  • Close nano
  • Run the following command docker-compose restart rhies-client-registry-server
  • Open your preferred browser and check whether the Client Registry is accessible now at the address http://yourHost:8079/clientregistry/Patient/

5. Stop, Start, restart

Sometime you may want to stop, start, or restart any component of the server or even the whole server. Here how you could proceed:

First of all, open the console at the /opt/data/[project_short_name]/ directory

5.1 Managing the whole interoperability layer server

  • Run the following command docker-compose stop to stop all the components of the interoperability layer server
  • Run the following command docker-compose start to start all the components of the interoperability layer server
  • Run the following command docker-compose restart to restart all the components of the interoperability layer server

5.1 Managing a component of the interoperability layer server

The components available in the interoperability layer server are the following:

  • rhies-client-registry-mongo
  • rhies-client-registry-server

To manage them you need to precise their name at the end of the command as shown below (ie rhies-client-registry-server):

  • Run the following command docker-compose stop rhies-client-registry-server to stop the rhies-client-registry-server component
  • Run the following command docker-compose start rhies-client-registry-server to start the rhies-client-registry-server component
  • Run the following command docker-compose restart rhies-client-registry-server to restart the rhies-client-registry-server component

6. Updating any server component

Sometime you may want to update a specific component (ie rhies-client-registry-server) of the interoperability layer, you can do it simply like this:

  • Make sure backup that component current configuration file
  • Open the console at the /opt/data/[project_short_name]/ directory
  • Run this command nano docker-compose.yml to open the deployment file
  • Locate the part related to the component you wish to update (ie rhies-client-registry-server)
  • Make changes to target the new docker image (ie savicsorg/rhies-client-registry:2.0)
  • Save your changes
  • Close nano
  • Run this command docker rm -f rhies-client-registry-server to remove the current component from the system
  • Run the following command docker-compose up -d rhies-client-registry-server to recreate the component (here rhies-client-registry-server)

Disclaimer: Never user docker-compose up -d without adding the component name at the end on the server.