16. [Linux] Install prerequisites for Manager 7.7

Important_icon.pngImportant: It's recommended to use copy & paste for the code scripts.

MySQL

»Install MySQL 5.5 on CentOS

»Install MySQL 5.5 on Ubuntu

MySQL Connector

»Install MySQL Connector/J

RabbitMQ

»Install RabbitMQ

PostgreSQL

»Install PostgreSQL on CentOS

»Install PostgreSQL on Ubuntu

Redis

»Install Redis on CentOS

»Install Redis on Ubuntu

ElasticSearch

»Install ElasticSearch on CentOS and Ubuntu

Install MySQL 5.5 on CentOS

  1. Switch to root user:
    $ sudo su
    
  2. List all mysql packages to be installed in CentOS
    # yum list installed | grep -i mysql
    
    If an older version than MySQL 5.5 is installed, please follow step #3. Otherwise, please follow step #4
  3. If an older version than MySQL 5.5 is installed, remove it (qTest supports MySQL version 5.5+).
    # yum remove mysql mysql-*
    
  4. Install MySQL 5.5.
    1. Update Remi repository
      #rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
      # rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
      
    2. Install mysql 5.5
      # yum install --enablerepo=remi,remi-test list mysql mysql-server
      
  5. After the installation is done, check for MySQL's service name in your machine by the following command:
    # chkconfig
    
    From the command's output, search for mysql to get its full name.
    NetworkManager  0:off   1:off   2:on    3:on    4:on    5:on    6:off
    abrt-ccpp       0:off   1:off   2:off   3:on    4:off   5:on    6:off
    abrt-oops       0:off   1:off   2:off   3:on    4:off   5:on    6:off
    abrtd           0:off   1:off   2:off   3:on    4:off   5:on    6:off
    acpid           0:off   1:off   2:on    3:on    4:on    5:on    6:off
    atd             0:off   1:off   2:off   3:on    4:on    5:on    6:off
    auditd          0:off   1:off   2:on    3:on    4:on    5:on    6:off
    autofs          0:off   1:off   2:off   3:on    4:on    5:on    6:off
    blk-availability        0:off   1:on    2:on    3:on    4:on    5:on    6:off
    certmonger      0:off   1:off   2:off   3:on    4:on    5:on    6:off
    cgconfig        0:off   1:off   2:off   3:off   4:off   5:off   6:off
    cgred           0:off   1:off   2:off   3:off   4:off   5:off   6:off
    cpuspeed        0:off   1:on    2:on    3:on    4:on    5:on    6:off
    crond           0:off   1:off   2:on    3:on    4:on    5:on    6:off
    cups            0:off   1:off   2:on    3:on    4:on    5:on    6:off
    dnsmasq         0:off   1:off   2:off   3:off   4:off   5:off   6:off
    elasticsearch   0:off   1:off   2:on    3:on    4:on    5:on    6:off
    exim            0:off   1:off   2:on    3:on    4:on    5:on    6:off
    explorerd       0:off   1:off   2:on    3:on    4:on    5:on    6:off
    firstboot       0:off   1:off   2:off   3:off   4:off   5:off   6:off
    haldaemon       0:off   1:off   2:off   3:on    4:on    5:on    6:off
    htcacheclean    0:off   1:off   2:off   3:off   4:off   5:off   6:off
    httpd           0:off   1:off   2:off   3:off   4:off   5:off   6:off
    ip6tables       0:off   1:off   2:on    3:on    4:on    5:on    6:off
    iptables        0:off   1:off   2:off   3:off   4:off   5:off   6:off
    irqbalance      0:off   1:off   2:off   3:on    4:on    5:on    6:off
    kdump           0:off   1:off   2:off   3:on    4:on    5:on    6:off
    libvirt-guests  0:off   1:off   2:on    3:on    4:on    5:on    6:off
    lvm2-monitor    0:off   1:on    2:on    3:on    4:on    5:on    6:off
    mcelogd         0:off   1:off   2:off   3:on    4:off   5:on    6:off
    mdmonitor       0:off   1:off   2:on    3:on    4:on    5:on    6:off
    messagebus      0:off   1:off   2:on    3:on    4:on    5:on    6:off
    monit           0:off   1:off   2:off   3:off   4:off   5:off   6:off
    mysqld          0:off   1:off   2:off   3:off   4:off   5:off   6:off // the is MySQL's service name
    netconsole      0:off   1:off   2:off   3:off   4:off   5:off   6:off
    netfs           0:off   1:off   2:off   3:on    4:on    5:on    6:off
    
  6. Check if the service is running. If so, skip the next step. If not, follow the next step to start the service.
    # service [mysql's service name] status //use the service name you find above
    
    Eg:
    # service mysqld status
    mysqld (pid 3672) is running...
    
  7. Start mysql service
    # service [mysql's service name] start //use the service name you find above
    
    Eg:
    # service mysqld start
    
  8. Change the password of MySQL root user
    # mysqladmin -u root password [your_new_root_password_here]
    
  9. [Optional] Create new MySQL user
    # $ mysql –u [ROOT_USER_OF_MySQL] -p //Connect mysql
    mysql> CREATE USER '[YOUR_NEW_USER]'@'%' IDENTIFIED BY '[your_password_here]'; //create a user
    
  10. Enable Remote Connections to MySQL Database (By default, MySQL works on port 3306)
    mysql> GRANT ALL ON *.* TO '[YOUR_MySQL_USER]'@'%' IDENTIFIED BY '[YOUR_PASSWORD_OF_MySQL_USER]'; //grant permissions for remote connections
    mysql> GRANT ALL ON *.* TO '[YOUR_MySQL_USER]'@'localhost' IDENTIFIED BY '[YOUR_PASSWORD_OF_MySQL_USER]'; //grant permissions to connect from the local machine
    mysql> GRANT ALL ON *.* TO '[YOUR_MySQL_USER]'@'[YOUR_MySQL_IP_Address]' IDENTIFIED BY '[YOUR_PASSWORD_OF_MySQL_USER]'; //grant permissions to remote in your local by user
    mysql> FLUSH PRIVILEGES;
    
    Verify if the remote connection is enabled:
    # mysql -u [YOUR_MySQL_USER] -p
    # mysql -h [MySQL_HOST] -u [YOUR_MySQL_USER] -p [MySQL_PORT]
    
    Eg:
    # mysql –h 192.168.74.66 –u superadmin  -p –port=3306
    
  11. The default port of MySQL is 3306. If your firewall is enabled, make sure that the port is not blocked by the firewall. Click here for the instructions.
  12. After MySQL installation is complete, please make sure that the transaction isolation level is set to READ-COMMITTED.
    Access to your MySQL instance. Check if variable tx_isolation's value is READ-COMMITTED by executing the following SQL statement
    mysql> SHOW VARIABLES LIKE 'tx_isolation';
    
    If it is not READ-COMMITTED: under MySQL's installation directory, search for file my.cnf
    #find / -name "my.cnf"
    
    Open the file above, add the following text to the end of section [mysqld].
    transaction-isolation = READ-COMMITTED
    
    Save the file.
  13. This step is only required if you are deploying qTest with load balancing: Check if the maximum number of connections of MySQL server is appropriate to the number of qTest instances in the cluster. Given there are n qTest application servers in your cluster, then the appropriate number of connections to MySQL should be: 100 * (n + 1) + 10
    Access to your MySQL instance and execute this command:
    mysql> SHOW VARIABLES LIKE ‘max_connections’;
    
    If the maximum number of connection is less than the appropriate number, search for file my.cnf under MySQL installation directory, open it and add the text below to the of section [mysqld].
    max_connections=[the_appropriate_number]
    
    Save the file.
  14. Restart the service.
    #service mysql restart 
    
    Verify information of transaction isolation level is set to READ-COMMITTED and the maximum number of connections
    #mysql -u [YOUR_MySQL_USER] -p
    mysql>SHOW VARIABLES LIKE 'tx_isolation';
    mysql>SHOW VARIABLES LIKE ‘max_connections’;
    

