Monday, August 29, 2011

RHQ (Jopr)

Share it Please

1. What is RHQ (Jopr).
2. Database Preparation
3. Rhq Server Installation & Configuration
4. Rhq Agent Installation & Configuration

1. What is RHQ (Jopr).

According to the RHQ documentation

This pluggable project provides administration, monitoring, alerting, operational control and configuration in an enterprise setting with fine-grained security and an advanced extension model.

By Using RHQ we can monitor, manage various resources including JBoss server, Web Server, File system and other resources in the Operating System.

The Rhq includes a Rhq Server where we can see the resources that are to be managed, a database which holds the resources that are imported into the Rhq Server.

In this article, we will see how we can configure a RHQ server , Configure Database for the Server, the agent installation and Configuration e.t.c.

2. Database Preparation

For holding the Managed resources, the RHQ server use a database at the back. Rhq server supports Oracle and PostgreSql Databases. For this demo purpose I will install PostgreSql.

Download the PostgreSql 8.8.8-1 for the Linux Distribution from Here.

Now we need to install the Postgresql with a different userID rather that root.create a new User With name Postgres.

adduser postgres
passwd postgres

Once you have created the postgres userID and defined a password to it.Login in to postgres and install the Postgresql database.

For installation just go the location where the Postgresql was downloaded and run the command like


Once the command is executed, you can see the installation of database is started.

It will be installed to /opt location if you select the default location to install.

Now once the installation is done, we now configure the PostgreSql server that suits for the RHQ 

Execute the initdb command for postgresql from bin location like,

./initdb -D opt/PostgreSQL/8.4/data

It executes and shows the following output

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale en_US.UTF-8.
The default database encoding has accordingly been set to UTF8.
The default text search configuration will be set to "english".

creating directory opt/PostgreSQL/8.4/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in opt/PostgreSQL/8.4/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
Success. You can now start the database server using:
    ./postgres -D opt/PostgreSQL/8.4/data
    ./pg_ctl -D opt/PostgreSQL/8.4/data -l logfile start

Once this is executed, start the Server using postgres command from bin like,

./postgres -D opt/PostgreSQL/8.4/data &

This shows the following output,

[postgres@vx111a bin]$ ./postgres -D opt/PostgreSQL/8.4/data &
[postgres@vx111a bin]$ LOG:  database system was shut down at 2011-08-29 04:43:35 EDT
LOG:  autovacuum launcher started
LOG:  database system is ready to accept connections

While starting the Server, it may throw some security exceptions, at that point execute the below command as root,

chcon -t textrel_shlib_t '/opt/PostgreSQL/8.4/lib/'

By this the server is up and running. Now we will create a user and Database by which we can login to server.

From the same bin location, execute command to create user

./createuser -h -p 5432 -U postgres -S -D -R rhqadmin

And execute command to create a Database

./createdb -h -p 5432 -U postgres -O rhqadmin rhq

By this the Installation of Database is done.

3. Rhq Server Installation & Configuration

Since the Database Configuration is done, its time to configure the Rhq Server. Download the Rhq Server from Here.

I download jopr2.3.1 for this demo purpose. Once the download is done extract to a location. Now move to the bin in /jopr-server-2.3.1/bin and execute the command,

./ console

This command will start the JBoss server and once the server is up and running, we can see the admin console using,

The link will be like this

Click On the “Click Here To Continue Installation” .

In The next page, you will various connection properties and other configuration stuff. Click On the “Test Connection” to see if the Server was able to get a connection to the Postgresql Database. Once the Connection is fine, Click on the button “Install Server” at the bottom of the Page.

The installation will take a few minutes. Once the installation is done, we will see a link at the both saying “Done, Click here to get Started” .Click that and it will take you to a login page.

Use the Credentials “rhqadmin” as both user name and password.

Once logged in, you can see the Server with not resources to manage.Now the Server installation is done.The next step would be do the Agent installation and configuration of the Agent.

4. Rhq Agent Installation & Configuration

Once the server installation is done, its time to download the agent and configure it. The agent can be download using the link

Make sure you change any values if you configured differently. It will start to download a jar file (rhq-enterprise-agent-1.3.1.jar).Copy the jar file to a location (mostly besides where the rhq-server is downloaded).execute the command to install the agent like,

java -jar rhq-enterprise-agent-1.3.1.jar –install

Once the command is executed and the contents are extracted, go to the /rhq-agent/bin/ and execute the command,

/ –ln

It goes like this,

[root@vx111a bin]# ./ -ln
RHQ 1.3.1 [5183] (Wed Sep 16 14:17:12 EDT 2009)
Answer the following questions to setup this RHQ Agent instance.
- After each prompt, a default value will appear in square brackets.
  If you press the ENTER key without providing any value,
  the new preference value will be set to that default value.
- If you wish to rely on the system internal default value and
  not define any preference value, enter '!*'.
- If you wish to stop before finishing all the questions but still
  retain those preferences you already set, enter '!+'.
- If you wish to cancel before finishing all the questions and revert
  all preferences back to their original values, enter '!-'.
- If you need help for a particular preference, enter '!?'.

Agent Name [vx111a] : SampleAgent
Agent Hostname or IP Address [!*] :
Agent Port [16163] : 16162
RHQ Server Hostname or IP Address [] :
RHQ Server Port [7080] :
The setup has been completed for the preferences at node [/rhq-agent/default].
> quit
Once the we configured the Agent,it now time to start the Agent.Execute the command from the same location,

 ./ start

Now In the Rhq server console, click on the OverVvew -> DashBoard to see the new agents that we configured. Select the SampleAgent and click Import under that to make the resources imported. Now we can managed the resources that are imported.

By this we complete the configuration of RHQ (Jopr) server and agent configuration.

More articles to Come. Happy Coding.

No comments :

Post a Comment