Menu

Prerequisite Software for Manager 8.7.3 Installation Guide for CentOS/Ubuntu machine

Install PostgreSQL on CentOS

IMPORTANT: 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 install PostgreSQL, enable remote access to PostgreSQL database server:

  1. Search for file pg_hba.conf in Postgresql's installation directory
    # find / -name "pg_hba.conf"
    		
  2. 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

    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] md5
    		
  3. Search for file postgresql.conf in Postgresql's installation directory
    # find / -name "postgresql.conf"
    		
  4. 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

Run the following commands to change his 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

  1. From the terminal, run the following command to install PostgreSQL
    # apt-get update
    # apt-get install postgresql postgresql-contrib
    		
  2. Check for PostgreSQL's service name in your machine by the following command
    # chkconfig
    		
  3. From the command's output, search for postgresql to get its full name
    ...
    postgresql on //this is the full service name
    ...
    		
  4. Initialize the database using the PostgreSQL's service name you have found above
    # chkconfig postgresql on
    # service postgresql initdb
    		

Enable remote access

After you have finished install PostgreSQL, enable remote access to PostgreSQL database server:

  1. Search for file pg_hba.conf in Postgresql's installation directory
    # find / -name "pg_hba.conf"
    		
  2. 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 server 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

    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] md5
    		
  3. Search for file postgresql.conf in Postgresql's installation directory
    # find / -name "postgresql.conf"
    		
  4. 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

Run the following commands to change his password:

# sudo -u postgres psql

postgres=# \password
Enter new password:
Enter it again:

Install Redis on CentOS

  IMPORTANT:

  • All commands need to be executed under Root user
  • The installation guide below is a reference from this article in Redis' website
  1. Download and compile Redis v2.8.19 by the following commands
    # wget http://download.redis.io/releases/redis-2.8.19.tar.gz
    # tar xvzf redis-2.8.19.tar.gz
    # cd redis-2.8.19.tar.gz
    # make
    		
  2. At this point you can try if your build works correctly by typing make test, but this is an optional step
    # make test
    		
  3. Copy the following files to under /usr/local/bin/. Remember to check if /usr/local/bin/ has been added to your PATH environment variable. If not, please add it
    # cp src/redis-server /usr/local/bin/
    # cp src/redis-cli /usr/local/bin/
    		
  4. Create directories where to store your Redis config files and your data
    # mkdir /etc/redis
    # mkdir /var/redis
    		
  5. Copy the init script under the utils directory into /etc/init.d. We suggest calling it with the name of the port where you are running this instance of Redis (the default port is 6379)
    # cp utils/redis_init_script /etc/init.d/redis_6379
    		
  6. View the file /etc/init.d/redis_6379 and perform the following updates:
    • Check if REDISPORT matches with the port number you will be using. Both the pid file path and the configuration file name depend on the port number
      #!/bin/sh
      #
      # Simple Redis init.d script conceived to work on Linux systems
      # as it does use of the /proc filesystem.
      
      REDISPORT=6379
      EXEC=/usr/local/bin/redis-server
      CLIEXEC=/usr/local/bin/redis-cli
      
      PIDFILE=/var/run/redis_${REDISPORT}.pid
      CONF="/etc/redis/${REDISPORT}.conf"
      				
    • Add the following lines at the top
      #!/bin/sh
      #
      # Simple Redis init.d script conceived to work on Linux systems
      # as it does use of the /proc filesystem.
      #
      # chkconfig:   - 85 15
      # description:  Redis is a persistent key-value database
      # processname: redis_6379
      				
  7. Create a directory inside /var/redis that will work as data and working directory for this Redis instance using the port number as the directory name
    mkdir /var/redis/6379
    		
  8. Copy the template configuration file under the Redis distribution's root directory into /etc/redis/ using the port number as the file name (eg: 6379.conf)
    # cp redis.conf /etc/redis/6379.conf
    		
  9. Edit the configuration file (6379.conf) and make the following changes
    1. Set daemonize to yes (by default it is set to no)
    2. Set pidfile to /var/run/redis_6379.pid (modify the port if needed)
    3. Set port accordingly. In our example it is not needed as the default port is already 6379
    4. Set logfile to /var/log/redis_6379.log
    5. Set dir to /var/redis/6379 (very important step!)
  10. Finally add the new Redis init script to all the default runlevels
    # chkconfig --add redis_6379
    		
  11. Now you can try running your Redis instance
    service redis_6379 start
    		