Install MySQL 5.5 on Ubuntu

  1. Switch to root user:
    $ sudo su
    
  2. List all packages have been installed in Ubuntu and check if MySQL is in the list.
    # dpkg -l | grep '^ii'
    
    If an older version than MySQL 5.5 is installed, please follow step #3. Otherwise, please follow step #4.
  3. If an older version than MySQL 5.5 is installed, remove it (qTest supports MySQL version 5.5+).
    # sudo apt-get remove mysql-server mysql-client mysql-common
    # sudo apt-get autoremove
    # sudo apt-get autoclean
    
  4. This step is optional. If the version included in your version of Ubuntu is not the one you want, you can use the MySQL Apt Repository. Please refer to http://dev.mysql.com/downloads/repo/apt/ to set the repository.
  5. Install MySQL
    # apt-get update
    # apt-get install mysql-client-5.5 mysql-server-5.5 mysql-common
    
  6. After the installation is done, check for MySQL's service name in your machine by the following command:
    # chkconfig
    
    From the command's output, search for mysql to get its full name.
    explorerd                    off
    friendly-recovery            off
    grub-common                  on
    hostname                     off
    hwclock                      off
    hwclock-save                 off
    irqbalance                   off
    killprocs                    on
    module-init-tools            off
    mysql                        off //this is MySQL's service name
    network-interface            off
    network-interface-container  off
    network-interface-security   off
    networking                   0
    ondemand                     on
    
  7. Check if the service is running. If so, skip the next step. If not, follow the next step to start the service.
    # service [mysql's service name] status //use the service name you find above
    
    Eg:
    # service mysql status
    mysql start/running, process 47278
    
  8. Start mysql service
    # service [mysql's service name] start //use the service name you find above
    
    Eg:
    # service mysql start
    
  9. Change the password of MySQL root user
    # mysqladmin -u root password [your_new_root_password_here]
    
  10. [Optional] Create new MySQL user
    # $ mysql –u [ROOT_USER_OF_MySQL] -p //Connect mysql
    mysql> CREATE USER '[YOUR_NEW_USER]'@'%' IDENTIFIED BY '[your_password_here]'; //create a user
    
  11. Enable Remote Connections to MySQL Database (By default, MySQL works on port 3306)
    mysql> GRANT ALL ON *.* TO '[YOUR_MySQL_USER]'@'%' IDENTIFIED BY '[YOUR_PASSWORD_OF_MySQL_USER]'; //grant permissions for remote connections
    mysql> GRANT ALL ON *.* TO '[YOUR_MySQL_USER]'@'localhost' IDENTIFIED BY '[YOUR_PASSWORD_OF_MySQL_USER]'; //grant permissions to connect from the local machine
    mysql> GRANT ALL ON *.* TO '[YOUR_MySQL_USER]'@'[YOUR_MySQL_IP_Address]' IDENTIFIED BY '[YOUR_PASSWORD_OF_MySQL_USER]'; //grant permissions to remote in your local by user
    mysql> FLUSH PRIVILEGES;
    
    Verify if the remote connection is enabled:
    #mysql -u [YOUR_MySQL_USER] -p
    # mysql -h [MySQL_HOST] -u [YOUR_MySQL_USER] -p [MySQL_PORT]
    
    Eg:
    # mysql –h 192.168.74.66 –u superadmin  -p –port=3306
    
  12. The default port of MySQL is 3306. If your firewall is enabled, make sure that the port is not blocked by the firewall. Click here for the instructions.
  13. After MySQL installation is complete, please make sure that the transaction isolation level is set to READ-COMMITTED.
    Access to your MySQL instance. Check if variable tx_isolation's value is READ-COMMITTED by executing the following SQL statement
    mysql> SHOW VARIABLES LIKE 'tx_isolation';
    
    If it is not READ-COMMITTED: under MySQL's installation directory, search for file my.cnf
    #find / -name "my.cnf"
    
    Open the file above, add the following text to the end of section [mysqld].
    transaction-isolation = READ-COMMITTED
    
    Save the file.
  14. This step is only required if you are deploying qTest with load balancing: Check if the maximum number of connections of MySQL server is appropriate to the number of qTest instances in the cluster. Given there are n qTest application servers in your cluster, then the appropriate number of connections to MySQL should be: 100 * (n + 1) + 10
    Access to your MySQL instance and execute this command:
    mysql> SHOW VARIABLES LIKE ‘max_connections’;
    
    If the maximum number of connection is less than the appropriate number, search for file my.cnf under MySQL installation directory, open it and add the text below to the of section [mysqld].
    max_connections=[the_appropriate_number]
    
    Save the file.
  15. Restart the service.
    #service mysql restart 
    
    Verify information of transaction isolation level is set to READ-COMMITTED and the maximum number of connections
    #mysql -u [YOUR_MySQL_USER] -p
    mysql>SHOW VARIABLES LIKE 'tx_isolation';
    mysql>SHOW VARIABLES LIKE ‘max_connections’;
    

 

