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.
- Install in Clustered Environment
- OR Install in Load Balanced Environment
Scenario 1: Install qTest Sessions in Cluster environment
Diagram below demonstrates a sample scenario that deploys qTest Sessions in a Cluster environment along with other applications of the qTest Platform.
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: 13.112.179.6
Shared Server: a server that hosts shared components and/or software packages that are required to run qTest Manager and qTest Sessions
- Redis: used as a cache store for qTest Sessions
- RabbitMQ: message broker software that implements the Advanced Message Queuing Protocol (AMQP), this components are required by qTest Manager
- qTest Notification: a notification service used by qTest Manager
- Elasticsearch: a distributed search and analytics engine for qTest Sessions
- 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 toInstall qTest Manager 8.4 on CentOS/Ubuntu Single Machine (non-Docker), when you are done, proceed to the next step.
2. Install qTest Sessions:
2.1. Setup Shared Server (Private IP: 10.0.10.126)
We are going to install components on Shared Server that are required to run qTest Sessions:
- Redis,
- Elasticsearch
Access to the Shared Server and install following applications and/or packages
2.1.1 Install Redis:
Make sure we are executing commands as system user.
ubuntu@ip-[your-ip-address]:/home/ubuntu# sudo su
Update our local apt
package cache and install the dependencies.
root@ip-[your-ip-address]:/home/ubuntu# apt-get update
We will not need to keep the source code that we will compile long term (we can always re-download it), we will build in the /tmp
directory. Let's move there now:
root@ip-[your-ip-address]:/home/ubuntu# cd /tmp
root@ip-[your-ip-address]:/tmp#
Download the latest stable version of Redis
root@ip-[your-ip-address]:/tmp# curl -O http://download.redis.io/redis-stable.tar.gz
Unpack the tarball
root@ip-[your-ip-address]:/tmp# tar xzvf redis-stable.tar.gz
Move into the Redis source directory structure that was just extracted
root@ip-[your-ip-address]:/tmp# cd redis-stable
Compile the Redis binaries
root@ip-[your-ip-address]:/tmp# make
Compile the Redis binaries
root@ip-[your-ip-address]:/tmp# make
Install the binaries onto the system
root@ip-[your-ip-address]:/tmp# make install
Create a configuration directory. We will use the conventional /etc/redis
directory
root@ip-[your-ip-address]:/tmp# mkdir /etc/redis
Copy over the sample Redis configuration file included in the Redis source archive
root@ip-[your-ip-address]:/tmp# cp /tmp/redis-stable/redis.conf /etc/redis
Next, we can open the file to adjust a few items in the configuration
root@ip-[your-ip-address]:/tmp# vim /etc/redis/redis.conf
In the redis.conf file, find the supervised
directive. Currently, this is set to no
. Since we are running an operating system that uses the systemd init system, we can change this to systemd
:
. . .
# If you run Redis from upstart or systemd, Redis can interact with your
# supervision tree. Options:
# supervised no - no supervision interaction
# supervised upstart - signal upstart by putting Redis into SIGSTOP mode
# supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET
# supervised auto - detect upstart or systemd method based on
# UPSTART_JOB or NOTIFY_SOCKET environment variables
# Note: these supervision methods only signal "process is ready."
# They do not enable continuous liveness pings back to your supervisor.
supervised systemd
. . .
Next, find the dir
directory. This option specifies the directory that Redis will use to dump persistent data. We need to pick a location that Redis will have write permission and that isn't viewable by normal users.
We will use the /var/lib/redis
directory for this, which we will create in a moment:
. . .
# The working directory.
#
# The DB will be written inside this directory, with the filename specified
# above using the 'dbfilename' configuration directive.
#
# The Append Only File will also be created inside this directory.
## Note that you must specify a directory here, not a file name.
dir /var/lib/redis
. . .
Next, configure Redis to allow access from outside.
Look for the like below
bind 127.0.0.1
and change it to:
bind 0.0.0.0 ::1
Save and close the file when you are finished.
Next, we can create a systemd unit file so that the init system can manage the Redis process.
Create and open the /etc/systemd/system/redis.service
file to get started:
root@ip-[your-ip-address]:/tmp# vim /etc/systemd/system/redis.service
Inside redis.service file, we can begin the [Unit]
section by adding a description and defining a requirement that networking be available before starting this service:
/etc/systemd/system/redis.service
[Unit]
Description=Redis In-Memory Data Store
After=network.target
In the [Service]
section, we need to specify the service's behavior. For security purposes, we should not run our service as root
. We should use a dedicated user and group, which we will call redis
for simplicity. We will create these momentarily.
To start the service, we just need to call the redis-server
binary, pointed at our configuration. To stop it, we can use the Redis shutdown
command, which can be executed with the redis-cli
binary. Also, since we want Redis to recover from failures when possible, we will set the Restart
directive to "always":
/etc/systemd/system/redis.service
[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
User=redis
Group=redis
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always
Finally, in the [Install]
section, we can define the systemd target that the service should attach to if enabled (configured to start at boot):
/etc/systemd/system/redis.service
[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
User=redis
Group=redis
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always
[Install]
WantedBy=multi-user.target
Save and close the file when you are finished.
Create the Redis User, Group and Directories
Now, we just have to create the user, group, and directory that we referenced in the previous two files
root@ip-[your-ip-address]:/tmp# adduser --system --group --no-create-home redis
Create the /var/lib/redis
directory
root@ip-[your-ip-address]:/tmp# mkdir /var/lib/redis
Give the redis
user and group ownership over this directory:
root@ip-[your-ip-address]:/tmp# chown redis:redis /var/lib/redis
Adjust the permissions so that regular users cannot access this location:
root@ip-[your-ip-address]:/tmp# chmod 770 /var/lib/redis
Start the Redis service
root@ip-[your-ip-address]:/tmp# systemctl start redis
Check that the service had no errors by running
root@ip-[your-ip-address]:/tmp# systemctl status redis
redis.service - Redis Server
Loaded: loaded (/etc/systemd/system/redis.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2016-05-11 14:38:08 EDT; 1min 43s ago
Process: 3115 ExecStop=/usr/local/bin/redis-cli shutdown (code=exited, status=0/SUCCESS)
Main PID: 3124 (redis-server)
Tasks: 3 (limit: 512)
Memory: 864.0K
CPU: 179ms
CGroup: /system.slice/redis.service
└─3124 /usr/local/bin/redis-server 127.0.0.1:6379
. . .
Test Redis instance
root@ip-[your-ip-address]:/tmp# redis-cli ping
PONG
root@ip-[your-ip-address]:/tmp#
Enable Redis to start at Boot
root@ip-[your-ip-address]:/tmp# systemctl enable redis
You have finished install Redis.
2.2 Install Elasticsearch
2.2.1 First you need to install Java 8 for Elasticsearch to work
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)
2.2.2 Install Elasticsearch 1.7
Follow one of below instruction to install Elasticsearch dependent on your environment.
2.2.2.1 Install Elasticsearch on Ubuntu 16:
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
root@ip-[your-ip-address]:/home/ubuntu# apt-get update && apt-get install elasticsearch
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#
2.2.2.2 Install Elasticsearch on CentOS 7+:
Download and install the public signing key:
# rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
Add the following in your /etc/yum.repos.d/
directory in a file with a .repo
suffix, for example elasticsearch.repo
[elasticsearch-1.7]
name=Elasticsearch repository for 1.7.x packages
baseurl=http://packages.elastic.co/elasticsearch/1.7/centos
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1
And your repository is ready for use. You can install it with:
# yum install elasticsearch
Configure Elasticsearch to automatically start during bootup. If your distribution is using SysV init
(check with ps -p 1
), then you will need to run:
# chkconfig --add elasticsearch
Otherwise if your distribution is using systemd
:
# sudo /bin/systemctl daemon-reload
# sudo /bin/systemctl enable elasticsearch.service
You have finished installing Elasticsearch.
2.3 Install PostgreSQL 9.5
Access to your DB Server then follow below instruction to install PostgreSQL 9.5 on Ubuntu.
2.3.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.3.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.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.3.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.3.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.3.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.
2.4 Install qTest Sessions (Public IP address: 13.112.179.6)
2.4.1 Access to your Ubuntu server.
2.4.2. Open Terminal
2.4.3. 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
2.4.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
2.4.5 Change to /usr/local directory and start to install qTest Sessions
root@ip-[your-ip-address]:/home/ubuntu# cd /usr/local
root@ip-[your-ip-address]:/usr/local# wget https://qtest-storage.s3.amazonaws.com/sessions/3.0/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.
2.4.6 Configure qTest Sessions Server #1
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 and red are important configurations that you must enter correctly.
# database configuration db.host=10.0.10.126 # YOUR SHARED SERVER 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 # QTEST SESSIONS DATABASE NAME db.action=0 # KEEP THIS VALUE AS 0 FOR FRESH INSTALL # redis configuration redis.host=10.0.10.126 # YOUR SHARED SERVER IP ADDRESS WHERE REDIS WAS INSTALLED
redis.port=6379 # REDIS SERVER PORT, DEFAULT IS 6379
# qtest configuration
qtest.url=http://52.199.19.30 # QTEST MANAGER PUBLIC IP ADDRESS. WE ASSUME IT IS RUNNING ON PORT 80
qtest.master_token=QToy # QTEST MASTER TOKEN
# elastic search configuration
es.http.host=10.0.10.126 # YOUR SHARED SERVER IP ADDRESS WHERE ELASTICSEARCH WAS INSTALLED
es.http.port=9200 # ELASTICSEARCH SERVER PORT, DEFAUT IS 9200
es.cluster.name=elasticsearch # DEFAULT ELASTICSEARCH CLUSTER NAME
es.nodes=1
es.tcp.1.host=10.0.10.126
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 # QTEST SESSIONS WILL BE RUNNING ON PORT 9090
web.https.port=9443
web.shutdown.port=9005
web.ajp.port=9009
web.ssl.required=false # WE WILL NOT DEPLOY SSL FOR SIMPLICITY
# declare eXplorer API url to use.
web.url=http://13.112.179.6:9090 # QTEST SESSIONS WEB URL
# 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=/home/ubuntu/sessions-storage
When you're done with the configuration, save and close the file.
2.4.7 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#
2.4.8. 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
2.4.9. Start qTest Sessions service
root@ip-[your-ip-address]:/usr/local# service explorerd start
3. Configure qTest Manager:
- 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: http://13.112.179.6:9090
- Click Test Connection, then click Save
- Go back to qTest Manager home page, access to qTest Sessions from nine box icon. If you can access to qTest Sessions home page, you have successfully installed qTest Sessions on Cluster environment
Scenario 2: Install qTest Sessions with Load Balancer
Diagram below demonstrates a sample scenario to deploy qTest Sessions in a load balancing environment:
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
- Redis: used as a cache store
- Elasticsearch: a distributed search and analytics engine
- 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:
Follow instruction to Install qTest Manager 8.4 on CentOS/Ubuntu Single Machine (non-Docker)
After installed qTest Manager, note down its IPv4 Public IP address. This is the IP address that qTest Manager and 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:
Access to the shared server and install following applications and/or packages
2.1 Install Redis:
2.1.1 Make sure we are executing commands as system user.
ubuntu@ip-[your-ip-address]:/home/ubuntu# sudo su
2.1.2 Update our local apt
package cache and install the dependencies.
root@ip-[your-ip-address]:/home/ubuntu# apt-get update
2.1.3 We will not need to keep the source code that we will compile long term (we can always re-download it), we will build in the /tmp
directory. Let's move there now:
root@ip-[your-ip-address]:/home/ubuntu# cd /tmp
root@ip-[your-ip-address]:/tmp#
2.1.4 Download the latest stable version of Redis
root@ip-[your-ip-address]:/tmp# curl -O http://download.redis.io/redis-stable.tar.gz
2.1.5 Unpack the tarball
root@ip-[your-ip-address]:/tmp# tar xzvf redis-stable.tar.gz
2.1.6 Move into the Redis source directory structure that was just extracted
root@ip-[your-ip-address]:/tmp# cd redis-stable
2.1.7 Compile the Redis binaries
root@ip-[your-ip-address]:/tmp# make
2.1.8 Compile the Redis binaries
root@ip-[your-ip-address]:/tmp# make
2.1.9 Install the binaries onto the system
root@ip-[your-ip-address]:/tmp# make install
2.1.10 Create a configuration directory. We will use the conventional /etc/redis
directory
root@ip-[your-ip-address]:/tmp# mkdir /etc/redis
2.1.11 Copy over the sample Redis configuration file included in the Redis source archive
root@ip-[your-ip-address]:/tmp# cp /tmp/redis-stable/redis.conf /etc/redis
2.1.12 Next, we can open the file to adjust a few items in the configuration
root@ip-[your-ip-address]:/tmp# vim /etc/redis/redis.conf
2.1.13 In the file, find the supervised
directive. Currently, this is set to no
. Since we are running an operating system that uses the systemd init system, we can change this to systemd
:
. . .
# If you run Redis from upstart or systemd, Redis can interact with your
# supervision tree. Options:
# supervised no - no supervision interaction
# supervised upstart - signal upstart by putting Redis into SIGSTOP mode
# supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET
# supervised auto - detect upstart or systemd method based on
# UPSTART_JOB or NOTIFY_SOCKET environment variables
# Note: these supervision methods only signal "process is ready."
# They do not enable continuous liveness pings back to your supervisor.
supervised systemd
. . .
2.1.14 Next, find the dir
directory. This option specifies the directory that Redis will use to dump persistent data. We need to pick a location that Redis will have write permission and that isn't viewable by normal users.
We will use the /var/lib/redis
directory for this, which we will create in a moment:
. . .
# The working directory.
#
# The DB will be written inside this directory, with the filename specified
# above using the 'dbfilename' configuration directive.
#
# The Append Only File will also be created inside this directory.
## Note that you must specify a directory here, not a file name.
dir /var/lib/redis
. . .
2.1.15 Next, configure Redis to allow access from outside.
Look for the like below
bind 127.0.0.1
and change it to:
bind 0.0.0.0 ::1
Save and close the file when you are finished.
2.1.16 Next, we can create a systemd unit file so that the init system can manage the Redis process.
Create and open the /etc/systemd/system/redis.service
file to get started:
root@ip-[your-ip-address]:/tmp# vim /etc/systemd/system/redis.service
2.1.17 Inside, we can begin the [Unit]
section by adding a description and defining a requirement that networking be available before starting this service:
/etc/systemd/system/redis.service
[Unit]
Description=Redis In-Memory Data Store
After=network.target
2.1.18 In the [Service]
section, we need to specify the service's behavior. For security purposes, we should not run our service as root
. We should use a dedicated user and group, which we will call redis
for simplicity. We will create these momentarily.
To start the service, we just need to call the redis-server
binary, pointed at our configuration. To stop it, we can use the Redis shutdown
command, which can be executed with the redis-cli
binary. Also, since we want Redis to recover from failures when possible, we will set the Restart
directive to "always":
/etc/systemd/system/redis.service
[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
User=redis
Group=redis
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always
2.1.19 Finally, in the [Install]
section, we can define the systemd target that the service should attach to if enabled (configured to start at boot):
/etc/systemd/system/redis.service
[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
User=redis
Group=redis
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always
[Install]
WantedBy=multi-user.target
Save and close the file when you are finished.
2.1.20 Create the Redis User, Group and Directories
Now, we just have to create the user, group, and directory that we referenced in the previous two files
root@ip-[your-ip-address]:/tmp# adduser --system --group --no-create-home redis
Create the /var/lib/redis
directory
root@ip-[your-ip-address]:/tmp# mkdir /var/lib/redis
Give the redis
user and group ownership over this directory:
root@ip-[your-ip-address]:/tmp# chown redis:redis /var/lib/redis
Adjust the permissions so that regular users cannot access this location:
root@ip-[your-ip-address]:/tmp# chmod 770 /var/lib/redis
2.1.21 Start the Redis service
root@ip-[your-ip-address]:/tmp# systemctl start redis
2.1.22 Check that the service had no errors by running
root@ip-[your-ip-address]:/tmp# systemctl status redis
redis.service - Redis Server
Loaded: loaded (/etc/systemd/system/redis.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2016-05-11 14:38:08 EDT; 1min 43s ago
Process: 3115 ExecStop=/usr/local/bin/redis-cli shutdown (code=exited, status=0/SUCCESS)
Main PID: 3124 (redis-server)
Tasks: 3 (limit: 512)
Memory: 864.0K
CPU: 179ms
CGroup: /system.slice/redis.service
└─3124 /usr/local/bin/redis-server 127.0.0.1:6379
. . .
2.1.23 Test Redis instance
root@ip-[your-ip-address]:/tmp# redis-cli ping
PONG
root@ip-[your-ip-address]:/tmp#
2.1.24 Enable Redis to start at Boot
root@ip-[your-ip-address]:/tmp# systemctl enable redis
You have finished install Redis.
2.2 Install Elasticsearch
2.2.1 First you need to install Java 8 for Elasticsearch to work
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)
2.2.2 Install Elasticsearch 1.7
Follow one of below instruction to install Elasticsearch dependent on your environment.
2.2.2.1 Install Elasticsearch on Ubuntu 16:
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
root@ip-[your-ip-address]:/home/ubuntu# apt-get update && apt-get install elasticsearch
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#
2.2.2.2 Install Elasticsearch on CentOS 7+:
Download and install the public signing key:
# rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
Add the following in your /etc/yum.repos.d/
directory in a file with a .repo
suffix, for example elasticsearch.repo
[elasticsearch-1.7]
name=Elasticsearch repository for 1.7.x packages
baseurl=http://packages.elastic.co/elasticsearch/1.7/centos
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1
And your repository is ready for use. You can install it with:
# yum install elasticsearch
Configure Elasticsearch to automatically start during bootup. If your distribution is using SysV init
(check with ps -p 1
), then you will need to run:
# chkconfig --add elasticsearch
Otherwise if your distribution is using systemd
:
# sudo /bin/systemctl daemon-reload
# sudo /bin/systemctl enable elasticsearch.service
You have finished installing Elasticsearch.
2.3 Install NFS (Network File Systems)
2.3.1 Update the repositories:
root@ip-[your-ip-address]:/home/ubuntu# sudo apt-get update
2.3.2 Install NFS server package by typing the command:
root@ip-[your-ip-address]:/home/ubuntu# sudo apt-get install nfs-kernel-server
2.3.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.3.4 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.
Edit /etc/exports config file
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.3.4 Start NFS service
root@ip-[your-ip-address]:/home/ubuntu# sudo /etc/init.d/nfs-kernel-server start
2.3.5 Check the share status
root@ip-[your-ip-address]:/home/ubuntu# sudo exportfs -u
/shared-sessions-storage <world>
root@ip-[your-ip-address]:/home/ubuntu#
2.4 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.4.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.4.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.4.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.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)
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 your Ubuntu server.
3.1.2. Open Terminal
3.1.3. 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.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
3.1.5 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 for permanent mount:
10.0.10.126:/shared-sessions-storage /sessions-storage nfs rw,sync,hard,intr 0 0
Save and close the file/etc/fstab when you are done.
Check the mounted share directory using 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 the files created/updated/deleted by qTest Sessions will be created/updated/deleted in the shared directory named shared-sessions-storage in Share Server.
3.1.6 Change to /usr/local directory and start to install qTest Sessions
root@ip-[your-ip-address]:/home/ubuntu# cd /usr/local
root@ip-[your-ip-address]:/usr/local# wget https://qtest-storage.s3.amazonaws.com/sessions/3.0/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.
3.1.7. Configure qTest Sessions Server #1
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 and red are important configurations that you must enter correctly.
# database configuration db.host=10.0.10.126 # YOUR SHARED SERVER 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 # QTEST SESSIONS DATABASE NAME db.action=0 # KEEP THIS VALUE AS 0 FOR FRESH INSTALL # redis configuration redis.host=10.0.10.126 # YOUR SHARED SERVER IP ADDRESS WHERE REDIS WAS INSTALLED
redis.port=6379 # REDIS SERVER PORT, DEFAULT IS 6379
# qtest configuration
qtest.url=http://52.199.19.30 # QTEST MANAGER PUBLIC IP ADDRESS. WE ASSUME IT IS RUNNING ON PORT 80
qtest.master_token=QToy # QTEST MASTER TOKEN
# elastic search configuration
es.http.host=10.0.10.126 # YOUR SHARED SERVER IP ADDRESS WHERE ELASTICSEARCH WAS INSTALLED
es.http.port=9200 # ELASTICSEARCH SERVER PORT, DEFAUT IS 9200
es.cluster.name=elasticsearch # DEFAULT ELASTICSEARCH CLUSTER NAME
es.nodes=1
es.tcp.1.host=10.0.10.126
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 # QTEST SESSIONS WILL BE RUNNING ON PORT 9090
web.https.port=9443
web.shutdown.port=9005
web.ajp.port=9009
web.ssl.required=false # WE WILL NOT DEPLOY SSL FOR SIMPLICITY
# declare eXplorer API url to use.
web.url=http://10.0.10.95:9090 # QTEST SESSION WEB URL
# 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=/sessions-storage
When you're done with the configuration, save and close the file.
3.1.8 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#
3.1.7. 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
3.1.8. Start qTest Sessions service
root@ip-[your-ip-address]:/usr/local# service explorerd start
4. Install qTest Sessions Server #2:
4.1 Install qTest Sessions Server #2 (Private IP address is 10.0.10.125)
4.1.1 Repeat steps #3.1.1 to #3.1.6 to install prerequisite packages
4.1.2 Configure qTest Sessions Server #2:
Make sure you change directory to /user/local/sessions-linux-3.0.9
$ cd /usr/local/sessions-linux-3.0.9
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 and red are important configurations that you must enter correctly.
# database configuration db.host=10.0.10.125 # YOUR SHARED SERVER 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 # QTEST SESSIONS DATABASE NAME db.action=1 # IT'S IMPORTANT TO CHANGE THIS VALUE TO 1 (UPDATE) SINCE WE ALREADY CREATE DATABASE WHEN WE INSTALLED QTEST SESSIONS ON SERVER #1 # redis configuration redis.host=10.0.10.125 # YOUR SHARED SERVER IP ADDRESS WHERE REDIS WAS INSTALLED
redis.port=6379 # REDIS SERVER PORT, DEFAULT IS 6379
# qtest configuration
qtest.url=http://52.199.19.30 # QTEST MANAGER PUBLIC IP ADDRESS. WE ASSUME IT IS RUNNING ON PORT 80
qtest.master_token=QToy # QTEST MASTER TOKEN
# elastic search configuration
es.http.host=10.0.10.126 # YOUR SHARED SERVER IP ADDRESS WHERE ELASTICSEARCH WAS INSTALLED
es.http.port=9200 # ELASTICSEARCH SERVER PORT, DEFAUT IS 9200
es.cluster.name=elasticsearch
es.nodes=1
es.tcp.1.host=10.0.10.126
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 # QTEST SESSIONS WILL BE RUNNING ON PORT 9090
web.https.port=9443
web.shutdown.port=9005
web.ajp.port=9009
web.ssl.required=false # WE WILL NOT DEPLOY SSL FOR SIMPLICITY
# declare eXplorer API url to use.
web.url=http://10.0.10.125:9090 # QTEST SESSION WEB URL
# 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=/sessions-storage
When you're done with the configuration, save and close the file.
Next, run below commands to configure qTest Sessions. You terminal will now look something like below.
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#
4.1.3. 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
4.1.4. Start qTest Sessions service
root@ip-[your-ip-address]:/usr/local# service explorerd start
5. Install qTest Sessions Load Balancer:
Follow below instructions to install qTest Sessions Load Balancer.
5.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}
5.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
5.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:
6. Configure qTest Manager:
- 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, which is the public IP Address of qTest Sessions Load Balancer
- Click Test Conenction, then click Save
- Go back to qTest Manager home page, access to qTest Sessions from nine box icon.
- In qTest Sessions home page, click `+ Session` button
- In Create Session screen, enter session title as 'Test Session' then click Save & Close button.
- If everything is OK, the session will be created and shown in qTest Sessions home page.
That's it! You have successfully installed qTest Sessions on load balancing environment.