How to Install JBOSS Network Operation with PostGreSQL and RHQ Agent

How to Install JBOSS Network Operation with PostGreSQL and RHQ Agent

How to Install JBOSS Network Operation with  PostGreSQL and RHQ Agent

Pre requisites!

  • Kernel Update
  • Host File Setting
  • Centos 6 x86_64
  • Oracle Java JDK 1.6.0_45
  • POSTGRESQL
  • Jon-server_3.2.0

Download ORACLE JAVA Form www.oracle.com jdk-6u45-linux-x64-rpm.bin

Kernal Update.

[[email protected] ~]#yum update -y

Example of Host file.
To make all applications use /etc/hosts exclusively when looking up the IP address of a host, you have to edit the /etc/hosts file.

Hosts File

[[email protected] ~]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.0.200 my.jonserver.local
:wq!

Oracle JAVA Installation

[root@ jonserver.local opt]# chmod 755 jdk-6u45-linux-x64-rpm.bin
[root@ jonserver.local opt]# ./jdk-6u45-linux-x64-rpm.bin
Unpacking…
Check summing…
Extracting…
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP ([email protected]).
inflating: jdk-6u45-linux-amd64.rpm
inflating: sun-javadb-common-10.6.2-1.1.i386.rpm
inflating: sun-javadb-core-10.6.2-1.1.i386.rpm
inflating: sun-javadb-client-10.6.2-1.1.i386.rpm
inflating: sun-javadb-demo-10.6.2-1.1.i386.rpm
inflating: sun-javadb-docs-10.6.2-1.1.i386.rpm
inflating: sun-javadb-javadoc-10.6.2-1.1.i386.rpm
Preparing… ########################################### [100%]
1:jdk ########################################### [100%]
Unpacking JAR files…
rt.jar…
jsse.jar…
charsets.jar…
tools.jar…
localedata.jar…
plugin.jar…
javaws.jar…
deploy.jar…
Installing JavaDB
Preparing… ########################################### [100%]
1:sun-javadb-common ########################################### [ 17%]
2:sun-javadb-core ########################################### [ 33%]
3:sun-javadb-client ########################################### [ 50%]
4:sun-javadb-demo ########################################### [ 67%]
5:sun-javadb-docs ########################################### [ 83%]
6:sun-javadb-javadoc ########################################### [100%]

Done.

Set Oracle Java Path

[root@ jonserver.local opt]# ln -s /usr/java/jdk1.6.0_45/bin/java /usr/bin/java

Verify Oracle Java.
[root@ jonserver.local opt]# java -version
java version “1.6.0_45”
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

Export Oracle Java Path into >> /etc/profile

[root@ jonserver.local opt]# echo “export JAVA_HOME=/usr/java/jdk1.6.0_45” >> /etc/profile

Verify /etc/profile

[[email protected] opt]#cat /etc/profile

# /etc/profile

# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc

# It’s NOT a good idea to change this file unless you know what you
# are doing. It’s much better to create a custom.sh shell script in
# /etc/profile.d/ to make custom changes to your environment, as this
# will prevent the need for merging in future updates.

pathmunge () {
case “:${PATH}:” in
*:”$1″:*)
;;
*)
if [ “$2” = “after” ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
esac
}
if [ -x /usr/bin/id ]; then
if [ -z “$EUID” ]; then
# ksh workaround
EUID=`id -u`
UID=`id -ru`
fi
USER=”`id -un`”
LOGNAME=$USER
MAIL=”/var/spool/mail/$USER”
fi