Install MySQL Connector/J

Important_icon.pngImportant:

  • qTest works with MySQL Connector/J version 5.1.34+.
  • It needs to be installed on every server instance in which you are installing qTest.

Access to MySQL Connector/J's download page: http://dev.mysql.com/downloads/connector/j/

Select Platform Independent.

Download the TAR Archive.

After the file has been downloaded, extract it. In the extracted directory, search for the jar file: mysql-connector-java-5.1.35.jar. You will need to specify the path to this file when installing qTest.

 

Install RabbitMQ

Important_icon.pngImportant:

  • In case you are deploying qTest with load balancing, you are required to install RabbitMQ. If not, you can skip installing this.

Follow this instruction to download and install RabbitMQ.

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

Execute the command below to view amqp port and stomp port. You will need to use these ports while installing qTest.

sudo rabbitmqctl status | grep "amqp\|stomp"

 

Install PostgreSQL on CentOS

Important_icon.pngImportant:

  • All steps need to be executed under Root account

From the terminal, run the following command to install PostgreSQL. You can browse http://yum.postgresql.org and find your correct RPM.

# yum update
# yum install http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm
# yum install postgresql93-server postgresql93-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.

NetworkManager  0:off   1:off   2:on    3:on    4:on    5:on    6:off
abrt-ccpp       0:off   1:off   2:off   3:on    4:off   5:on    6:off
abrt-oops       0:off   1:off   2:off   3:on    4:off   5:on    6:off
abrtd           0:off   1:off   2:off   3:on    4:off   5:on    6:off
acpid           0:off   1:off   2:on    3:on    4:on    5:on    6:off
atd             0:off   1:off   2:off   3:on    4:on    5:on    6:off
auditd          0:off   1:off   2:on    3:on    4:on    5:on    6:off
autofs          0:off   1:off   2:off   3:on    4:on    5:on    6:off
blk-availability        0:off   1:on    2:on    3:on    4:on    5:on    6:off
certmonger      0:off   1:off   2:off   3:on    4:on    5:on    6:off
cgconfig        0:off   1:off   2:off   3:off   4:off   5:off   6:off
cgred           0:off   1:off   2:off   3:off   4:off   5:off   6:off
cpuspeed        0:off   1:on    2:on    3:on    4:on    5:on    6:off
crond           0:off   1:off   2:on    3:on    4:on    5:on    6:off
cups            0:off   1:off   2:on    3:on    4:on    5:on    6:off
dnsmasq         0:off   1:off   2:off   3:off   4:off   5:off   6:off
elasticsearch   0:off   1:off   2:on    3:on    4:on    5:on    6:off
exim            0:off   1:off   2:on    3:on    4:on    5:on    6:off
explorerd       0:off   1:off   2:on    3:on    4:on    5:on    6:off
firstboot       0:off   1:off   2:off   3:off   4:off   5:off   6:off
haldaemon       0:off   1:off   2:off   3:on    4:on    5:on    6:off
htcacheclean    0:off   1:off   2:off   3:off   4:off   5:off   6:off
httpd           0:off   1:off   2:off   3:off   4:off   5:off   6:off
ip6tables       0:off   1:off   2:on    3:on    4:on    5:on    6:off
iptables        0:off   1:off   2:off   3:off   4:off   5:off   6:off
irqbalance      0:off   1:off   2:off   3:on    4:on    5:on    6:off
kdump           0:off   1:off   2:off   3:on    4:on    5:on    6:off
libvirt-guests  0:off   1:off   2:on    3:on    4:on    5:on    6:off
lvm2-monitor    0:off   1:on    2:on    3:on    4:on    5:on    6:off
mcelogd         0:off   1:off   2:off   3:on    4:off   5:on    6:off
mdmonitor       0:off   1:off   2:on    3:on    4:on    5:on    6:off
messagebus      0:off   1:off   2:on    3:on    4:on    5:on    6:off
monit           0:off   1:off   2:off   3:off   4:off   5:off   6:off
mysqld          0:off   1:off   2:off   3:off   4:off   5:off   6:off
netconsole      0:off   1:off   2:off   3:off   4:off   5:off   6:off
netfs           0:off   1:off   2:off   3:on    4:on    5:on    6:off
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off
nfs             0:off   1:off   2:off   3:on    4:off   5:on    6:off
nfslock         0:off   1:off   2:off   3:on    4:on    5:on    6:off
ntpd            0:off   1:off   2:on    3:on    4:on    5:on    6:off
ntpdate         0:off   1:off   2:off   3:off   4:off   5:off   6:off
numad           0:off   1:off   2:off   3:off   4:off   5:off   6:off
oddjobd         0:off   1:off   2:off   3:off   4:off   5:off   6:off
openct          0:off   1:off   2:on    3:on    4:on    5:on    6:off
pcscd           0:off   1:off   2:off   3:on    4:on    5:on    6:off
portreserve     0:off   1:off   2:on    3:on    4:on    5:on    6:off
postgresql-9.3  0:off   1:off   2:on    3:on    4:on    5:on    6:off //this is the postgresql's service name
psacct          0:off   1:off   2:off   3:off   4:off   5:off   6:off
qtest           0:off   1:off   2:on    3:on    4:on    5:on    6:off

