Menu

Sessions 4.0.2 Cluster and Load Balancing Installation Guide for Linux (non-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 3.0.9 on different CentOS/ Ubuntu machines in Cluster environment or with a Load Balancer.

Before you begin

Before you install qTest Sessions, make sure following things:

  • Your machines need to satisfy qTest's recommended hardware requirement
  • This instruction is specific for Ubuntu 16 environment, if you are using CentOS 7+, just replace apt-get command with yum. If your environment is different from Ubuntu 16 and/or CentOS 7, consult our customer support 

Scenarios

We will cover 2 sample scenarios to install qTest Sessions.

  1. Scenario 1: Install qTest Sessions in Cluster Environment
  2. Scenario 2: Install qTest Sessions in Load Balancing Environment

 

Scenario 1: Install qTest Sessions in Cluster environment

Diagram below demonstrates a sample scenario to deploys qTest Sessions in a Cluster environment along with other applications of the qTest Platform.

sessions-cluster.png

qTest Manager: an instance of qTest Manager deployed in a separated CentOS/Ubuntu server.

  • IPv4 Public IP: 52.199.19.30

qTest Sessions Server: a server that host qTest Sessions application

  • IPv4 Public IP: 10.0.10.46

Shared Server: a server that hosts shared components and/or software packages that are required to run qTest Manager and qTest Sessions 

  • Redis: a cache store used by qTest Manager
  • RabbitMQ: message broker software that implements the Advanced Message Queuing Protocol (AMQP), this components are required by qTest Manager
  • PostgreSQL: a database engine used to manage qTest Manager and qTest Sessions data
  • Shared Network Drive: used to share directories and files with others over a network. We are not going to create any shared folder or network drive for qTest Sessions in this scenario.
  • IPv4 Public IP: we will not use the public IP address since this server will not be exposed to the outside world
  • Private IP: 10.0.10.126

Installation instructions:

 

1. Install qTest Manager (Public IP: 52.199.19.30)

qTest Manager needs to be installed and running before you install qTest Sessions.

Follow this instruction to install Manager 8.7.3 Single Server Installation Guide for Linux (non-Docker), when you are done, proceed to the next step.

2. Install PostgreSQL 9.5 in Shared Server (Private IP: 10.0.10.126)

Access to your Shared Server then follow below instruction to install PostgreSQL 9.5.

2.1 Execute one of below commands, dependent on your Ubuntu version:

Ubuntu 14

root@ip-[your-ip-address]:/home/ubuntu# sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'

.. or if you are using Ubuntu 16

root@ip-[your-ip-address]:/home/ubuntu# sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'

 

2.2 Next, perform below commands to install PostgreSQL 9.5

root@ip-[your-ip-address]:/home/ubuntu# sudo wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
root@ip-[your-ip-address]:/home/ubuntu# sudo apt-get update
root@ip-[your-ip-address]:/home/ubuntu# sudo apt-get install -y postgresql-9.5

 

2.3. Verify that PostgreSQL instances are configured and running:

root@ip-[your-ip-address]:/home/ubuntu# sudo pg_lsclusters
Ver Cluster Port Status Owner    Data directory               Log file
9.5 main    5432 online postgres /var/lib/postgresql/9.5/main /var/log/postgresql/postgresql-9.5-main.log

 

2.4 Set password for user postgres. In this example we will use root as the password.

root@ip-[your-ip-address]:/home/ubuntu# sudo -u postgres psql postgres
psql (9.5.7)
Type "help" for help.
postgres=# \password
Enter new password: root # enter root as the new password
Enter it again: root # reenter root to confirm the new password
postgres=# \q
root@ip-10-0-10-143:/home/ubuntu#

 

2.5 Create qTest Sessions database schema and name it sessions

root@ip-[your-ip-address]:/home/ubuntu# sudo -i -u postgres
postgres@ip-[your-ip-address]:~$ createdb sessions

 

2.6 Verify the sessions database has been created successfully

postgres@ip-[your-ip-address]:~$ psql
psql (9.5.7)
Type "help" for help.

postgres=# \l
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
-----------+----------+----------+-------------+-------------+-----------------------
postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
sessions  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
(4 rows)

Quit psql and get back to terminal.

postgres=# \q
postgres@ip-[your-ip-address]:~$ exit
logout
root@ip-[your-ip-address]:/home/ubuntu#

Now you have finished setting up Shared Server. Next step is to install qTest Sessions application.

3. Install qTest Sessions (Public IP address: 10.0.10.46)

3.1 Access to server where you will install qTest Sessions.

3.2 Open Terminal

3.3 Make sure you will perform all installation steps as system user by executing following below command

# sudo su

3.4 Execute following command to update and upgrade system packages

# apt-get update -y && apt-get upgrade -y
# apt-get install libfontconfig

3.5 Change to /usr/local directory, and start to download qtestctl package

# cd /usr/local
# wget <ENTER DOWNLOAD LINK HERE>

Extract qtestctl package and navigate to the extracted folder

# tar xzvf <DOWNLOADED PACKAGE FILE NAME>
# cd qtestctl

3.6 Configure qtestctl

Edit qtest.config using following command:

Ubuntu

# vim qtest.config
Press insert to edit config file

CentOS

# vi qtest.config
Press insert to edit config file

Now you can start edit qtest.config file.

3.6.1 Make sure there is sessions item in apps list, as show below, in bold.

apps = ['sessions']

3.6.2 Configure databases in postgres section

  • host: postgres database server’s host name or ip address
  • port: postgres database server’s port
  • auth: configure database authentication credentials
    • user: qTest Sessions database user name
    • pass: qTest Sessions database user password
  • db: configure qTest Sessions database
    • qtest: qTest database name
    • session: qTest Sessions database name
external {
  postgres {
    host = '10.0.10.126'
    port = 5432
  auth {
      user = 'postgres'
      pass = 'root'   
}
  db {
      qtest = 'qtest'
      session = 'sessions'
    }
  }
  ...
}

3.6.3 Configure Sessions server

In qtest.config file, navigate to section sessions in qtest.config file to configure qTest Sessions server.

  • port: configure server port that qTest Sessions will be listening
  • ssl: configure SSL if you want to deploy qTest Sessions with https protocol
    • enabled: set value to true to enable https
    • key: absolute path to .key file. Only affected if enabled field is set to true
    • cert: absolute path to .cert file. Only affected if enable is set to true
  • qtest: configure qTest Manager application URL and master token
    • host: qTest Manager URL
    • mastertoken: the token that qTest Sessions uses to connect to qTest Manager
  • storage: configure a location that qTest Sessions will store its data to
    • type: type of the storage, possible value is amazon_s3 or disk_storage
    • accesskey: if storage type is set to amazon_s3, this is the access key used to access to Amazon S3 storage. Leave this field empty if storage type is set to disk_storage
    • secretkey: if storage type is set to amazon_s3, this is the access key used to access to Amazon S3 storage. Leave this field empty if storage type is set to disk_storage
    • bucketname: if storage type is set to amazon_s3, this is ame of the name of the bucket to store data on Amazon S3
    • rootpath: if storage type is set to disk_storage, this is the absolute path to a folder on disk where data is stored

Below is an example of qTest Sessions server configuration, in bold.

...
sessions {
port: 9080
ssl {
enabled = false
key = "/absolute/path/to/dist/ssl/server.key"
cert = "/absolute/path/to/dist/ssl/server.crt"
}
qtest {
host = 'http://52.199.19.30'
mastertoken: "QToy"
}
storage {
// value must be in ['amazon_s3', 'disk_storage']
// amazon_s3: stores resource files on amazon ec2
// disk_storage: stores resource files on local disk
type = 'disk_storage'
// if stores resources on Amazon S3
accesskey = ""
secretkey = ""
bucketname = ""
// if stores resources on local disk
rootpath = "/home/ubuntu/session-resources"
}

Press ESC and save the configuration with following command

:wq

3.7 Initialize qTest Sessions database and seed data

Make sure qtestctl has 'execute' permission by enter following command

# sudo chmod +x qtestctl

Next, enter following command to initialize database:

# ./qtestctl sessions:initdb

If you encounter error /usr/bin/env: ‘sh\r’: No such file or directory. Run below commands then re-run the above commands again.

# sudo apt install dos2unix
# dos2unix qtestctl

3.8 Start qTest Sessions 

# ./qtestctl sessions:start

3.9 Install qtest service

To enable qTest Sessions to automatically starts on system startup, we need to install qtest as a service.

3.9.1 In the Terminal, press `ctl + c` if qtestctl is running

3.9.2 Execute below command to install qtest service

> ./install

3.9.3 Verify that the service has been successfully installed with following command

> systemctl status qtest

If the installation was successful, you will see output that includes the text like below

qTest has successfully started!

However, if you see:

Active: inactive (dead)

then enter following command to start the service

> systemctl start qtest

4. Configure qTest Manager

4.1 Login to your qTest Manager using a Site Administrator account

4.2 Go to the Site Administration page and click on tab SYSTEM CONFIGURATIONS

4.3 In QTEST EXPLORER | SESSIONS section, enter URL of your qTest Sessions site, following this convention: [scheme]://[qTest Sessions IP Address]:[Port]:

  • scheme: if you install qTest Session with SSL certificate, enter https, otherwise, enter http
  • qTest Sessions IP Address: enter the IP address where qTest Sessions is installed
  • Port: enter port number that qTest Sessions will be listening. Refer to previous section `12.3 Configure Sessions server` for the configured port number

In our example, qTest Session URL will look like below:

qtest-connect-to-sessions.png

4.4 Click Save button for the changes to take affect.

5. Access to qTest Sessions from qTest Manager and validate the installation

From qTest Manager home page, access to qTest Sessions from nine box icon.

access-to-sessions.png

From qTest Sessions home page, click + Sesisons to create a new session

Sessions-Create-a-new-Session.png

Enter Session's Title and click Save & Close.

Sessions-Save-new-Session.png

Verify that the new session has been created successfully.

Sessions-Saved-Session.png

You have finished install qTest Sessions in Cluster environment 

Scenario 2: Install qTest Sessions in Load Balancing environment

Diagram below demonstrates a sample scenario to deploy qTest Sessions in a load balancing environment:

sessions-load-balancing.png

qTest Manager: an instance of qTest Manager deployed in a CentOS/Ubuntu server that connects to a PostgreSQL database server

  • IPv4 Public IP: 52.199.19.30
  • Private IP: 10.0.10.7

qTest Manager DB Server: a PostgreSQL database server that manages qTest Manager database

  • IPv4 Public IP: we will not expose its IP address to the outside world
  • Private IP: 10.0.10.143

qTest Sessions Server #1: a server that host qTest Sessions application

  • IPv4 Public IP: we will not expose its IP address to the outside world
  • Private IP: 10.0.10.95

qTest Sessions Server #2: another server that hosts qTest Sessions application

  • IPv4 Public IP: we will not expose its IP address to the outside world
  • Private IP: 10.0.10.125

Shared Server: a server that hosts shared components that are required to run qTest Sessions

  • PostgreSQL: a database engine used to manage qTest Sessions data
  • NFS (Network File Systems): used to share directories and files with others over a network. We will use NFS to manage and share files created by qTest Sessions applications deployed on the 2 qTest Sessions servers
  • IPv4 Public IP: we will not use the public IP address since this server will not be exposed to the outside world
  • Private IP: 10.0.10.126

qTest Sessions Load Balancer: a server acts as a load balancer for the two qTest Sessions servers. We will install and use HAProxy on this server for that purpose.

  • IPv4 Public IP: 52.68.226.37
  • Private IP: 10.0.10.78

Installation instructions:

1. Install qTest Manager (Public IP address: 52.199.19.30)

Follow this instruction to install Manager 8.7.3 Single Server Installation Guide for Linux (non-Docker)

After installed qTest Manager, note down its IPv4 Public IP address. This is the IP address that qTest Sessions application will access to it.

In our example, we will deploy qTest Manager on a server whose IP address is 52.199.19.30

2. Setup Shared Server (Private IP is 10.0.10.126)

Access to the shared server and install following applications and/or packages

2.1 Install NFS (Network File Systems)

2.1.1 Update the repositories:

root@ip-[your-ip-address]:/home/ubuntu# sudo apt-get update

 

2.1.2 Install NFS server package by typing the command:

root@ip-[your-ip-address]:/home/ubuntu# sudo apt-get install nfs-kernel-server

 

2.1.3 Make directory you want to share with other computer. This is the directory being used to store data created by qTest Sessions Server application on other server:

root@ip-[your-ip-address]:/home/ubuntu# sudo mkdir /shared-sessions-storage

 

2.1.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.

root@ip-[your-ip-address]:/home/ubuntu# 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 networks
/shared-sessions-storage        *(rw,sync,no_root_squash)
...

Save and close the file when you are finished.

2.1.5 Start NFS service

root@ip-[your-ip-address]:/home/ubuntu# sudo /etc/init.d/nfs-kernel-server start

 

2.1.6 Check share status

root@ip-[your-ip-address]:/home/ubuntu# sudo exportfs -u
/shared-sessions-storage <world>
root@ip-[your-ip-address]:/home/ubuntu#

 

2.2 Install PostgreSQL 9.5

Access to DB Server and execute one of below comand Follow below instruction to install PostgreSQL 9.5 on Ubuntu 

2.2.1 Execute below command dependent on your Ubuntu version:

Ubuntu 14:

root@ip-[your-ip-address]:/home/ubuntu# sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'

.. or if you are using Ubuntu 16:

root@ip-[your-ip-address]:/home/ubuntu# sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'

 

2.2.2 Next, perform below commands to install PostgreSQL 9.5

root@ip-[your-ip-address]:/home/ubuntu# sudo wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
root@ip-[your-ip-address]:/home/ubuntu# sudo apt-get update
root@ip-[your-ip-address]:/home/ubuntu# sudo apt-get install -y postgresql-9.5

 

2.2.3. Verify that PostgreSQL instances are configured and running:

root@ip-[your-ip-address]:/home/ubuntu# sudo pg_lsclusters
Ver Cluster Port Status Owner    Data directory               Log file
9.5 main    5432 online postgres /var/lib/postgresql/9.5/main /var/log/postgresql/postgresql-9.5-main.log

 

2.2.4 Set password for user postgres. In this example we will use root as the password.

root@ip-[your-ip-address]:/home/ubuntu# sudo -u postgres psql postgres
psql (9.5.7)
Type "help" for help.
postgres=# \password
Enter new password: root # enter root as the new password
Enter it again: root # reenter root to confirm the new password
postgres=# \q
root@ip-10-0-10-143:/home/ubuntu#

 

2.5.5 Create qTest Sessions database schema and name it sessions

root@ip-[your-ip-address]:/home/ubuntu# sudo -i -u postgres
postgres@ip-[your-ip-address]:~$ createdb sessions

 

2.6.6 Verify the sessions database has been created successfully

postgres@ip-[your-ip-address]:~$ psql
psql (9.5.7)
Type "help" for help.

postgres=# \l
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
-----------+----------+----------+-------------+-------------+-----------------------
postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
sessions  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
(4 rows)

2.6.7 Quit psql and get back to terminal.

postgres=# \q
postgres@ip-[your-ip-address]:~$ exit
logout
root@ip-[your-ip-address]:/home/ubuntu#

Now you have finished setting up Share Server. Next step is to install 2 qTest Sessions applications, each on its own server.

3. Install qTest Sessions servers

3.1 Install qTest Sessions Server #1 (Private IP address is 10.0.10.95)

3.1.1 Access to Ubuntu server where you will install qTest Sessions

3.1.2 Open Terminal

3.1.3 Make sure you will perform all the installation steps as system user by executing following command:

root@ip-[your-ip-address]:/home/ubuntu# sudo su

3.1.4 Execute following command to update and upgrade system packages

root@ip-[your-ip-address]:/home/ubuntu# apt-get update -y && apt-get upgrade -y
root@ip-[your-ip-address]:/home/ubuntu# sudo apt-get install libfontconfig

3.1.5 Install Java 8

Ubuntu

# cd /home/ubuntu
root@ip-[your-ip-address]:/home/ubuntu# add-apt-repository ppa:webupd8team/java
root@ip-[your-ip-address]:/home/ubuntu# apt-get update -y
root@ip-[your-ip-address]:/home/ubuntu# apt-get install oracle-java8-installer

CentOS

# yum install wget
# cd /opt/
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
# cd /opt/jdk1.8.0_131/
# alternatives --install /usr/bin/java java /opt/jdk1.8.0_131/bin/java 2
# alternatives --config java 

Note: The installer will ask for your confirmation to install Java components. Just answer 'Y', 'Ok' or 'Yes' where applicable.

Verify Java has been installed successfully.

# java -version
java version "1.8.0_131"

Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode) 

3.1.6 Install and Configure NFS Client 

Enter following command to install NFS Client

root@ip-[your-ip-address]:/home/ubuntu# sudo apt-get install nfs-common rpcbind

Create a directory that will be used as qTest Sessions storage

root@ip-[your-ip-address]:/home/ubuntu# sudo mkdir /sessions-storage

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

root@ip-[your-ip-address]:/home/ubuntu# sudo mount 10.0.10.126:/shared-sessions-storage /sessions-storage

Edit the file /etc/fstab using vim

root@ip-[your-ip-address]:/home/ubuntu# vim /etc/fstab

... and add the following line to fstab file for permanent mount:

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:

root@ip-[your-ip-address]:/home/ubuntu# 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])
...
root@ip-[your-ip-address]:/home/ubuntu#

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 Shared Server.

3.1.7  Change to /usr/local directory, and start to download qtestctl package [TODO: update link to qtestctl-linux-x64.tgz package on production]

# cd /usr/local
# wget http://qtest-storage.s3.amazonaws.com/batman/v1.0/qtestctl-linux-x64.tgz

Extract qtestctl package and navigate to the extracted folder

# tar xzvf qtestctl-linux-x64.tgz
# cd qtestctl

3.1.8 Configure qtestctl

Edit qtest.config using following command:

# vim qtest.config
Press insert to edit config file

Now you can start edit qtest.config file.

Make sure there is sessions item in apps list, as show below, in bold.

apps = ['sessions']

3.1.9 Configure databases in postgres section

  • host: postgres database server’s host name or ip address
  • port: postgres database server’s port
  • auth: configure database authentication credentials
    • user: qTest Sessions database user name
    • pass: qTest Sessions database user password
  • db: configure qTest Sessions database
    • qtest: qTest database name
    • session: qTest Sessions database name
external {
  postgres {
    host = '10.0.10.126'
    port = 5432
  auth {
      user = 'postgres'
      pass = 'root'   
}
  db {
      qtest = 'qtest'
      session = 'sessions'
    }
  }
  ...
}

3.1.10 Configure Sessions server

In qtest.config file, navigate to section sessions in qtest.config file to configure qTest Sessions server.

  • port: configure server port that qTest Sessions will be listening
  • ssl: configure SSL if you want to deploy qTest Sessions with https protocol
    • enabled: set value to true to enable https
    • key: absolute path to .key file. Only affected if enabled field is set to true
    • cert: absolute path to .cert file. Only affected if enable is set to true
  • qtest: configure qTest Manager application URL and master token
    • host: qTest Manager URL
    • mastertoken: the token that qTest Sessions uses to connect to qTest Manager
  • storage: configure a location that qTest Sessions will store its data to
    • type: type of the storage, possible value is amazon_s3 or disk_storage
    • accesskey: if storage type is set to amazon_s3, this is the access key used to access to Amazon S3 storage. Leave this field empty if storage type is set to disk_storage
    • secretkey: if storage type is set to amazon_s3, this is the access key used to access to Amazon S3 storage. Leave this field empty if storage type is set to disk_storage
    • bucketname: if storage type is set to amazon_s3, this is ame of the name of the bucket to store data on Amazon S3
    • rootpath: if storage type is set to disk_storage, this is the absolute path to a folder on disk where data is stored

Below is an example of qTest Sessions server configuration, in bold.

...
sessions {
port: 9080
ssl {
enabled = false
key = "/absolute/path/to/dist/ssl/server.key"
cert = "/absolute/path/to/dist/ssl/server.crt"
}
qtest {
host = "http://52.199.19.30"
mastertoken: "QToy"
}
storage {
// value must be in ['amazon_s3', 'disk_storage']
// amazon_s3: stores resource files on amazon ec2
// disk_storage: stores resource files on local disk
type = 'disk_storage'
// if stores resources on Amazon S3
accesskey = ""
secretkey = ""
bucketname = ""
// if stores resources on local disk
rootpath = "/sessions-storage"
}

Press ESC and save the configuration with following command

:wq

3.1.11 Initialize qTest Sessions database and seed data

Note: this step is only executed once when you install multiple qTest Sessions on different server on load balancing environment.

Make sure qtestctl has 'execute' permission by enter following command

# sudo chmod +x qtestctl

Next, enter following command to initialize database:

# ./qtestctl sessions:initdb

If you encounter error /usr/bin/env: ‘sh\r’: No such file or directory. Run below commands then re-run the above commands again.

# sudo apt install dos2unix
# dos2unix qtestctl

3.1.12. Start qTest Sessions 

# ./qtestctl sessions:start

3.1.13 Install qtest service

To enable qTest Sessions to automatically starts when OS starts, we need to install qtest service.

Note: only proceed to this step when you successfully performed step 4.5.

From Terminal, press 'Ctrl + C' if qtestctl is running

Execute below command to install qtestctl as a service

# ./install

Verify qtest service has been successfully installed and running with following command

# systemctl status qtest
qTest has successfully started!

However, if you see:

Active: inactive (dead)

then enter following command to start the service

# systemctl start qtest

 

3.2 Install qTest Sessions Server #2 (Private IP address is 10.0.10.125)

Repeat step #3.1.1 to #3.1.13 to install qTest Sessions on server #2

 

3.3 Install qTest Sessions Load Balancer (Public IP address is 52.68.226.37)

Follow below instructions to install qTest Sessions Load Balancer.

3.3.1 Install HAProxy

Open Terminal and enter following command to install HAProxy

$ sudo su
root@ip-[your-ip-address]:# apt-get install haproxy

Edit /etc/default/haproxy to enable HAProxy to be started by the init script.

root@ip-[your-ip-address]:/usr/local# vim /etc/default/haproxy

Set ENABLED option to 1

ENABLED=1

Save and close the file when you are finished.

To check if this change is done properly execute the init script of HAProxy without any parameters. You should see the following.

root@ip-[your-ip-address]:~# service haproxy
Usage: /etc/init.d/haproxy {start|stop|reload|restart|status}

3.3.2 Configure HAProxy to load balance qTest Sessions installed on Server #1 (Private IP is 10.0.10.95) and Server #2 (Private IP is 10.0.10.125) by editing the file /etc/haproxy/haproxy.cfg with vim 

root@ip-[your-ip-address]:~# vim /etc/haproxy/haproxy.cfg

Update the file as following, note the values in bold are important configurations and red ones are information that need attention. Other default configurations should be kept unchanged.

global
        log /dev/log    local0
        log /dev/log    local1 notice
        chroot /var/lib/haproxy
        stats socket /run/haproxy/admin.sock mode 660 level admin
        stats timeout 30s
        user haproxy
        group haproxy
        daemon

        # Default SSL material locations
        ca-base /etc/ssl/certs
        crt-base /etc/ssl/private

        # Default ciphers to use on SSL-enabled listening sockets.
        # For more information, see ciphers(1SSL). This list is from:
        #  https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
        ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
        ssl-default-bind-options no-sslv3

defaults
        log     global
        mode    http
        option  httplog
        option  dontlognull
        timeout connect 5000
        timeout client  50000
        timeout server  50000
        errorfile 400 /etc/haproxy/errors/400.http
        errorfile 403 /etc/haproxy/errors/403.http
        errorfile 408 /etc/haproxy/errors/408.http
        errorfile 500 /etc/haproxy/errors/500.http
        errorfile 502 /etc/haproxy/errors/502.http
        errorfile 503 /etc/haproxy/errors/503.http
        errorfile 504 /etc/haproxy/errors/504.http

frontend http_front
   bind *:80
   mode http
   stats uri /haproxy?stats
   default_backend http_back # this will refer to a backend section whose name is `http_back`

backend http_back # here we name the backend as `http_back`
   mode http
   balance roundrobin
# We name qTest Sessions Server #1 and #2 as `sessions1` and `sessions2`,
# however you can name it whatever you want.
# The other important configuration is the IP addresses and ports of the two qTest Sessions server

# we need to enter correctly
   server sessions1 10.0.10.95:9090 check
   server sessions2 10.0.10.125:9090 check

Save and close the file when you're done

3.3.3 Verify the Load Balancer status:

Open web browser and navigate to this URL http://52.68.226.37/haproxy?stats, where 52.68.226.37 is the public IP address of the Load Balancer. If everything is OK, you'll see the result as below screenshot:

haproxystats.png

4. Configure qTest Manager

4.1 Login to your qTest Manager using a Site Administrator account

4.2 Go to the Site Administration page and click on the tab SYSTEM CONFIGURATIONS

4.3 In the QTEST EXPLORER | SESSIONS section, input the URL of your qTest Sessions site, which is the public IP Address of qTest Sessions Load Balancer

qtest-sessions-configurations-in-qtest-manager.png4.4 Click Test Connection, then click Save.

4.5 Go back to qTest Manager home page, access to qTest Sessions from nine box icon

access-to-sessions-from-nine-box.png

4.6 In qTest Sessions home page, click `+ Session` button

test-create-session-01.png

4.7 In Create Session screen, enter session title as 'Test Session' then click Save & Close button.

test-create-session-02.png

4.8 If everything is OK, the session will be created and shown in qTest Sessions home page.

test-create-session-03.png

You have successfully installed qTest Sessions on Linux load balancing environment

Subscribe To Our Blog
Powered by Zendesk