Menu

Sessions 4.0.2 Load Balancing Installation Guide for Docker

To request installation assistance or to obtain the links to self-install, please click here to fill out the New Install Form.

In this article, we'll run you through installing qTest Sessions 4.0.2 (using Docker) on different CentOS/ Ubuntu machines with a Load Balancer, then connect it to qTest Manager on another machine.

Before you begin

Before you install qTest Sessions, make sure following things are done:

  • Your machines need to satisfy qTest's recommended hardware requirement
  • Docker 17.03 has been installed. Follow these instructions to install Docker on your machine
  • For CentOS, you need to follow additional instructions to adjust Docker Storage Driver from overlay to devicemapper.
  • For CentOS 7.X+ or Ubuntu 16.10 machines: Docker requires a 64-bit installation and your kernel must be at least 3.10
  • Set up a shared directory where all machines you use in the load balancing approach are able to access.

Install qTest Sessions with Load Balancer

Image below tries to demonstrate how to install and configure qTest Sessions with load balancer for 4 machines: 

  • Machine 1: considered as a cluster, where we deploy qTest Sessions' prerequisite apps: PostgreSQL, Redis, RabbitMQ (e.g. IP: 10.0.10.126)
  • Machine 2: deploy qTest Sessions 4.0.2
  • Machine 3: deploy qTest Sessions 4.0.2
  • Machine 4: deploy qTest Sessions load balancer (sessionslb)

NOTE

  • Cluster machine has to open 2 ports: 53 and 6783

 sessions-lb.png

Deployment Instructions 

NOTE

  • Pre-requisite applications of qTest Sessions should be deployed in a separated machine rather than in the same machine with qTest Sessions
  • The load balancer application (sessionslb) should be deployed after all other apps get deployed.

Access to each of 4 machine where Docker has been installed using root or a user which has been added to docker user group.

Machine 1 (the cluster)

1. Download docker deployment package

 $ wget <ENTER DOWNLOAD LINK HERE>  

2. Extract the package 

 $ tar -zxf <DOWNLOADED PACKAGE FILE NAME> 

3. Access to extracted package directory 

 $ cd <EXTRACTED PACKAGE DIRECTORY> 

4. Deploy PostgreSQL into Machine 1 which should have been ready after you installed qTest Manager.

5. Install NFS (Network File Systems)

5.1 Update the repositories:

 $ sudo apt-get update

5.2 Install NFS server package with below command:

 $ sudo apt-get install nfs-kernel-server

5.3 Create directory you want to share with other computers. This is the directory being used to store data created by qTest Sessions applications on other servers:

 $ sudo mkdir /shared-sessions-storage

5.4 Edit /etc/exports config file

Here /etc/exports is the main config file for NFS. See the below examples and add share directories to the config file based on our requirement.

 $ vim /etc/exports

Add a line into /etc/exports file to make directory shared-sessions-storage can be access acrossed network.

 ...
# share access to all network
$ /share-sessions-storage *(rw, sync, no_root_squash)
...

 

Save and close the file when you are finished.

5.5 Start NFS service

 $ sudo /etc/init.d/nfs-kernel-server start 

5.6 Check share status

 $ sudo exportfs -u
/shared-sessions-storage   <world>

Machine 2  (qTest Sessions)

1. Download docker deployment package

 $ wget <ENTER DOWNLOAD LINK HERE>  

2. Extract the package 

 $ tar -zxf <DOWNLOADED PACKAGE FILE NAME> 

3. Access to extracted package directory 

 $ cd <EXTRACTED PACKAGE DIRECTORY> 

4. Install and Configure NFS Client

4.1 Execute following command to update and upgrade system packages

$ apt-get update -y && apt-get upgrade -y

4.2 Enter following command to install NFS Client

$ sudo apt-get install nfs-common rpcbind

4.3 Create a directory that will be used as qTest Sessions storage

$ sudo mkdir /sessions-storage

Mount the shared directory in the cluster (whose IP address is 10.0.10.126) to the directory we just created

$ sudo mount 10.0.10.126:/shared-sessions-storage /sessions-storage

Edit the file /etc/fstab using vim

$ vim /etc/fstab

... then add the following line to fstab file for permanent mount. Again, notice the IP address 10.0.10.126 is the IP address of the cluster

