Wednesday, March 31, 2010

JVM options

Use these JVM options as applicable for your environment

-XX:+AggressiveOpts
-XX:+DoEscape
-XX:+UseLargePages

Linux Tuning Optimization

1) Commands to check current settings before updating sys parameters
---------------------------------------------------------
cat /proc/sys/fs/file-max

ulimit -n

cat /proc/sys/net/core/rmem_default
cat /proc/sys/net/core/wmem_default
cat /proc/sys/net/core/rmem_max
cat /proc/sys/net/core/wmem_max

/sbin/ifconfig -a
eth0      Link encap:Ethernet  HWaddr 
          inet addr: Bcast: Mask:
          inet6 addr: fe80::250:56ff:febf:7f5a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9313376 errors:0 dropped:0 overruns:0 frame:0

cat /proc/sys/kernel/shmmax 
cat /proc/sys/vm/nr_hugepages 
---------------------------------------------------------

2) Edit /etc/sysctl.conf and append these values
---------------------------------------------------------
# Set File Max
set fs.file-max=102642

# Increase default socket send and receive buffers
net.core.rmem_default=262122

net.core.wmem_default=262122
net.core.rmem_max=262122
net.core.wmem_max=262122
---------------------------------------------------------

3) Edit /etc/sysconfig/network-scripts/ifcfg-eth0 and append MTU
# recommended for gigabit ethernet to reduce packet fragmentation
MTU=9000

4) echo 2147483647 > /proc/sys/kernel/shmmax or update sysctl.conf
5) echo 1000 > /proc/sys/vm/nr_hugepages

6) Edit /etc/limits.conf and set ulimit value

JBOSS virtual hosts

Edit /opt/jboss-eap-5.0/jboss-as/server/default/deploy/jbossweb.sar/server.xml to include your virtual hosts.

<Engine name="jboss.web" defaultHost="vhosts-mydomain">
   <Host name="vhosts-mydomain">
      <Alias>www.mydomain.com</Alias>
      <Alias>secure.mydomain.com</Alias>
      <Alias>somename.mydomain.com</Alias>
   </Host>
</Engine>

JBOSS thread dump using jstack

To take a threaddump on running java process in JBOSS,
ps -ef | grep java
find the process id (pid)
jstack {pid}> thread-dump.log

Monday, March 29, 2010

JBOSS Encrypt passwords

To encrypt the passwords stored in JBOSS configuration files:

1) Create a script: encrypt_password.sh with the content
------------------------------------------------------------
cd $JBOSS_HOME
echo "Please enter the password to be encrypted"
read password
java -cp lib/jboss-logging-spi.jar:common/lib/jbosssx.jar org.jboss.resource.security.SecureIdentityLoginModule $password
------------------------------------------------------------

2) Execute the script.
Ex:
./encrypt_password.sh

Please enter the password to be encrypted
test
Encoded password: 48e90df5bc00051e

Friday, March 26, 2010

Using Apache mod_jk with BigIP LTM and JBOSS

1) Make sure your JBOSS is running and listening on AJP port 8009

2) LTM Load Balancer Configuration
a) Create a TCP monitor jboss-tcp-monitor using parent profile TCP
b) Create a Virtual Server with port 8009
c) Create a Pool
d) Create a Pool member with port 8009. The member will be JBOSS server IP and port 8009
e) Associate Pool with jboss-tcp-monitor
Reference: 
http://jbossadmin.blogspot.com/2010/03/ltm-configuration-for-apache.html

3) Configure mod_jk in apache
Reference: http://jbossadmin.blogspot.com/2010/03/apache-jboss-integration.html
Update these values to read as

worker.node1.port=8009
worker.node1.host={ltm-loadbalancer-vip}
worker.node1.type=ajp13

4) Test the browser website URL

Wednesday, March 24, 2010

JBOSS Oracle XA Datasource Configuration

1) Copy the sample file from /opt/jboss-eap-5.0/jboss-as/docs/examples/jca/oracle-xa-ds.xml.

Note: For Oracle 10g, type name is used as Oracle 9i

