How to Install RHQ on CentOS 6.5

Learn | Teach Open Source Technologies

How to Install RHQ on CentOS 6.5

Install PosgreSQL

3.1.1. Type ‘yum install postgresql*’ making sure to include the asterisk (*)
3.1.2. Type ‘y’ when prompted (happens twice)

Confirm java version

4.1.    Type ‘java –version’
4.2.    Confirm it’s running at least 1.6 and using OpenJDK (or Oracle/Sun Java or JRockit, but NOT GNU Libgcj)

(If not installed) Install Java

5.1.    Type ‘yum install java’
5.2.    Type ‘y’ when prompted

Add RHQ_SERVER_JAVA_HOME environmental variable

6.1.    Type ‘vi /etc/environment’
6.2.    Add ‘RHQ_SERVER_JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64’ (or whichever version of Java is running of course)
6.3.    Save
6.4.    Type ‘source /etc/environment’ to load the variables
6.5.    Type ‘echo $RHQ_SERVER_JAVA_HOME’ and the output should be '/usr/lib/jvm/jre-1.6.0-openjdk.x86_64’
6.6.    Type ‘export JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64’
6.7.    Type ‘export PATH=$PATH:/usr/lib/jvm/jre-1.6.0-openjdk.x86_64

Configure the PostgreSQL Database

Initialize the database

Type ‘/etc/init.d/postgresql initdb’
 This will add all the config files we need to edit
Edit pg_hba.conf
Type ‘vi /var/lib/pgsql/data/pg_hba.conf

Change the last few lines from

# "local" is for Unix domain socket connections only
local   all         all                               ident
# IPv4 local connections:
host    all         all         127.0.0.1/32          ident
to
# "local" is for Unix domain socket connections only
local   all         all                               trust
# IPv4 local connections:
host    all         all         127.0.0.1/32          trust

Start Postgres service

Type ‘service postgresql start’
Add a user
Type ‘psql postgres postgres’. You should be given a new prompt postgres=#
Type CREATE USER rhqadmin with password ‘rhqadmin’; 
with quotes

NOTE: Don’t forget the semicolon, otherwise it will give you a new line to enter more text. If this happens simply enter a semicolon (;). Also be sure to use different names than these dummy ones.

Create database

Type CREATE DATABASE rhq owner=rhqadmin;
Test Database connection
Type ‘\c rhq rhqadmin’ to test connection
Type ‘\q’ to exit psql

Config postgresql to start on boot

8.1.    Type ‘chkconfig --list postgresql”
Should display
postgresql         0:off      1:off      2:off      3:off      4:off      5:off      6:off
8.2.    Type ‘chkconfig --level 0123456 postgresql on’
8.3.    Type ‘chkconfig --list postgresql’ (or hit the up arrow twice) to confirm config
Should display
postgresql                  0:on       1:on       2:on       3:on       4:on       5:on       6:on

Install RHQ

Once it’s downloaded unzip it

Unzip using either the Archive Manager GUI or the command unzip rhq-server-4.6.0

Commandline Option type: ‘unzip rhq-server-4.6.0.zip –d ../Desktop’ (if you’re in the Download directory)

Change directory to the rhq server’s bin folder

Type ‘cd /home/user/Desktop/rhq-server-4.6.0/bin/

Start the server

In the server bin directory type ‘./rhq-server.sh start

Add password

Type ‘./rhq-installer.sh --dbpassword=rhqadmin’ (that’s 2 dashes)
 So the installer has the correct password

Edit the rhq-server.properties files

Change rhq.autoinstall.enabled=false to true in the Installer Settings section

Run the installer

Type ‘./rhq-installer.sh

You can now access the following applications through firefox using ‘rhqadmin’ as both the username and password.

JBoss Application server
http://localhost:6990
RHQ
http://localhost:7080

Notes:

I had an error logging into RHQ, may have been a typo on the password. To resolve I opened JBoss then RHQ then my password worked again. Opening and closing the webpages and retrying also seemed to fix it. Not entirely sure why this happens, but it was solvable within a few minutes each time.

Do not forget the http:// if you are manually typing it out. Firefox does not recognize localhost:6990 as a webpage

To start all the services when logging in again:

Login as root (type ‘su’)
Type ‘/home/user/Desktop/rhq-server-4.6.0/bin/rhq-server.sh start’ to startup RHQ again