Initialize the database:

# service [postgresql's service name] initdb //use the service name you find above

Eg:

# service postgresql-9.3 initdb

If you want PostgreSQL to start automatically when the OS starts:

# chkconfig postgresql-9.3 on //enable postgresql

# service postgresql-9.3 start //start the service

 

Enable remote access to PostgreSQL database server:

  • Search for file pg_hba.conf in Postgresql's installation directory.
    # find / -name "pg_hba.conf"
    /var/lib/pgsql/9.3/data/pg_hba.conf //this  is the result
    
    Edit the above file. Append the following configuration line, in which [IP_Address] is the IP of the machine from which you remotely connect to PostgreSQL server.
    host    all             all             [IP_Address]/24            password  
    
  • Search for file postgresql.conf in Postgresql's installation directory.
    # find / -name "postgresql.conf"
    /var/lib/pgsql/9.3/data/postgresql.conf //this  is the result
    
    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 password for postgres database user.

# sudo -u postgres psql

postgres=# \password
Enter new password: // enter password of postgres
Enter it again:

postgres=#

After PostgreSQL has been successfully installed, you will need to create a database schema. It will be used when installing qTest Sessions.

  • Switch to postgres user:
    #su - postgres
    
  • Create a database schema using the command below:
    createdb [YOUR_DATABASE_NAME]
    
    For example:
    -bash-4.1$ createdb testdb //testdb is the database schema name
    
  • Connect to the database that matches your username:
    -bash-4.1$  psql
    
  • List out existing schema to check if the above one has been successfully created:
    postgres=# \l
                                         List of databases
          Name       |  Owner   | Encoding |  Collation  |    Ctype    |   Access privileges
    -----------------+----------+----------+-------------+-------------+-----------------------
     explorer-api-66 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
     postgres        | 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
     testdb          | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
    (5 rows)
    
    testdb has been created and listed above.
  • Quit the psql program and exit to the Linux prompt.
    postgres=# \q
    -bash-4.1$ exit
    

