1.2.1 Install qTest Sessions 3.0.9 on CentOS/Ubuntu Single Machine (non-Docker)

In this guide, we will run you through step by step to install qTest Sessions v3.0.9 on a separated CentOS/Ubuntu machine and then connect to qTest Manager 8.4.4 or later on a different machine.

If you are upgrading to qTest Sessions 3.0.9, follow this guideline instead: Upgrade to qTest Sessions 3.0.9 on CentOS/Ubuntu Single Machine (non-Docker)

IMPORTANT: 

  • qTest Sessions v3.0.9 only works with qTest Manager v8.4.4 or later
  • This guideline is made and verified on CentOS/Ubuntu 16. If you are using other versions and found that some installation commands do not work, please contact our Customer Support.

Before you begin

Install qTest Sessions

Most of the installation steps are performed on Terminal. It is highly recommended that you copy and paste the command/scripts to your Terminal and execute it.

1. Open Terminal

 

2. Make sure you will do all the installation steps as system user by executing following command:

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

 

3. Execute following command to update and upgrade system packages

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

 

Next, if you want to install PostgreSQL in the same machine with qTest Sessions, follow steps #4, #5, #6, #7, #8, #9

4. Install PostgreSQL 9.5

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

 

5. Verify that PostgreSQL service is running with following command

root@ip-[your-ip-address]:/home/ubuntu# systemctl status postgresql

If PostgreSQL is running, you'll see output that includes the text Active: active (exited).

If you see Active: inactive (dead), start the PostgreSQL service using the following command:

root@ip-[your-ip-address]:/home/ubuntu# systemctl start postgresql

PostgreSQL also needs to be enabled to start on reboot. Do that with this command:

root@ip-[your-ip-address]:/home/ubuntu# systemctl enable postgresql

 

6. Set password for postgres database user

In this guideline we'll use root as password for postgres user

root@ip-[your-ip-address]:/home/ubuntu# sudo -u postgres psql postgres
postgres=# \password
Enter new password: root
Enter it again: root
postgres=# \q

 

7. Create qTest Sessions database schema by `postgres` database user and name it `sessions` 

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

 

8. Verify the database has been created successfully with following commands

postgres@ip-[your-ip-address]:~$ psql
postgres@ip-[your-ip-address]:~$ \l

The result would look like below that shows the sessions database has been created

postgres-l.png

 

9. Quit PostgreSQL command prompt and logout postgres user

postgres=# \q
postgres@ip-[your-ip-address]=# \exit

 

10. Install Redis

root@ip-[your-ip-address]:/home/ubuntu# add-apt-repository ppa:chris-lea/redis-server
root@ip-[your-ip-address]:/home/ubuntu# apt-get update
root@ip-[your-ip-address]:/home/ubuntu# apt-get install redis-server -y

Verify Redis service is running with following command

root@ip-[your-ip-address]:/home/ubuntu# redis-cli ping
PONG
root@ip-[your-ip-address]:/home/ubuntu#

 

11. Install Java 8

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

The java installation will ask for confirmation, just answer 'Y', 'Ok' and/or 'Yes' where applicable.

Verify Java has been installed successfully

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

 

12. Install and start Elasticsearch service 

Download and install the Public Signing Key:

root@ip-[your-ip-address]:/home/ubuntu# wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

Save the repository definition to /etc/apt/sources.list.d/elasticsearch-{branch}.list:

root@ip-[your-ip-address]:/home/ubuntu# echo "deb http://packages.elastic.co/elasticsearch/1.7/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-1.7.list
Run apt-get update and the repository is ready for use. Now you can install it with:
root@ip-[your-ip-address]:/home/ubuntu# apt-get update && apt-get install elasticsearch
Configure Elasticsearch to automatically start during boot up
root@ip-[your-ip-address]:/home/ubuntu# systemctl daemon-reload
root@ip-[your-ip-address]:/home/ubuntu# systemctl enable elasticsearch.service

Start Elasticsearch service:

root@ip-[your-ip-address]:/home/ubuntu# service elasticsearch start

Verify Elasticsearch is running by following command and make sure the result includes 'Active: active running'

root@ip-[your-ip-address]:/home/ubuntu# systemctl status elasticsearch
elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2017-05-22 09:23:38 UTC; 10min ago
     Docs: http://www.elastic.co
Main PID: 1192 (java)
    Tasks: 44
   Memory: 292.6M
      CPU: 20.653s
   CGroup: /system.slice/elasticsearch.service
           └─1192 /usr/bin/java -Xms256m -Xmx1g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly

May 22 09:23:38 ip-10-0-10-78 systemd[1]: Started Elasticsearch.
root@ip-10-0-10-78:/home/ubuntu#

 

13. Install qTest Sessions 3.0.9

Change to /usr/local directory and start to install qTest Sessions

[TODO: update download url in production]

root@ip-[your-ip-address]:/home/ubuntu/elasticsearch-1.7.3# cd /usr/local
root@ip-[your-ip-address]:/usr/local# wget [/url/to/sessions-linux-3.0.9.tar.gz]
root@ip-[your-ip-address]:/usr/local# tar xzvf sessions-linux-3.0.9.tar.gz
root@ip-[your-ip-address]:/usr/local# cd sessions-linux-3.0.9
root@ip-[your-ip-address]:/usr/local/sessions-linux-3.0.9# ./installer -t install -d /usr/local/sessions-linux-3.0.9
Your Sessions server has setup completely. Please goto /usr/local/sessions-linux-3.0.9 and run configure.sh file to configure your Sessions server.

 

14. Configure qTest Sessions