To make sure that your Redis instance is working as expected:

  • Try pinging your instance with redis-cli ping. Redis will response with PONG
    # redis-cli ping
    PONG
    		
  • Do a test save with redis-cli save and check that the dump file called dump.rdb is correctly stored into /var/redis/6379/
  • Check that your Redis instance is correctly logging in the log file

Install Redis on Ubuntu

  IMPORTANT:

  • All commands need to be executed under Root user
  • The installation guide below is a reference from this article in Redis' website
  1. Download and compile Redis v2.8.19 by the following commands
    # wget http://download.redis.io/releases/redis-2.8.19.tar.gz
    # tar xvzf redis-2.8.19.tar.gz
    # cd redis-2.8.19
    # make
    		
  2. At this point you can try if your build works correctly by typing make test, but this is an optional step
    # make test
    		
  3. Copy the following files to under /usr/local/bin/. Remember to check if /usr/local/bin/ has been added to your PATH environment variable. If not, please add it
    # cp src/redis-server /usr/local/bin/
    # cp src/redis-cli /usr/local/bin/
    		
  4. Create directories where to store your Redis config files and your data
    # mkdir /etc/redis
    # mkdir /var/redis
    		
  5. Copy the init script under the utils directory into /etc/init.d. We suggest calling it with the name of the port where you are running this instance of Redis (the default port is 6379)
    # cp utils/redis_init_script /etc/init.d/redis_6379
    		
  6. View the file /etc/init.d/redis_6379 and check if REDISPORT matches with the port number you will be using. Both the pid file path and the configuration file name depend on the port number
    #!/bin/sh
    #
    # Simple Redis init.d script conceived to work on Linux systems
    # as it does use of the /proc filesystem.
    
    REDISPORT=6379
    EXEC=/usr/local/bin/redis-server
    CLIEXEC=/usr/local/bin/redis-cli
    
    PIDFILE=/var/run/redis_${REDISPORT}.pid
    CONF="/etc/redis/${REDISPORT}.conf"
    
    		
  7. Create a directory inside /var/redis that will work as data and working directory for this Redis instance using the port number as the directory name
    mkdir /var/redis/6379
    		
  8. Copy the template configuration file under the Redis distribution's root directory into /etc/redis/ using the port number as the file name (eg: 6379.conf)
    # cp redis.conf /etc/redis/6379.conf
    		
  9. Edit the configuration file (6379.conf) and make the following changes
    1. Set daemonize to yes (by default it is set to no)
    2. Set pidfile to /var/run/redis_6379.pid (modify the port if needed)
    3. Set port accordingly. In our example it is not needed as the default port is already 6379
    4. Set logfile to /var/log/redis_6379.log
    5. Set dir to /var/redis/6379 (very important step!)
  10. Finally add the new Redis init script to all the default runlevels
    # update-rc.d redis_6379 defaults
    		
  11. Now you can try running your Redis instance
    # /etc/init.d/redis_6379 start
    		

To make sure that your Redis instance is working as expected:

  • Try pinging your instance with redis-cli ping. Redis will response with PONG
    # redis-cli ping
    PONG
    		
  • Do a test save with redis-cli save and check that the dump file called dump.rdb is correctly stored into /var/redis/6379/
  • Check that your Redis instance is correctly logging in the log file

Install RabbitMQ

  IMPORTANT:

  • In case you are deploying qTest with load balancing, you are required to install RabbitMQ. If not, you can skip installing this
  • All commands need to be executed under Root user
  • Please follow this instruction and install RabbitMQ v3.5.4