Important_icon.pngImportant:

  • Postgresql's default port is 5432. Make sure that the port is available. Click here for instructions to check which ports are in use.
  • Make sure the port is not blocked by your firewall. Click here for instructions.

Install PostgreSQL on Ubuntu

Important_icon.pngImportant:

  • All steps need to be executed under Root account

This step is optional. If the version included in your version of Ubuntu is not the one you want, you can use the PostgreSQL Apt Repository. Please refer to http://www.postgresql.org/download/linux/ubuntu/ to set the repository.

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.

acpid                        off
apparmor                     on
apport                       off
atd                          off
bootlogd                     off
cgroup-lite                  off
console-setup                off
cron                         off
dbus                         off
dmesg                        off
dns-clean                    on
docker                       off
elasticsearch                on
explorerd                    off
friendly-recovery            off
grub-common                  on
hostname                     off
hwclock                      off
hwclock-save                 off
irqbalance                   off
killprocs                    on
module-init-tools            off
mysql                        off
network-interface            off
network-interface-container  off
network-interface-security   off
networking                   0
ondemand                     on
passwd                       off
plymouth                     off
plymouth-log                 off
plymouth-ready               off
plymouth-splash              off
plymouth-stop                off
plymouth-upstart-bridge      off
postgresql                   on //this is the full service name
pppd-dns                     on
procps                       off

