Overview
Use this article to install and configure prerequisite applications before you install qTest 9.5.3 OnPremise (Q1 2019 release) on a native Linux (CentOS or Ubuntu) machine, non-Docker. These prerequisite applications apply both to a single server or load balancing server.
There are 3 required prerequisites:
- PostgreSQL 9.5.4 to 9.6.6
- PostgreSQL 10 is NOT certified for this release.
- ElasticSearch 6.3 to 6.6
- NEW for this version! Read the release notes here for the reason why we included as a prereq!
- MongoDB 3.4 to 3.6 (needed for Scenario and Pulse)
Important: We provide a range of supported versions for the prerequisite components so that OnPremise customers can easily maintain qTest OnPremise over time. This reduces the need for you to upgrade every prerequisite component each time you upgrade qTest to the most recent version.
Ports
Please note, that you must open the ports below prior to any self/assisted installation or upgrade.
Prerequisite Applications |
|
---|---|
Product | Port |
Postgres | 5432 |
Elasticsearch | 9200 |
Network Drive | 2049 |
MongoDB | 27017 |
Install PostgreSQL on CentOS
Please note, that the example installations below, provide the recommended install version. However, you can use a prerequisite version different than these examples as long as the prerequisite version falls within the range of supported versions listed above.
IMPORTANT:
- PostgreSQL 10 is NOT certified for this release.
- All commands need to be executed under Root user.
Install
Follow this article to install PostgreSQL v9.5 on your CentOS server using YUM installation.
Please note to use the following command to install both postgres server and extension, rather than only the server as in the guide.
# yum install postgresql95-server postgresql95-contrib
Enable Remote Access
After you have finished installing PostgreSQL, enable remote access to PostgreSQL database server:
- Search for file pg_hba.conf in Postgresql's installation directory.
Typically stored at /var/lib/pgsql/x.y/data
Example: /var/lib/pgsql/9.5/data# find /etc -name "pg_hba.conf" or find /var -name "pg_hba.conf"
- Edit the file and append the following line, specify the IP of the server which will remotely connect to your PostgreSQL. This should be the servers where qTest packages are installed.
If you want to allow connection from multiple client machines on a specific network, specify the network address here in the CIDR-address format:
[IP Address]/[Netmask in bits]
If you want your PostgreSQL to accept all incoming connections regardless of the source IP address, use 0.0.0.0/0 as the IP address.
host all all [IP address]/[Netmask in bits] md5
You can define your specific PGSQL database host by running the ifconfig command on the PGSQL host on the appropriate network interface note the inet address which is IPV4 such as 192.168.0.255 and the netmask such as 255.255.255.0 (this is for the netmask calculation below.
Calculation: An octet is any value between 0 - 255 of an IP address or a netmask that represents one of 4 possible decimal places in an IP or netmask such as 255.255.255.0. Note where each octet is 255. So in our example for each octet in the netmask that has 255, let that represent the value 8, which represents the number of bits in the netmask. In our example we have 3 octets that are full octets so they will represent the full 8 bits so our netmask in bits will represent 24. For our example, the CIDR format will look like 192.168.0.255/24
Warning: netmask calculations can quickly become complicated if the netmask has values other than 0 or 255. If your network interface has any values between 0 and 255, consult with your network team to determine the CIDR format for you PGSQL host. - Search for file postgresql.conf in Postgresql's installation directory typically the same directory as pg_hba.conf
# find /etc -name "postgresql.conf" or find /var -name "postgresql.conf"
- Edit the above file. Search for property listen_address and modify it to (remove # at the beginning of the line if it is there.)
listen_addresses = '*'
Change Postgres User's Password
IMPORTANT:
- qtestctl does not support special characters "#" or "?" in your PostgreSQL password
Run the following commands to change the password:
# sudo -u postgres psql postgres=# \password Enter new password: Enter it again:
Install PostgreSQL on Ubuntu
IMPORTANT: All commands need to be executed under Root user
PostgreSQL is available in all Ubuntu versions by default. However, Ubuntu "snapshots" a specific version of PostgreSQL that is then supported throughout the lifetime of that Ubuntu version. Other versions of PostgreSQL are available through the PostgreSQL apt repository.
If the version included in your Ubuntu server is not v9.5, please refer to http://www.postgresql.org/download/linux/ubuntu/ to set the PostgreSQL Apt Repository.
Install
- From the terminal, run the following command to install PostgreSQL
# apt-get update # apt-get install postgresql postgresql-contrib
- Check for PostgreSQL's service name in your machine by the following command.
# chkconfig
- From the command's output, search for postgresql to get its full name.
... postgresql on //this is the full service name ...
- Initialize the database using the PostgreSQL's service name you have found above.
# chkconfig postgresql on # systemctl postgresql initdb
Enable Remote Access
After you have finished the install for PostgreSQL, enable remote access to PostgreSQL database server:
- Search for file pg_hba.conf in Postgresql's installation directory.
# find /etc -name "pg_hba.conf" or find /var -name "pg_hba.conf"
- Edit the file and append the following line, specify the IP of the server which will remotely connect to your PostgreSQL. This should be the servers where qTest packages are installed
If you want to allow connection from multiple client machines on a specific network, specify the network address here in the CIDR-address format
[IP Address]/[Netmask in bits]
If you want your PostgreSQL to accept all incoming connections regardless of the source IP address, use 0.0.0.0/0 as the IP address.
host all all [IP address]/[Netmask in bits] md5
You can define your specific PGSQL database host by running the ifconfig command on the PGSQL host on the appropriate network interface note the inet address which is IPV4 such as 192.168.0.255 and the netmask such as 255.255.255.0 (this is for the netmask calculation below.
Calculation: An octet is any value between 0 - 255 of an IP address or a netmask that represents one of 4 possible decimal places in an IP or netmask such as 255.255.255.0. Note where each octet is 255. So in our example for each octet in the netmask that has 255, let that represent the value 8, which represents the number of bits in the netmask. In our example, we have 3 octets that are full octets so they will represent the full 8 bits so our netmask in bits will represent 24. For our example, the CIDR format will look like: 192.168.0.255/24
Warning: netmask calculations can quickly become complicated if the netmask has values other than 0 or 255. If your network interface has any values between 0 and 255, consult with your network team to determine the CIDR format for you PGSQL host. - Search for file postgresql.conf in Postgresql's installation directory typically the same directory as pg_hba.conf
# find /etc -name "postgresql.conf" or find /var -name "postgresql.conf"
- Edit the above file. Search for property listen_address and modify it to (remove # at the beginning of the line if it is there.)
listen_addresses = '*'
Change Postgres User's Password
IMPORTANT:
- qtestctl does not support special characters "#" or "?" in your PostgreSQL password
Run the following commands to change the password:
# sudo -u postgres psql postgres=# \password Enter new password: Enter it again:
Create qTest Database in PostgreSQL Server
You need to create a databases in your PostgreSQL server which will be used when you configure qTest Manager, Sessions and Parameters.
- Access the PostgreSQLserver.
- Switch to postgres user.
$ su postgres
- Access the PostgreSQL shell.
$ psql
- List out the existing databases to avoid creating a duplicate database.
\l
- Create a database which will be used for qTest Manager. Take note of its name, as you will enter the database name in the Command Line Wizard when installing qTest applications.
create database [database_name];
- Repeat these steps to create a database for each qTest application you will be using. i.e. Session, Parameters.
Restart PostgreSQL
Run the following command to restart PostgreSQL:
sudo systemctl restart postgresql
Install ElasticSearch on CentOS
Please note, that the example installations below, provide the recommended install version. However, you can use a prerequisite version different than these examples as long as the prerequisite version falls within the range of supported versions listed above.
IMPORTANT: All commands need to be executed under root user.
- Install Java JDK 1.8
yum install -y java-1.8.0-openjdk
- Import the ElasticSearch PGP key.
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
- Create file /etc/yum.repos.d/elasticsearch.repo
cat > /etc/yum.repos.d/elasticsearch.repo <<-EOF
[elasticsearch-6.x]
name=Elasticsearch repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
EOF - Install ElasticSearch.
yum install -y elasticsearch
- Change the ElasticSearch configuration so it allows connections from outside of the server.
echo 'network.host: 0.0.0.0' >> /etc/elasticsearch/elasticsearch.yml
- By default, ElasticSearch uses port 9200. If you would like to change the default port, change the configuration by executing the following command, for example:
echo 'http.port: 9201' >> /etc/elasticsearch/elasticsearch.yml
NOTE: Please make sure that you select an available port in the server and open the port to allow inbound connections. - Configure ElasticSearch as a service so it automatically starts with the OS.
systemctl enable elasticsearch
- Restart ElasticSearch.
systemctl restart elasticsearch
Please refer to the official installation instructions of ElasticSearch for further information.
Install ElasticSearch on Ubuntu
Please note, that the example installations below, provide the recommended install version. However, you can use a prerequisite version different than these examples as long as the prerequisite version falls within the range of supported versions listed above.
IMPORTANT: All commands need to be executed under root user
- Install Java JDK 1.8
apt-get install java-1.8.0-openjdk.x86_64
- Import the ElasticSearch PGP key
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
- Install ElasticSearch (run following commands one by one.)
sudo apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" |
sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
sudo apt-get update && sudo apt-get install elasticsearch - Change the ElasticSearch configuration so it allows connections from outside of the server.
echo 'network.host: 0.0.0.0' >> /etc/elasticsearch/elasticsearch.yml
- By default, ElasticSearch uses port 9200. If you would like to change the default port, change the configuration by executing following command, for example:
echo 'http.port: 9201' >> /etc/elasticsearch/elasticsearch.yml
NOTE: Please make sure that you select an available port in the server and open the port to allow inbound connections - Configure ElasticSearch as a service so it automatically starts with the OS (run following commands one by one.)
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service - Restart ElasticSearch (run following commands one by one)
sudo -i service elasticsearch stop
sudo -i service elasticsearch start
Please refer to the official installation instructions of ElasticSearch for further information.
Install MongoDB on CentOS
Please note, that the example installations below, provide the recommended install version. However, you can use a prerequisite version different than these examples as long as the prerequisite version falls within the range of supported versions listed above.
- Create a /etc/yum.repos.d/mongodb-org-3.4.repo file to hold the following configuration information for the MongoDB 3.4 repository. The file’s content is as below:
[mongodb-org-3.4]
name=MongoDB 3.4 Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc - Install the MongoDB packages. Issue the following command:
# sudo yum install -y mongodb-org
Install MongoDB on Ubuntu
Please note, that the example installations below, provide the recommended install version. However, you can use a prerequisite version different than these examples as long as the prerequisite version falls within the range of supported versions listed above.
- Import the public key used by the package management system. The Ubuntu package management tools (i.e. dpkg and apt) ensure package consistency and authenticity by requiring that distributors sign packages with GPG keys. Issue the following command to import the MongoDB public GPG Key:
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
- Create the /etc/apt/sources.list.d/mongodb-org-3.4.list list file using the command appropriate for your version of Ubuntu:
- Ubuntu 12.04
# echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
- Ubuntu 14.04
# echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
- Ubuntu 16.04
# echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
- Ubuntu 12.04
- Issue the following command to reload the local package database:
# sudo apt-get update
- Install the latest stable version of MongoDB. Issue the following command:
# sudo apt-get install -y mongodb-org
Configure MongoDB
Initialize replicaSet
Start MongoDB with the following command:
Note: if your path includes spaces, enclose the entire path with double quotes.
# sudo mongod --dbpath [PATH/TO/DB/FOLDER] --replSet "rs0"
Example:
- Ubuntu
# sudo mongod --dbpath /var/lib/mongodb --replSet "rs0"
- CentOS
# sudo mongod --dbpath /var/lib/mongo --replSet "rs0"
Create Root User
Open the second Terminal, and execute the commands below to create a root user:
mongo
rs.initiate()
use admin
db.createUser ({
user: "[USER_NAME]",
pwd: "[PASSWORD]",
roles: ["root"]
})
Example:
mongo
rs.initiate()
use admin
db.createUser ({
user: "tdm",
pwd: "password",
roles: ["root"]
})
Close the second Terminal, and press Ctrl+C on the first Terminal to stop MongoDB service.
Start MongoDB as a Service
- Edit /etc/mongod.conf file using following command:
- Ubuntu
# sudo vim /etc/mongod.conf
- CentOS
# sudo vim /etc/mongod.conf
- Ubuntu
- Now you can start to edit mongod.conf. Remove the net(port, bindIp) section, and edit the other sections as following:
systemLog:
destination: file
path: [/PATH/TO/LOG/FOLDER]
storage:
dbPath: [/PATH/TO/DB/FOLDER]
replication:
replSetName: rs0
security:
authorization: enabled
Example:- Ubuntu
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
storage:
dbPath: /var/lib/mongodb
journal:
enabled: true
replication:
replSetName: rs0
security:
authorization: enabled - CentOS
systemLog:
destination: file
path: /var/log/mongodb/mongod.log
storage:
dbPath: /var/lib/mongo
replication:
replSetName: rs0
security:
authorization: enabled
- Ubuntu
- Make sure the data and log folders have appropriate permissions by executing the following commands:
# sudo chown -R [MONGODB_USER] [PATH/TO/DB/FOLDER]
# sudo chown -R [MONGODB_USER] [PATH/TO/LOG/FOLDER]
Example:- Ubuntu
# sudo chown -R mongodb:mongodb /var/lib/mongodb
# sudo chown -R mongodb:mongodb /var/log/mongodb - CentOS
# sudo chown -R mongod:mongod /var/lib/mongo
# sudo chown -R mongod:mongod /var/log/mongodb
- Ubuntu
- Start the MongoDB service by running the following command:
# sudo systemctl start mongod
- You can verify that the mongodb process has started successfully by checking the content of the log file at /var/log/mongodb/mongod.log for a line like below:
[initandlisten] waiting for connections on port <port>
Notes: If you would like to stop the MongoDB service as needed, run the following command:
# sudo systemctl stop mongod