# Path manipulation
if [ “$EUID” = “0” ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
else
pathmunge /usr/local/sbin after
pathmunge /usr/sbin after
pathmunge /sbin after
fi

HOSTNAME=`/bin/hostname 2>/dev/null`
HISTSIZE=1000
if [ “$HISTCONTROL” = “ignorespace” ] ; then
export HISTCONTROL=ignoreboth
else
export HISTCONTROL=ignoredups
fi

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL

# By default, we want umask to get set. This sets it for login shell
# Current threshold for system reserved uid/gids is 200
# You could check uidgid reservation validity in
# /usr/share/doc/setup-*/uidgid file
if [ $UID -gt 199 ] && [ “`id -gn`” = “`id -un`” ]; then
umask 002
else
umask 022
fi

for i in /etc/profile.d/*.sh ; do
if [ -r “$i” ]; then
if [ “${-#*i}” != “$-” ]; then
. “$i”
else
. “$i” >/dev/null 2>&1
fi
fi
done
unset i
unset -f pathmunge
export JAVA_HOME=/usr/java/jdk1.6.0_45

[root@ jonserver.local opt]# source /etc/profile.

Verify Oracle Java Path

[root@ jonserver.local opt]# echo $JAVA_HOME
/usr/java/jdk1.6.0_45

PostgreSQL Installation

[root@ jonserver.local opt]# yum install postgresql*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: stingray.cyber.net.pk
* extras: stingray.cyber.net.pk
* updates: stingray.cyber.net.pk
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package postgresql.x86_64 0:8.4.18-1.el6_4 will be updated
—> Package postgresql.x86_64 0:8.4.20-1.el6_5 will be an update
—> Package postgresql-contrib.x86_64 0:8.4.20-1.el6_5 will be installed
–> Processing Dependency: libossp-uuid.so.16()(64bit) for package: postgresql-contrib-8.4.20-1.el6_5.x86_64
—> Package postgresql-devel.x86_64 0:8.4.18-1.el6_4 will be updated
—> Package postgresql-devel.x86_64 0:8.4.20-1.el6_5 will be an update
—> Package postgresql-docs.x86_64 0:8.4.20-1.el6_5 will be installed
—> Package postgresql-jdbc.noarch 0:8.4.701-8.el6 will be installed
–> Processing Dependency: java for package: postgresql-jdbc-8.4.701-8.el6.noarch
—> Package postgresql-libs.x86_64 0:8.4.18-1.el6_4 will be updated
—> Package postgresql-libs.x86_64 0:8.4.20-1.el6_5 will be an update
—> Package postgresql-odbc.x86_64 0:08.04.0200-1.el6 will be installed
—> Package postgresql-plperl.x86_64 0:8.4.20-1.el6_5 will be installed
—> Package postgresql-plpython.x86_64 0:8.4.20-1.el6_5 will be installed
—> Package postgresql-pltcl.x86_64 0:8.4.20-1.el6_5 will be installed
—> Package postgresql-server.x86_64 0:8.4.20-1.el6_5 will be installed
—> Package postgresql-test.x86_64 0:8.4.20-1.el6_5 will be installed
–> Running transaction check
—> Package java-1.7.0-openjdk.x86_64 1:1.7.0.55-2.4.7.1.el6_5 will be installed
—> Package uuid.x86_64 0:1.6.1-10.el6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================
Package Arch Version Repository Size
=====================================================================================Installing:
postgresql-contrib x86_64 8.4.20-1.el6_5 updates 354 k
postgresql-docs x86_64 8.4.20-1.el6_5 updates 6.9 M
postgresql-jdbc noarch 8.4.701-8.el6 base 402 k
postgresql-odbc x86_64 08.04.0200-1.el6 base 267 k
postgresql-plperl x86_64 8.4.20-1.el6_5 updates 57 k
postgresql-plpython x86_64 8.4.20-1.el6_5 updates 59 k
postgresql-pltcl x86_64 8.4.20-1.el6_5 updates 46 k
postgresql-server x86_64 8.4.20-1.el6_5 updates 3.4 M
postgresql-test x86_64 8.4.20-1.el6_5 updates 1.1 M
Updating:
postgresql x86_64 8.4.20-1.el6_5 updates 2.6 M
postgresql-devel x86_64 8.4.20-1.el6_5 updates 815 k
postgresql-libs x86_64 8.4.20-1.el6_5 updates 201 k
Installing for dependencies:
java-1.7.0-openjdk x86_64 1:1.7.0.55-2.4.7.1.el6_5 updates 26 M
uuid x86_64 1.6.1-10.el6 base 54 k

Transaction Summary
=====================================================================================
Install 11 Package(s)
Upgrade 3 Package(s)

Total download size: 42 M
Is this ok [y/N]: y
Downloading Packages:
(1/14): java-1.7.0-openjdk-1.7.0.55-2.4.7.1.el6_5.x86_64.rpm | 26 MB 00:29
(2/14): postgresql-8.4.20-1.el6_5.x86_64.rpm | 2.6 MB 00:06
(3/14): postgresql-contrib-8.4.20-1.el6_5.x86_64.rpm | 354 kB 00:00
(4/14): postgresql-devel-8.4.20-1.el6_5.x86_64.rpm | 815 kB 00:01
(5/14): postgresql-docs-8.4.20-1.el6_5.x86_64.rpm | 6.9 MB 00:10
(6/14): postgresql-jdbc-8.4.701-8.el6.noarch.rpm | 402 kB 00:00
(7/14): postgresql-libs-8.4.20-1.el6_5.x86_64.rpm | 201 kB 00:00
(8/14): postgresql-odbc-08.04.0200-1.el6.x86_64.rpm | 267 kB 00:00
(9/14): postgresql-plperl-8.4.20-1.el6_5.x86_64.rpm | 57 kB 00:00
(10/14): postgresql-plpython-8.4.20-1.el6_5.x86_64.rpm | 59 kB 00:00
(11/14): postgresql-pltcl-8.4.20-1.el6_5.x86_64.rpm | 46 kB 00:00
(12/14): postgresql-server-8.4.20-1.el6_5.x86_64.rpm | 3.4 MB 00:03
(13/14): postgresql-test-8.4.20-1.el6_5.x86_64.rpm | 1.1 MB 00:01
(14/14): uuid-1.6.1-10.el6.x86_64.rpm | 54 kB 00:00
————————————————————————————————————————————–
Total 765 kB/s | 42 MB 00:56
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Updating : postgresql-libs-8.4.20-1.el6_5.x86_64 1/17
Updating : postgresql-8.4.20-1.el6_5.x86_64 2/17
Installing : postgresql-server-8.4.20-1.el6_5.x86_64 3/17
Installing : uuid-1.6.1-10.el6.x86_64 4/17
Installing : 1:java-1.7.0-openjdk-1.7.0.55-2.4.7.1.el6_5.x86_64 5/17
Installing : postgresql-jdbc-8.4.701-8.el6.noarch 6/17
Installing : postgresql-contrib-8.4.20-1.el6_5.x86_64 7/17
Installing : postgresql-plpython-8.4.20-1.el6_5.x86_64 8/17
Installing : postgresql-pltcl-8.4.20-1.el6_5.x86_64 9/17
Installing : postgresql-test-8.4.20-1.el6_5.x86_64 10/17
Installing : postgresql-plperl-8.4.20-1.el6_5.x86_64 11/17
Installing : postgresql-docs-8.4.20-1.el6_5.x86_64 12/17
Updating : postgresql-devel-8.4.20-1.el6_5.x86_64 13/17
Installing : postgresql-odbc-08.04.0200-1.el6.x86_64 14/17
Cleanup : postgresql-devel-8.4.18-1.el6_4.x86_64 15/17
Cleanup : postgresql-8.4.18-1.el6_4.x86_64 16/17
Cleanup : postgresql-libs-8.4.18-1.el6_4.x86_64 17/17
Verifying : postgresql-jdbc-8.4.701-8.el6.noarch 1/17
Verifying : postgresql-libs-8.4.20-1.el6_5.x86_64 2/17
Verifying : postgresql-plpython-8.4.20-1.el6_5.x86_64 3/17
Verifying : postgresql-contrib-8.4.20-1.el6_5.x86_64 4/17
Verifying : postgresql-server-8.4.20-1.el6_5.x86_64 5/17
Verifying : postgresql-docs-8.4.20-1.el6_5.x86_64 6/17
Verifying : 1:java-1.7.0-openjdk-1.7.0.55-2.4.7.1.el6_5.x86_64 7/17
Verifying : postgresql-devel-8.4.20-1.el6_5.x86_64 8/17
Verifying : postgresql-pltcl-8.4.20-1.el6_5.x86_64 9/17
Verifying : uuid-1.6.1-10.el6.x86_64 10/17
Verifying : postgresql-odbc-08.04.0200-1.el6.x86_64 11/17
Verifying : postgresql-test-8.4.20-1.el6_5.x86_64 12/17
Verifying : postgresql-8.4.20-1.el6_5.x86_64 13/17
Verifying : postgresql-plperl-8.4.20-1.el6_5.x86_64 14/17
Verifying : postgresql-devel-8.4.18-1.el6_4.x86_64 15/17
Verifying : postgresql-libs-8.4.18-1.el6_4.x86_64 16/17
Verifying : postgresql-8.4.18-1.el6_4.x86_64 17/17

Installed:
postgresql-contrib.x86_64 0:8.4.20-1.el6_5 postgresql-docs.x86_64 0:8.4.20-1.el6_5 postgresql-jdbc.noarch 0:8.4.701-8.el6
postgresql-odbc.x86_64 0:08.04.0200-1.el6 postgresql-plperl.x86_64 0:8.4.20-1.el6_5 postgresql-plpython.x86_64 0:8.4.20-1.el6_5
postgresql-pltcl.x86_64 0:8.4.20-1.el6_5 postgresql-server.x86_64 0:8.4.20-1.el6_5 postgresql-test.x86_64 0:8.4.20-1.el6_5

Dependency Installed:
java-1.7.0-openjdk.x86_64 1:1.7.0.55-2.4.7.1.el6_5 uuid.x86_64 0:1.6.1-10.el6

Updated:
postgresql.x86_64 0:8.4.20-1.el6_5 postgresql-devel.x86_64 0:8.4.20-1.el6_5 postgresql-libs.x86_64 0:8.4.20-1.el6_5

Complete!

Start PostgreSQL Service

[root@ jonserver.local opt]# /etc/init.d/postgresql initdb
Initializing database: [ OK ]

Configuration of PostgreSQL

[root@ jonserver.local opt]# vi /var/lib/pgsql/data/pg_hba.conf

# TYPE DATABASE USER CIDR-ADDRESS METHOD

# “local” is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust

:wq!

Restart PostgreSQL Service

[root@ jonserver.local opt]# /etc/init.d/postgresql restart
Stopping postgresql service: [ OK ]
Starting postgresql service: [ OK ]

Create RHQ Database and Users Roles

[root@ jonserver.local opt]# psql postgres postgres
psql (8.4.20)
Type “help” for help.

postgres=# CREATE DATABASE rhq owner=rhqadmin;
CREATE DATABASE
postgres=# CREATE USER rhqadmin with password ‘rhqadmin#@!PKR22’;
CREATE ROLE

Connect Postgresql with rhq Database and rhqadmin User.
postgres=# \c rhq rhqadmin
psql (8.4.20)
You are now connected to database “rhq” as user “rhqadmin”.

rhq=> \q

Great Database Configuration Done

JBOSS Network Operation Installation

[root@ jonserver.local jon]# unzip -q jon-server-3.2.0.GA.zip
[root@ jonserver.local opt]# cd jon-server-3.2.0.GA
[root@ jonserver.local jon-server-3.2.0.GA]# cd bin/
[root@ jonserver.local bin]# ll
total 120
drwxr-xr-x. 2 root root 4096 Dec 12 2013 internal
-rwxr-xr-x. 1 root root 10050 Dec 12 2013 rhqctl
-rw-r–r–. 1 root root 8612 Dec 12 2013 rhqctl.bat
-rw-r–r–. 1 root root 8685 Dec 12 2013 rhq-data-migration.bat
-rwxr-xr-x. 1 root root 9994 Dec 12 2013 rhq-data-migration.sh
-rw-r–r–. 1 root root 119 Dec 12 2013 rhq-encode-password.bat
-rwxr-xr-x. 1 root root 1344 Dec 12 2013 rhq-encode-password.sh
-rw-r–r–. 1 root root 149 Dec 12 2013 rhq-installer.bat
-rwxr-xr-x. 1 root root 152 Dec 12 2013 rhq-installer.sh
-rw-r–r–. 1 root root 149 Dec 12 2013 rhq-server.bat
-rw-r–r–. 1 root root 149 Dec 12 2013 rhq-server-console.bat
-rw-r—–. 1 root root 14900 May 27 11:41 rhq-server.properties
-rwxr-xr-x. 1 root root 152 Dec 12 2013 rhq-server.sh
-rw-r–r–. 1 root root 149 Dec 12 2013 rhq-storage.bat
-rw-r–r–. 1 root root 149 Dec 12 2013 rhq-storage-installer.bat
-rwxr-xr-x. 1 root root 152 Dec 12 2013 rhq-storage-installer.sh
-rw-r–r–. 1 root root 5286 Dec 12 2013 rhq-storage.properties
drwxr-xr-x. 3 root root 4096 Dec 13 2013 wrapper

Enable Chkconfig Postgresql Start Automaticly during Next Boot time

[root@ jonserver.local bin]# chkconfig postgresql on

Configuration of JBoss Network Operation

[root@ jonserver.local bin]# vi rhq-server.properties

# PostgreSQL database Connection Setting!
rhq.server.database.connection-url=jdbc:postgresql:// 192.168.0.200:5432/rhq
rhq.server.database.user-name=rhqadmin
rhq.server.database.password=rhqadmin#@!PKR22
rhq.server.database.type-mapping=PostgreSQL
rhq.server.database.server-name=192.168.0.200
rhq.server.database.port=5432
rhq.server.database.db-name=rhq
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
rhq.server.quartz.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate

Please Comment all Oracle DB Connection Strings

# Oracle database
#rhq.server.database.connection-url=jdbc:oracle:thin:@127.0.0.1:1521:xe
#rhq.server.database.user-name=rhqadmin
#rhq.server.database.password=1eeb2f255e832171df8592078de921bc
#rhq.server.database.type-mapping=Oracle10g
#rhq.server.database.server-name=unused
#rhq.server.database.port=unused
#rhq.server.database.db-name=unused
#hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
#rhq.server.quartz.driverDelegateClass=org.quartz.impl.jdbcjobstore.oracle.OracleDelegate

SMTP Setting
# Email settings used to connect to an SMTP server to send alert emails.
rhq.server.email.smtp-host=localhost
rhq.server.email.smtp-port=25
rhq.server.email.from-address=rhqadmin@localhost

#############################################################################
# Host and Port Bindings
# ———————-
# INSTALLATION ACTION REQUIRED! The following property must be explicitly set:
# jboss.bind.address
#
# These define the ports the RHQ Server will bind to. Most of the time
# you can leave these alone. You can change these default values to
# conform to your own environment’s requirements, such as the IP address
# the RHQ Server will bind to (jboss.bind.address) and the ports
# browsers will use to access the RHQ web application
# (rhq.server.socket.binding.port.http, rhq.server.socket.binding.port.https)
# If you change the binding address, you might also want to change
# “rhq.autoinstall.public-endpoint-address” as well.
#############################################################################

# The bind address for the RHQ server (jboss server). To bind the server on
# all network interfaces set to 0.0.0.0, otherwise a specific IP address.
# jboss.bind.address=0.0.0.0
jboss.bind.address=0.0.0.0

# By default only local management connections
jboss.bind.address.management=127.0.0.1

jboss.socket.binding.port-offset=0

jboss.management.native.port=6999
jboss.management.http.port=6990
jboss.management.https.port=6443

rhq.server.socket.binding.port.ajp=7009
rhq.server.socket.binding.port.http=7080
rhq.server.socket.binding.port.https=7443
rhq.server.socket.binding.port.jacorb=2528
rhq.server.socket.binding.port.jacorb-ssl=2529
rhq.server.socket.binding.port.messaging=4449
rhq.server.socket.binding.port.messaging-throughput=4455
rhq.server.socket.binding.port.osgi-http=7090
rhq.server.socket.binding.port.remoting=3447
rhq.server.socket.binding.port.txn-recovery-environment=3712
rhq.server.socket.binding.port.txn-status-manager=3713
#############################################################################
# Installer Settings
# ——————
# INSTALLATION ACTION REQUIRED! Review the default settings:
#
# These enable the installer when starting for the first time.
# To do so, first ensure all values in this properties file are appropriately
# set for your environment. Once you are sure all values are as you want them,
# set rhq.autoinstall.enabled=true and run the server then run the installer.
#
# rhq.autoinstall.enabled: must be true to trigger the automatic install.
# rhq.autoinstall.database: allowed values: auto, overwrite, skip
# “auto” will create a new schema if one does not
# yet exist or, if a schema does exist, will simply
# upgrade it as needed (which keeps existing data).
# “overwrite” if you want to create an empty schema,
# even if one already exists (loses existing data).
# “skip” if you don’t want to do any database
# upgrade or creation. WARNING! You must ensure your
# database schema already exists and is up to date.
# rhq.autoinstall.public-endpoint-address: public IP/hostname that all agents
# will use to talk to this server.
# If not set, a value to use is
# determined at auto-install time.
#############################################################################

rhq.autoinstall.enabled=false
rhq.autoinstall.database=auto

#############################################################################
# Storage cluster configuration settings
#
# IMPORTANT NOTE:
# – Storage Node properties will be stored in the database
# after the initial install. The server will use database stored
# properties during operation and after restarts.
# – Additional servers in an HA topology will use database stored Storage
# Node properties. So properties set in this configuration file will be
# overriden on install with the database values.
#############################################################################

# The username RHQ will use to authenticate against the Storage Cluster.
# The value is generated and should not be edited.
rhq.storage.username=oruhcwbi

:wq!

Start JBoss Nextwork Operation Installation

[root@ jonserver.local bin]# ./rhqctl install

Start JBoss Network Operation Services

[root@ jonserver.local bin]# ./rhqctl start

INFO 13:28:04,160 Node jonserver.local / 192.168.0.200 state
INFO 13:28:04,191 Startup completed! Now serving reads.
Trying to start the RHQ Server…
RHQ Server (pid 5189 ) IS starting
Starting RHQ Agent…
RHQ Agent (pid 5358 ) IS running

Verify JBoss Network Operation Services is UP and Running.
[root@ jonserver.local bin]# ./rhqctl status
13:29:32,208 INFO [org.jboss.modules] JBoss Modules version 1.2.2.Final-redhat-1
RHQ Storage Node (pid 5035 ) IS running
RHQ Server (pid 5189 ) IS running
JBossAS Java VM child process (pid 5189 ) IS running
RHQ Agent (pid 5358 ) IS running
Check and Verify JBoss Network Operation Logs.
[root@ jonserver.local opt]# cd jon/jon-server-3.2.0.GA/logs/
[root@ jonserver.local logs]# tail -f server.log

Great RED HAT JOBSS OPERATION NETWORK Successfully Installed and Verified by Logs

Open Internet Browser, Access GUI Admin Panel

http://192.168.0.200:7080/coregui