Rename the file as required and edit to read as follows
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- ATTENTION:  DO NOT FORGET TO SET Pad=true IN transaction-service.xml  -->
<!-- ===================================================================== -->

<datasources>
  <xa-datasource>
    <jndi-name>jdbc/{your-jndi-name}</jndi-name>
    <!-- uncomment to enable interleaving <interleaving/> -->
    <isSameRM-override-value>false</isSameRM-override-value>
    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
    <xa-datasource-property name="URL">jdbc:oracle:thin:@{db-server-name}:1526:{db-name}</xa-datasource-property>

    <xa-datasource-property name="User">{db-user-name}</xa-datasource-property>

    <xa-datasource-property name="Password">{db-password}</xa-datasource-property>
    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
    <no-tx-separate-pools/>
      <metadata>
         <type-mapping>Oracle9i</type-mapping>
      </metadata>
  </xa-datasource>

  <mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter"
         name="jboss.jca:service=OracleXAExceptionFormatter">
    <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
  </mbean>
</datasources>

2) Copy the ojdbc14_g.jar (oracle jdbc client jar) to location /opt/jboss-eap-5.0/jboss-as/server/default/lib
3) Copy {filename}-ds.xml file to /opt/jboss-eap-5.0/jboss-as/server/default/deploy or any directory defined in bootstrap/profile.xml
4) Restart the server if required. You should automatically see the data sources through the console.

5) If you want to encrypt the data source login information

5a) Edit /opt/jboss-eap-5.0/jboss-as/server/default/conf/login.xml and append the following application policy inside policy tags.
<application-policy name="{your-policy-name}">
<authentication>
<login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
<module-option name="username">ejb</module-option>
<module-option name="password">{db-encrypted-password}</module-option>
<module-option name="managedConnectionFactoryName">jboss.jca:name=jdbc/{your-jndi-name},service=XATxCM</module-option>
</login-module>
</authentication>
</application-policy>
where jboss.jca:name=jdbc/{your-jndi-name} is the same value defined in oracle-ds file

5b) Edit oracle-xa-ds.xml file.
Replace these lines

   <xa-datasource-property name="User">{db-user-name}</xa-datasource-property>
   <xa-datasource-property name="Password">{db-password}</xa-datasource-property>
with 
   <security-domain>{your-policy-name}</security-domain>

5c) Restart the server

JBOSS Application deployment

1) Standalone server
Copy or move war files to the deploy directory configured in /opt/jboss-eap-5.0/jboss-as/server/default/conf/bootstrap/profile.xml



      ${jboss.server.home.url}conf/bindingservice.beans
      ${jboss.server.home.url}conf/jboss-service.xml
      ${jboss.server.home.url}deployers
      
  
                                ${jboss.server.home.url}deploy
                                file:///opt/customApps
                      
              
                ${jboss.server.data.dir}/attachments
                
      

2) Farm (for clustered environment)
Farming is enabled by default in JBOSS environments
The configuration files related to farming are located in
/opt/jboss-eap-5.0/jboss-as/server/all/deploy/cluster/farm-deployment-jboss-beans.xml
/opt/jboss-eap-5.0/jboss-as/server/all/deploy/cluster/timestamps-jboss-beans.xml

3) Enable Hot Deployment
Refer to the config file/opt/jboss-eap-5.0/jboss-as/server/default/deploy/hdscanner-jboss-beans.xml for scan frequency and other settings.

4) Disable Hot Deployment
Remove the file /opt/jboss-eap-5.0/jboss-as/server/default/deploy/hdscanner-jboss-beans.xml to disable hotdeploy

Slim JBOSS

Slim configuration based on production profile:

# Following directories can be deleted from JBOSS at will.
rm -Rf /opt/jboss-eap-5.0/resteasy
rm -Rf /opt/jboss-eap-5.0/seam

rm -Rf /opt/jboss-eap-5.0/jboss-as/client
rm -Rf /opt/jboss-eap-5.0/jboss-as/docs

# Any ununused profiles can be deleted from this location
/opt/jboss-eap-5.0/jboss-as/server