Edit configurer.properties file with vim

root@ip-[your-ip-address]:/usr/local/sessions-linux-3.0.9# vim conf/configurer.properties 

Update the configuration information as below. Values in bold are important configurations that you must enter correctly.

# database configuration
db.host=52.198.32.183 # YOUR POSTGRES SERVER HOST NAME OR IP ADDRESS
db.port=5432 # POSTGRES SERVER PORT, DEFAULT IS 5432
db.user=postgres # POSTGRES USER NAME
db.password=root # POSTGRES USER PASSWORD
db.schema=sessions # DATABASE NAME
db.action=0 # KEEP THIS VALUE AS 0 FOR FRESH INSTALL

# redis configuration
redis.host=localhost # Redis SERVER HOST NAME OR IP ADDRESS
redis.port=6379 # Redis SERVER Port

# qtest configuration
qtest.url=https://52.198.32.183:443 # qTest URL specifying IP Address and port with SSL 
qtest.master_token=QToy # qTest Master Token

# elastic search configuration
es.http.host=localhost
es.http.port=9200
es.cluster.name=elasticsearch

es.nodes=1
es.tcp.1.host=localhost
es.tcp.1.port=9300

# application information.
# Note: the port number must be available and not being used by any other application
web.http.port=9090
web.https.port=9443
web.shutdown.port=9005
web.ajp.port=9009
web.ssl.required=true # set the value to `true` to enable SSL

# declare eXplorer API url to use.
web.url=https://52.198.32.183:9443 # qTest Sessions Web URL. Note: the port number must be available and not being used by any other application
# storage configuration
# storage.type suitable value (disk | s3 | riakcs)
storage.type=disk

# disk storage configuration.
# make sure the directory exists after you're done with this configuration
storage.rootPath=/usr/local/sessions/storage

When you're done with the configuration, save and close the file.

Next, run below commands to configure qTest Sessions.

root@ip-[your-ip-address]:/usr/local/sessions-linux-3.0.9# ./configurer.sh
...
...
BUILD SUCCESSFUL Total time: 4 seconds /usr/local/sessions-linux-3.0.9 ========================================================================== >>> BEGIN CHECKING REDIS SERVER. ========================================================================== [ * ] Server host: localhost [ * ] Server port: 6379 [ * ] Redis health check ... [ PASSED ] [ * ] Redis read-write check ... [ PASSED ] [ * ] Configure DB cluster ... [ PASSED ] [ * ] Configure ES cluster ... [ PASSED ] [ * ] Configure redis cluster ... [ PASSED ] [ * ] Configure file storage ... [ PASSED ] [ * ] Configure qTest account ... [ PASSED ] [ * ] Configure admin account ... [ PASSED ] ========================================================================== >>> END CHECKING REDIS SERVER. [ PASSED ] ========================================================================== ========================================================================== >>> BEGIN INITIATE ELASTICSEARCH SERVER. ========================================================================== [ * ] Server host: localhost [ * ] Server port: 9200 [ * ] Server protocol: HTTP [ * ] ElasticServer heath check ... [ PASSED ] [ * ] Resolve current index... [ PASSED ] [ * ] Create ElasticSearch Index ... [ PASSED ] [ * ] Create session mapping ... [ PASSED ] [ * ] Create application info mapping ... [ PASSED ] [ * ] Create system info mapping ... [ PASSED ] [ * ] Create coverages mapping ... [ PASSED ] [ * ] Create time line mapping ... [ PASSED ] [ * ] Create screen mapping ... [ PASSED ] [ * ] Create note mapping ... [ PASSED ] [ * ] Migrate ES data ... [ SKIPPED ] [ * ] Validating current Elasticsearch server ... [ PASSED ] ========================================================================== >>> END INITIATE ELASTICSEARCH SERVER. [ PASSED ] ========================================================================== Configures eXplorer API successfully. root@ip-10-0-10-13:/usr/local/sessions-linux-3.0.9#

Note: if you configured to enable SSL in configurer.properties file, you will be asked for paths to the SSL certificate. Below is an example to specify certificate paths to certificate that is located at /usr/local 

Private key path: /usr/local/server.key
Private key password: [ENTER PRIVATE KEY PASSWORD HERE]
Certificate path: /usr/local/server.crt
Chain certificate path (Optional): [YOU CAN OPTIONALLY ENTER Chain certificate path HERE]

 

15. Configure qTest Sessions service

root@ip-[your-ip-address]:/usr/local/sessions-linux-3.0.9# cd /etc/init.d
root@ip-[your-ip-address]:/etc/init.d# ln -sn -f /usr/local/sessions-linux-3.0.9/bin/explorerd
root@ip-[your-ip-address]:/etc/init.d# systemctl enable /usr/local/sessions-linux-3.0.9/bin/explorerd.service

 

16. Start qTest Sessions service 

root@ip-[your-ip-address]:/usr/local# service explorerd start

Access to qTest site configure it to connect to qTest Sessions

 

17. Configure qTest Manager to connect to qTest Sessions

  • Login to your qTest Manager using a Site Administrator account
  • Go to the Site Administration page and click on the tab SYSTEM CONFIGURATIONS
  • In the QTEST EXPLORER | SESSIONS section, input the URL of your qTest Sessions site, such as http://[qTest_Sessions_IP_Address]:[HTTP_Port] or https://[qTest_Sessions_IP_Address]:[HTTP_port] if you installed qTest Sessions with SSL certificate.
  • connect-to-sessions-from-qtest.png

18. Access to qTest Sessions from qTest Manager

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

Sessions-Saved-Session.png