Initialize the database:

# service [postgresql's service name] initdb //use the service name you find above

Eg:

# service postgresql initdb //use the service name you find above

If you want PostgreSQL to start automatically when the OS starts:

# chkconfig postgresql on //enable postgresql

# service postgresql start //start the service

Enable remote access to PostgreSQL database server:

  • Search for file pg_hba.conf in Postgresql's installation directory.
    # find / -name "pg_hba.conf"
    /var/lib/pgsql/9.3/data/pg_hba.conf //this  is the result
    
    Edit the above file. Append the following configuration line, in which [IP_Address] is the IP of the machine from which you remotely connect to PostgreSQL server.
    host    all             all             [IP_Address]/24            password  
    
  • Search for file postgresql.conf in Postgresql's installation directory.
    # find / -name "postgresql.conf"
    /var/lib/pgsql/9.3/data/postgresql.conf //this  is the result
    
    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 password for postgres database user.

#sudo -u postgres psql

postgres=# \password
Enter new password: // enter password of postgres
Enter it again:

postgres=#

After PostgreSQL has been successfully installed, you will need to create a database schema. It will be used when installing qTest Sessions.

  • Switch to postgres user:
    #su - postgres
    
  • Create a data base schema using the command below:
    createdb -h [YOUR_IP_POSTGRES_SERVER] -p [YOUR_POSTGRES_PORT] -U postgres -W [YOUR_DATA_BASE_NAME]
    
    For example:
    $ createdb -h 192.168.74.66 -p 5432 -U postgres -W testdb //postgres is the username and testdb is the schema name
    Password: [INPUT_YOUR_PASSWORD_POSTGRESQL_HERE] //enter password of user postgres
    
  • Connect to the database that matches your username:
    $  psql
    
  • List out existing schema to check if the above one has been successfully created:
    postgres=# \l
                                         List of databases
          Name       |  Owner   | Encoding |  Collation  |    Ctype    |   Access privileges
    -----------------+----------+----------+-------------+-------------+-----------------------
     explorer-api-66 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
     postgres        | 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
     testdb          | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
    (5 rows)
    
    testdb has been created and listed above.
  • Quit the psql program and exit to the Linux prompt.
    postgres=# \q
    -bash-4.1$ exit
    

Important_icon.pngImportant:

  • Postgresql's default port is 5432. Make sure that the port is available. Click here for instructions to check which ports are in use.
  • Make sure the port is not blocked by your firewall. Click here for instructions.

Install Redis on CentOS

Important_icon.pngImportant:

  • We currently support Redis 2.8.19+ on Linux.
  • All steps need to be executed under Root account

From the terminal, run the following command to install EPEL repo.

# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

# wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

# rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

Search for epel.repo

# find / -name "epel.repo"
/etc/yum.repos.d/epel.repo