# Remove EJB services
cd $JBOSS_SERVER_HOME/deploy
rm ejb*.xml
cd $JBOSS_SERVER_HOME/deployers
rm jboss-ejb3-*.jar

# Remove JUDDI 7
cd $JBOSS_SERVER_HOME/deploy
rm -Rf juddi-service.sar
# Remove Key Generator
rm -Rf uuid-key-generator.sar

# Turn off hot deployment
rm hdscanner-jboss-beans.xml

Temp/Log directories that can be deleted on startup
/opt/jboss-eap-5.0/jboss-as/server/log/*
/opt/jboss-eap-5.0/jboss-as/server/temp/*
/opt/jboss-eap-5.0/jboss-as/server/work/*
/opt/jboss-eap-5.0/jboss-as/server/data/*

JON Configuration

Linux Server Configuration

Navigate to Linux Server -> Inventory -> Connection -> Edit
Enable Content Delivery
Enable Internal Yum Server
Specify Yum Server Port

Under Event Logs
Add New

Log Tracking Enabled: Yes
Minimum Severity: Information
Log Tracking Type: File
Syslog File Path:  /var/log/messages

JBOSS Configuration
Navigate to JBOSS server from JON console
JBOSS server -> Inventory -> Connection ->. Edit

Provide additional info:

Principal: admin
Credentials: jboss
Start script: /home/jbossadm/scripts/start_jboss.sh (you can provide direct path to run.sh or custom start script)
Stop script: /home/jbossadm/scripts/stop_jboss.sh (you can provide direct path to shutdown.sh or custom stop script)
Shutdown Method: shutdown script
Bind Address: {jboss-server-ip-addr}
Java Home: /opt/jre1.6.0_18



Tuesday, March 23, 2010

Reload JON configuration

./rhq-agent.sh --cleanconfig -c conf/agent-configuration.xml
or
./rhq-agent.sh -l -c conf/agent-configuration.xml

External Links

Download connectors for Apache
http://svn.hyperic.org/?root=Hyperic+HQ+Connectors

JBOSS supported configurations
http://www.jboss.com/products/platforms/application/supportedconfigurations/

JBOSS Profiler
http://labs.jboss.com/jbossprofile

Multicast address assignment
http://www.29west.com/docs/THPM/multicast-address-assignment.html

Test Multicast
http://www.jgroups.org/

JON Agent update

To update IP address, run the command
setconfig rhq.communications.connector.bind-address={new-ip-addr}
(or)
Update agent-configuration file if required and follow --cleanconfig steps.
Restart Agent.

JON - Create Dyna groups

Dyna group is similar to logical group.

Create Dyna Group
Groups -> New group definition

To group all RHQ agents,
Name: custom-AgentGroup
Expression:

resource.type.plugin = RHQAgent
resource.type.name = RHQ Agent

Recursive: true

Calculate groups manually which will discover resources based on the Expression
Set Interval for automatic recalculation

JON Agent commands

Reload JON agent configuration

./rhq-agent.sh --cleanconfig -c conf/agent-configuration.xml
or
./rhq-agent.sh -l -c conf/agent-configuration.xml

Force discovery of agent
/opt/jon-server-2.3.1.GA/bin/rhq-agent.sh
> discovery -f  


JON agent operations
/opt/jon-server-2.3.1.GA/bin/rhq-agent.sh
> start
> shutdown

Oracle - Login as sysdba with lost sysdba password

cd /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin
. ./oracle_env.sh
set ORACLE_SID=XE


-bash-3.2$ sqlplus

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 23 11:31:46 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Enter user-name:
-bash-3.2$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 23 11:31:53 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

SQL>

Monday, March 22, 2010

JON Activities

Modify Server Configuration using file:
/opt/jon-server-2.3.1.GA/bin/rhq-server.properties

Test Email configuration, agents, sql etc..
http://{ip_addr}:7080/admin/test/email.jsp

Uninventory resources
Resources -> Platform -> Uninventory the required resource



Apache JON integration

1) Install JON agent. It is better to install JON agent using the same account as Apache install.

2) Import the server/agent into JON

3) Navigate to Host -> Inventory -> Manually add Apache HTTP server -> Specify required parameters.
Server Root: /opt/apache
Config File: /opt/apacheconf/httpd.conf
SNMP Agent: {apache-server-ip-address}
SNMP Agent Port: 1691 (or applicable to your environment)
Error Log File Path: /opt/apachelogs/error_log

4) Navigate to the auto discovery queue and import Apache manually.

5) Enable RT metrics (optional)
Login to JON
Administration > System Configuration > Templates | Apache HTTP Server > Apache Virtual
Host-> Edit Metric Template
Select HTTP Response Time
Select Update schedules for existing resources of marked type
Specify "Collection Interval for Selected"
Hit Start (>) button

Enable mod_headers in Apache


#cd /opt/software/httpd-2.2.14/modules/metadata
#/opt/apache/bin/apxs -i -a -c mod_headers.c

Output:
/opt/apache/build/libtool --silent --mode=compile gcc -prefer-pic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -O2 -pthread -I/opt/apache/include -I/opt/apache/include -I/opt/apache/include -c -o mod_headers.lo mod_headers.c && touch mod_headers.slo
/opt/apache/build/libtool --silent --mode=link gcc -o mod_headers.la -rpath /opt/apache/modules -module -avoid-version mod_headers.lo
/opt/apache/build/instdso.sh SH_LIBTOOL='/opt/apache/build/libtool' mod_headers.la /opt/apache/modules
/opt/apache/build/libtool --mode=install cp mod_headers.la /opt/apache/modules/
cp .libs/mod_headers.so /opt/apache/modules/mod_headers.so
cp .libs/mod_headers.lai /opt/apache/modules/mod_headers.la
cp .libs/mod_headers.a /opt/apache/modules/mod_headers.a
chmod 644 /opt/apache/modules/mod_headers.a
ranlib /opt/apache/modules/mod_headers.a
PATH="$PATH:/sbin" ldconfig -n /opt/apache/modules
----------------------------------------------------------------------
Libraries have been installed in:
/opt/apache/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 755 /opt/apache/modules/mod_headers.so
[activating module `headers' in /opt/apache/conf/httpd.conf]

Wednesday, March 17, 2010

Apache tuning

Prefork tuning parameters:

Say,
Resident Memory Size = 8 MB (determined process memory when load testing)
Available Memory to use by Apache = 6 GB = 6114 B

Calculate:
MaxClients = 6114 MB / 8 MB = 768
ServerLimit = MaxClients

ServerLimit 768
StartServers 512
MinSpareServers 50
MaxSpareServers 100
MaxClients 768
MaxRequestsPerChild 10000

KeepAlive On
KeepAliveTimeout 2
MaxKeepAliveRequests 100
Timeout 20

Adjust slow ramp up time on LTM to avoid flooding on webservers


Include http-default.conf
UseCanonicalName On

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{X-Forwarded-For}i\"" custom-interval

Tuesday, March 16, 2010

Apache commands

Custom script to start Apache (start_apache.sh)

#!/bin/sh
echo "------------------------"
echo "Verify Configuration"
echo "------------------------"
/opt/apache/bin/httpd -f /opt/apacheconf/httpd.conf -t -S

echo "------------------------"
echo "Start Apache"
echo "------------------------"

/opt/apache/bin/httpd -f /opt/apacheconf/httpd.conf -k start

echo "------------------------"
echo "List HTTP Processes"
echo "------------------------"
sleep 3
ps -ef | grep http

Custom script to stop Apache (stop_apache.sh)
#!/bin/sh

echo "------------------------"
echo "Stop Apache"
echo "------------------------"
/opt/apache/bin/httpd -f /opt/apacheconf/httpd.conf -k stop

echo "------------------------"
echo " List HTTP Processes"
echo "------------------------"
sleep 3
ps -ef | grep http

rm /opt/apachelogs/*

List statically compiled modules
/opt/apache/bin/httpd -l or /opt/apache/bin/apachectl -l

Which mpm is used by apache?
/opt/apache/bin/apachectl -l

List all loaded modules
/opt/apache/bin/httpd -t -D DUMP_MODULES

Enable SSL in JBOSS

1) Create a keystore using keytool utility

#keytool can be found from Java runtime - /opt/jre1.6.0_18/bin/keytool
# Enter values as required

mkdir $JBOSS_HOME/ssl
cd $JBOSS_HOME/ssl

$ keytool -genkey -alias jboss -keyalg RSA -keystore jboss.keystore -validity 3650
Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]:
What is the name of your organizational unit?
[Unknown]:
What is the name of your organization?
[Unknown]:
What is the name of your City or Locality?
[Unknown]:
What is the name of your State or Province?
[Unknown]:
What is the two-letter country code for this unit?
[Unknown]: US
Is valuescorrect?
[no]: yes

Enter key password for
(RETURN if same as keystore password):
Re-enter new password:

A .keystore file will be created in the current directory. 

2) Update /opt/jboss-eap-5.0/jboss-as/server/default/deploy/jbossweb.sar/server.xml with correct keystore values.

<Connector protocol="HTTP/1.1" SSLEnabled="true"

port="8443" address="${jboss.bind.address}"
scheme="https" secure="true" clientAuth="false"
keystoreFile="${jboss.server.home.dir}/conf/jboss.keystore"
keystorePass="{your-password}" sslProtocol = "TLS" />

3) Restart the server. Test using https://{ip_address}:8443/context-root/filename.jsp

JBOSS/JON URLs

JBOSS
http://{ip_address}:8080/admin-console
http://{ip_address}:8080/jmx-console
http://{ip_address}:8080/web-console
http://{ip_address}:8080/web-console/status

JON
http://{ip_address}:7080
http://{ip_address}:7080/agentupdate/download
http://{ip_address}:7080/agentupdate/version
http://{ip_address}:7080/admin/test/email.jsp







Monday, March 15, 2010

Apache JBOSS integration

1) Download mod_jk module from
http://www.gtlib.gatech.edu/pub/apache/tomcat/tomcat-connectors/jk/binaries/linux/jk-1.2.28/i586/

2) Copy mod_jk-1.2.28-httpd-2.2.X.so to /opt/apacheconf

3) Edit the httpd.conf and add the following line
Include /opt/apacheconf/mod-jk.conf

4) Create /opt/apacheconf/mod-jk.conf file with the following content
LoadModule jk_module /opt/apacheconf/mod_jk-1.2.28-httpd-2.2.X.so
JkWorkersFile /opt/apacheconf/workers.properties
JkLogFile /opt/apachelogs/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardKeySize +ForwardURICompatUnparsed -ForwardDirectories
JkRequestLogFormat "%w %V %T"

JkMountFile /opt/apacheconf/uriworkermap.properties
JkShmFile /opt/apachelogs/jk.shm

<Location /jkstatus>
JkMount status
#Order deny,allow
#Deny from all
#Allow from 127.0.0.1
</Location>

5) Create /opt/apacheconf/uriworkermap.properties file with the following content
# Simple worker configuration file
# Mount the Servlet context to the ajp13 worker
/jmx-console=loadbalancer
/jmx-console/*=loadbalancer
/web-console=loadbalancer
/web-console/*=loadbalancer
/testWeb/*=loadbalancer
!/testWeb/images/*=loadbalancer

6) Create /opt/apacheconf/workers.properties file with the following content
worker.list=loadbalancer,status
# Define Node1
# modify the host as your host IP or DNS name.
worker.node1.port=8009
worker.node1.host={jboss-server-ip-address goes here}
worker.node1.type=ajp13
worker.node1.lbfactor=1
worker.node1.prepost_timeout=10000 #Not required if using ping_mode=A
worker.node1.connect_timeout=10000 #Not required if using ping_mode=A
worker.node1.ping_mode=A #As of mod_jk 1.2.27
# worker.node1.connection_pool_size=10 (1)

# Define Node2
# modify the host as your host IP or DNS name.
#worker.node2.port=8009
#worker.node2.host= node2.mydomain.com
#worker.node2.type=ajp13
#worker.node2.lbfactor=1
#worker.node2.prepost_timeout=10000 #Not required if using ping_mode=A
#worker.node2.connect_timeout=10000 #Not required if using ping_mode=A
#worker.node2.ping_mode=A #As of mod_jk 1.2.27
# worker.node1.connection_pool_size=10 (1)

# Load-balancing behaviour
worker.loadbalancer.type=lb
#worker.loadbalancer.balance_workers=node1,node2
worker.loadbalancer.balance_workers=node1

# Status worker for managing load balancer
worker.status.type=status

The above configuration is to test with one app server functionally.

7) Update /opt/apacheconf/httpd-vhosts.conf with JkMount
Listen 9080
NameVirtualHost *
<VirtualHost *>
ServerName {server-name}
ServerAlias {alias}
JkMount /testWeb loadbalancer
JkMount /testWeb/* loadbalancer
</VirtualHost>

8) Update the following line to include jvmRoute in /opt/jboss-eap-5.0/jboss-as/server/default/deploy/jbossweb.sar/server.xml

<Engine name="jboss.web" defaultHost="localhost" jvmRoute="domain-name-goes-here">

9) Restart Apache and JBOSS server

10) Test the web server URL http://{domain-name}/testWeb/test.jsp



Apache installation

Apache 2.2.14 installation on RHEL 5 (statically linked Apache binary)

Benefit of a statically built Apache server is that at compile time users have to examine all modules needed. This insures the smallest memory footprint for the Apache binary, and can also result in a more secure server by limiting exposure to loaded modules. Once you build and run your Apache binary, you will know exactly the memory footprint of each child or
worker

1) Create user
#useradd -m apacheadm
#passwd apacheadm

2) Login as apacheadm

3) Download httpd-2.2.14.tar.gz source distribution to /opt/software

4) Prepare for install

chmod 755 httpd-2.2.14.tar.gz
gunzip httpd-2.2.14.tar.gz
tar -xvf httpd-2.2.14.tar
rm httpd-2.2.14.tar
cd httpd-2.2.14
./configure --prefix=/opt/apache --enable-headers --enable-proxy --enable-rewrite --with-included-apr
make

Optional:

i) To include modules of your choice: ./configure --prefix=/opt/apache --with-included-apr --enable-ssl --enable-module=proxy
ii) Compile Apache for dynamic loading: ./configure --prefix=/opt/apache --enable-so

5) Install Apache
make install

References:
Apache website
F5 LTM deployment guide for Apache


Wednesday, March 10, 2010

JON Agent installation

Prerequisite:
Install JRE6 Runtime environment
Download jre-6u18-linux-i586.bin from Sun website.
Copy to the install folder /opt
#./jre-6u18-linux-i586.bin
This should install JRE under directory jre1.6.0_18

1) Download agent from installed JON server
http://{ip_address}:7080/agentupdate/download
or Copy the file from JON Server location
/opt/jon-server-2.3.1.GA/jbossas/server/default/deploy/rhq.ear/rhq-downloads/rhq-agent/rhq-enterprise-agent-1.3.1.GA.jar

Save the file rhq-enterprise-agent-1.3.1.GA.jar to /opt/software on JBOSS server

2) Install agent
# cd /opt/software
#java -jar rhq-enterprise-agent-1.3.1.GA.jar --install=/opt

3) Setup agent configuration
Edit /opt/rhq-agent/conf/agent-configuration.xml

Update the following with correct JON server address
Uncomment the following lines and edit the values to read as:
<entry key="rhq.agent.configuration-setup-flag" value="true" />
<entry key="rhq.agent.server.bind-address" value="{jon-server-ip-address}" />
<entry key="rhq.agent.agent-update.version-url" value="http://{jon-server-ip-address}:7080/agentupdate/version" />
<entry key="rhq.agent.agent-update.download-url" value="http://{jon-server-ip-address}:7080/agentupdate/download" />
<entry key="rhq.agent.agent-update.version-url" value="http://{jon-agent-ip-address}:7080/agentupdate/version" />
<entry key="rhq.communications.connector.bind-address" value="{jon-agent-ip-address}" />

Optional line to uncomment.
<entry key="rhq.agent.name" value="{agent-name}"/>

Optional lines to uncomment. These two lines should be done together preferably and multicast should be supported by the network.
<entry key="rhq.agent.server-auto-detection" value="true" />
<entry key="rhq.communications.multicast-detector.enabled" value="true" />

cd /opt/rhq-agent/bin
./rhq-agent.sh --config ../conf/agent-configuration.xml

If the setup flag is enabled as above, check agent logs.
If the setup flag is not enabled as above, you will see the following:
Agent Name [agent-server-name] :
Agent Hostname or IP Address [!*] :
Agent Port [16163] :
RHQ Server Hostname or IP Address [jon-server-name] :
RHQ Server Port [7080] :

Leave the above values to default as you have already edited agent config.

3) Check agent.log for messages

4) Start or stop agent in background

/opt/rhq-agent/bin/rhq-agent-wrapper.sh start
/opt/rhq-agent/bin/rhq-agent-wrapper.sh stop

/opt/rhq-agent/bin/rhq-agent.sh start
/opt/rhq-agent/bin/rhq-agent.sh stop

5) Update /opt/rhq-agent/bin/rhq-agent-env.sh to run the process in foreground or background with desired parameters

Oracle Express Edition (XE) database installation

Oracle installation

1. Download Oracle 10g Express Edition free version (oracle-xe-univ-10.2.0.1-1.0.i386.rpm).
Oracle docs are available at http://www.oracle.com/pls/xe102/homepage

2. Set Tuning Parameters
Edit vi /etc/sysctl.conf and add the following tuning parameters
--------------------------------------------------
# Parameters for Oracle 10g XE database
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.shmall = 268435456
# SEMMSL, SEMMNS, SEMOPM, and SEMMNI
kernel.sem=250 32000 100 128
fs.file-max=65536
net.ipv4.ip_local_port_range=1024 65000
--------------------------------------------------

3. Installation
Copy oracle rpm to /opt/software/oracle-10g-express-universal
Login as root
#cd /opt/software/oracle-10g-express-universal
[root@bvaiiwq01 oracle-10g-express-universal]# rpm -ivh oracle-xe-univ-10.2.0.1-1.0.i386.rpm
Preparing... ########################################### [100%]
1:oracle-xe-univ ########################################### [100%]
Executing Post-install steps...
You must run '/etc/init.d/oracle-xe configure' as the root user to
configure the database.

[root@bvaiiwq01 oracle-10g-express-universal]# /etc/init.d/oracle-xe configure

Oracle Database 10g Express Edition Configuration
-------------------------------------------------
This will configure on-boot properties of Oracle Database 10g Express
Edition. The following questions will determine whether the database should
be starting upon system boot, the ports it will use, and the passwords that
will be used for database accounts. Press to accept the defaults.
Ctrl-C will abort.

Specify the HTTP port that will be used for Oracle Application Express [8080]:

Specify a port that will be used for the database listener [1521]:

Specify a password to be used for database accounts. Note that the same
password will be used for SYS and SYSTEM. Oracle recommends the use of
different passwords for each database account. This can be done after
initial configuration:
Confirm the password: oracle (or any password)

Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:y

Starting Oracle Net Listener...Done
Configuring Database...Done
Starting Oracle Database 10g Express Edition Instance...Done
Installation Completed Successfully.
To access the Database Home Page go to "http://{ip_address}:8080/apex"

4. Set Oracle environment parameters
cd /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin
. ./oracle_env.sh

5. Start the database
[root@bvaiiwq01 oracle-10g-express-universal]# /etc/init.d/oracle-xe start
Starting Oracle Database 10g Express Edition Instance.

6. Perform this step for providing remote web access console

[root@bvaiiwq01 client]# sqlplus system

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Mar 8 19:13:20 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Enter password:

Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);

PL/SQL procedure successfully completed.

7. Access the database web console
To access the Database Home Page go to "http://{ip_address}:8080/apex"
user: system password: oracle (password set during install)
user:sysdba password: oracle (password set during install)

Newer›  ‹Older