Configure RabbitMQ

  1. After you have installed RabbitMQ successfully, run the following commands to configure it
    rabbitmq-plugins enable rabbitmq_stomp
    rabbitmq-plugins enable rabbitmq_management
    rabbitmqctl add_user qtest [qtest_password]//to create user qtest, specify his password
    rabbitmqctl add_user rabbitmqadmin [rabbitmqadmin_password]//to create user rabbitmqadmin, specify his password
    rabbitmqctl set_user_tags rabbitmqadmin administrator
    rabbitmqctl add_vhost qtest-onpremise //to create a virtual host named qtest-onpremise
    rabbitmqctl set_permissions -p qtest-onpremise qtest ".*" ".*" ".*" //grant user qtest the access to virtual host qtest-onpremise 
    		
  2. Execute the command below to view amqp port and stomp port. You will need to use these ports while installing qTest Manager
    sudo rabbitmqctl status | grep "amqp\|stomp"
    		

Install MongoDB 3.4 on Ubuntu

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

import-public-key-ubuntu.png

2. Create a list file for MongoDB

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

create-file-list-ubuntu.png

3. Reload local package database

Issue the following command to reload the local package database:

# sudo apt-get update

reload-local-package-database.png

4. Install the MongoDB packages

Install the latest stable version of MongoDB. Issue the following command:

# sudo apt-get install -y mongodb-org

install-mongo-package.png

Install MongoDB 3.4 on CentOS

1. Create MongoDB Repository

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

2. Install the MongoDB packages

To install MongoDB, issue the following command:

# sudo yum install -y mongodb-org

Configure MongoDB

1. Initialize replicaSet

Start MongoDB with following command. Notes: if your path includes spaces, enclose the entire path with double quotes.

# mongod --dbpath [PATH/TO/DB/FOLDER] --replSet "rs0"

For example:

Ubuntu

# mongod --dbpath /var/lib/mongodb --replSet "rs0"

CentOS

# mongod --dbpath /var/lib/mongo --replSet "rs0"

configure-mongo-ubuntu.png

2. Create root user

Open second Terminal, and execute below commands to create a root user

mongo
rs.initiate()
use admin
db.createUser ({
    user: "[USER_NAME]",
    pwd: "[PASSWORD]",
    roles: ["root"]
})

For example:

mongo
rs.initiate()
use admin
db.createUser ({
    user: "tdm",
    pwd: "password",
    roles: ["root"]
})

create-mongo-user-ubuntu.png

Close the second Terminal, and press Ctrl+C on the first Terminal to stop MongoDB service.

2. Start MongoDB as a service

Edit /etc/mongod.conf file using following command:

Ubuntu

# vim /etc/mongod.conf

CentOS

# vi /etc/mongod.conf

Now you can start edit mongod.conf. Remove the net(port, bindIp) section, and edit other sections as following:

systemLog:
  destination: file
  path: [/PATH/TO/LOG/FOLDER]
storage:
  dbPath: [/PATH/TO/DB/FOLDER]
replication:
  replSetName: rs0
security:
  authorization: enabled

For example:

Ubuntu

systemLog:
  destination: file
  path: /var/log/mongodb/mongod.log
storage:
  dbPath: /var/lib/mongodb
replication:
  replSetName: rs0
security:
  authorization: enabled

mongod-conf.png

CentOS 

systemLog:
  destination: file
  path: /var/log/mongodb/mongod.log
storage:
  dbPath: /var/lib/mongo
replication:
  replSetName: rs0
security:
  authorization: enabled

Make sure the data and log folders have appropriate permissions by executing following commands:

# sudo chown -R [MONGODB_USER] [PATH/TO/DB/FOLDER]
# sudo chown -R [MONGODB_USER] [PATH/TO/LOG/FOLDER]

For example:

Ubuntu

# sudo chown -R mongodb:mongodb /var/lib/mongodb
# sudo chown -R mongodb:mongodb /var/log/mongodb

set-mongo-user-permissions-ubuntu.png

CentOS

# sudo chown -R mongod:mongod /var/lib/mongo
# sudo chown -R mongod:mongod /var/log/mongodb

Start the MongoDB service by running following command

# sudo service mongod start

start-mongo-service-ubuntu.png

You can verify that the mongod 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 service mongod stop

Powered by Zendesk