Open and edit the above file to make sure that EPEL repo is enabled.

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1 //make sure that this property is 1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
 
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1
 
[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

Save the files after you modify it.

To install Redis, execute the following commands:

#yum update
#yum --enablerepo=remi install redis -y

Search for file redis.conf

#find / -name "redis.conf"
/etc/redis.conf //this is the result

Open the file above and add # before the following line and save it.

bind 127.0.0.1

After the installation is done, check for Redis' service name in your machine by the following command:

# chkconfig

From the command's output, search for mysql to get its full name.

psacct          0:off   1:off   2:off   3:off   4:off   5:off   6:off
qtestd          0:off   1:off   2:on    3:on    4:on    5:on    6:off
quota_nld       0:off   1:off   2:off   3:off   4:off   5:off   6:off
rdisc           0:off   1:off   2:off   3:off   4:off   5:off   6:off
redis           0:off   1:off   2:off   3:off   4:off   5:off   6:off //This is Redis' service name
redis-sentinel  0:off   1:off   2:on    3:on    4:on    5:on    6:off
restorecond     0:off   1:off   2:off   3:off   4:off   5:off   6:off
rngd            0:off   1:off   2:off   3:off   4:off   5:off   6:off
rpcbind         0:off   1:off   2:on    3:on    4:on    5:on    6:off
rpcgssd         0:off   1:off   2:off   3:on    4:on    5:on    6:off
rpcsvcgssd      0:off   1:off   2:off   3:off   4:off   5:off   6:off
rsyslog         0:off   1:off   2:on    3:on    4:on    5:on    6:off
saslauthd       0:off   1:off   2:off   3:off   4:off   5:off   6:off

To verify Redis' status:

# service [redis_service_name] //use the service name you find above

Eg:

# service redis status
redis-server (pid  44237) is running...

If Redis is not running, start it.

# service redis start

To make sure that the installation is complete, use the below command. If the response output is PONG, it means installation is completed successfully.

# redis-cli ping
PONG //that means the installation is successfull

Important_icon.pngImportant:

  • Redis's default port is 6379. Make sure that the port is available. Click here for instructions to check which ports are in use.
  • Make sure the port is not blocked by your firewall. Click here for instructions.

Install Redis on Ubuntu

Important_icon.pngImportant:

  • We currently support Redis 2.8.19+ on Linux.
  • All steps need to be executed under Root account

From the terminal, run the following command to install Redis.

#apt-get update

#apt-get install redis-server

Search for file redis.conf

#find / -name "redis.conf"
/etc/redis/redis.conf //this is the result

Open the above file and add # before the following line and save it.

bind 127.0.0.1

After the installation is done, check for Redis' service name in your machine by the following command:

# chkconfig

From the command's output, search for mysql to get its full name.

procps                       off
qtest                        off
rc.local                     on
rcS                          off
redis-server                 on //this is Redis' service name
resolvconf                   off
rsync                        on
rsyslog                      off
screen-cleanup               off
sendsigs                     0
setvtrgb                     off
ssh                          off

To verify Redis' status:

# service [redis_service_name] //use the service name you find above

Eg:

# service redis-server status
redis-server is running...

If Redis is not running, start it.

# service redis-server start

To make sure that the installation is complete, use the below command. If the response output is PONG, it means installation is completed successfully.

# redis-cli ping
PONG //that means the installation is successfull

Important_icon.pngImportant:

  • Redis's default port is 6379. Make sure that the port is available. Click here for instructions to check which ports are in use.
  • Make sure the port is not blocked by your firewall. Click here for instructions.

Install ElasticSearch on CentOS and Ubuntu

Install Java 7. You can download it here.

Please refer to https://www.elastic.co/guide/en/elasticsearch/reference/1.7/setup-repositories.html for how to install ElasticSearch on Linux environment.

Important_icon.pngImportant:

  • Default ElasticSearch HTTP and TCP ports are respectively 9200 and 9300. Make sure that the port is available. Click here for instructions to check which ports are in use.
  • Make sure the ports are not blocked by your firewall. Click here for instructions.