$ 10.0.10.126:/shared-sessions-storage /sessions-storage nfs rw,sync,hard,intr 0 0

Save and close the file when you are done.

Check the mounted share directory with mount command:

$ mount
...
10.0.10.126:/shared-sessions-storage on /sessions-storage type nfs4 (rw,relatime,vers=4.0,rsize=524288,wsize=524288,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.0.10.95,local_lock=none,addr=[public IP Address])
...

Now when there are files being created/updated/deleted by qTest Sessions, they will be created/updated/deleted in the shared-sessions-storage directory in the cluster.

5. Configure qTest Sessions

 $ ./configure --apps "sessions" --cluster "<IP of Machine2>"

Next, modify configure file to ensure the "datadir" variable point to a shared directory where all 4 machines are able to access.

 $ vim profiles/default.in

Start the deployment

 $ ./startup 

Machine 3  (qTest Sessions)

1. Download docker deployment package

 $ wget <ENTER DOWNLOAD LINK HERE>  

2. Extract the package 

 $ tar -zxf <DOWNLOADED PACKAGE FILE NAME> 

3. Access to extracted package directory 

 $ cd <EXTRACTED PACKAGE DIRECTORY> 

4. Install and Configure NFS Client you did at step #4 on Machine 2

5. Configure qTest Sessions

$ ./configure --apps "sessions" --cluster "<IP of Machine3>"

Next, modify configuration file to ensure the "datadir" variable point to a shared directory where all 4 machines are able to access.

 $ vim profiles/default.in

Start the deployment

 $ ./startup 

Machine 4 (sessionlb - load balancer)

1. Download docker deployment package

 $ wget <ENTER DOWNLOAD LINK HERE>  

2. Extract the package 

 $ tar -zxf <DOWNLOADED PACKAGE FILE NAME> 

3. Access to extracted package directory 

 $ cd <EXTRACTED PACKAGE DIRECTORY> 

4. Select one of below option if you want to install sessionlb - the load balancer - with or without SSL 

Deploy sessionlb on Machine 4 without SSL

Execute command below to deploy qTest Sessions without SSL. The command arguments are explained as below:

  • sessions-url: IP of machine 4 (the load balancer)
  • sessions-http: sessions port of machine 4 (the load balancer)
  • cluster: IP of machine 1
  • apps: sessionslb
$ ./configure --apps "sessionslb" --sessions-url "http://<IP of machine 4>:<sessions port of machine 4>" --sessions-http "<sessions port of machine 4>" --cluster "<IP of Machine 1>"

Deploy sessionlb on Machine 4 with SSL

Execute command below to deploy qTest Sessions with SSL. The command arguments are explained as below:

  • ssl-key, ssl-cert, ssl-ca: specify paths to ssl key, ssl cert and ssl- ca
  • sessions-url: IP of machine 4
  • sessions-https: sessions https port of machine 4
  • cluster: IP of machine 1
  • apps: sessionslb
$ ./configure --apps "sessionslb" --ssl-key "<SSL Key>" --ssl-cert "<SSL Cert>" --ssl-ca "<SSL CA>" --sessions-url "https://<IP of machine 4>:<sessions https port of machine 4>" --sessions-https "<sessions https port of machine 4>" --cluster "<IP of Machine1>"

Configure qTest Manager 

Login to qTest Manager using administrator account then access to Administration page.

adminpage.png

Go to SYSTEM CONFIGURATIONS page then navigate to MISCELLANAOUS section and enter the URL of qTest Manager into qTest server's domain field. Note: if qTest Manager is not running on port 80, you have to specify the port number in the URL. 

system-config-misc-port.png

 

Next, navigate to section QTEST EXPLORER | SESSIONS and enter Sessions URL with the information of machine 4 (the sessionslb), for example:

  • http://<IP of Machine 4>:<Port of Machine 4> if you installed machine 4 without SSL OR
  • https://<IP of Machine 4>:<Port of Machine 4> if you installed machine 4 with SSL

Click Test Connection and wait for qTest Manager to show a message "Connected to server successfully" then click Save to save the configuration.

system-config-sessions-url.png

Now you can access to qTest Sessions via qTest Manager's nine-box icon

nine-box-icon.png

 

Subscribe To Our Blog
Powered by Zendesk