25 August 2005

The dynamic duo - mod_oc4j and OC4J

With the DP4 release, the mod_oc4j module in Oracle HTTP Server now uses a dynamic mapping approach to expose OC4J web applications.

In previous releases, each OC4J context-root that was to be exposed by OHS required a static entry to be made in the $ORACLE_HOME/Apache/Apache/conf/mod_oc4j.conf file.

Oc4jMount /path ajp13://duraace.au.oracle.com

With the new dynamic model in 10.1.3 , OC4J broadcasts the list of context-root mappings it has to OHS which enables OHS to expose them as they are received.

As OC4Js instances start and stop, or as applications are deployed/undeployed, the mount points are added or removed from OHS with no user intervention required.

This reduces the amount of configuration steps required to deploy applications, and makes the architecure more agile as the mapping changes are done on the fly and don't require the OHS process to be bounced.

You can still use static mount points if you wish, or a combination of both.

The routing mode can specified within the mod_oc4j.conf file. It can specify whether to use only dynamic routing, only the older style static style routing or to do both and default to either dynamic or static in the case of conflicts. By default Dynamic is used.

Oc4jRoutingMode Dynamic (which is the implicit default value)


Oc4jRoutingMode StaticOverride (allows any static bindings to take precedence)

Its possible to configure OHS so that it will display in a HTML page what its current list of mount points are when operating in dynamic mode.

To do this, open up the $ORACLE_HOME/Apache/Apache/conf/mod_oc4j.conf file and add the following bold text between the tags.

<IfModule mod_oc4j.c>
Oc4jSet StatusUri /oc4j-status
</IfModule mod_oc4j.c>

Restart OHS and then access the page using http://host:port/oc4j-status

The resulting page will list all of the mount points OHS currently has from the OC4J instances it is collaborating with.

mod_oc4j Global Configuration

hostname : duraace.au.oracle.com
local instance : 050823_http.duraace.au.oracle.com
select method : Round-Robin
select affinity : None
routing mode : Dynamic
routing ID : g_rt_id

OC4J Dynamic Routing

application : ascontrol
context : /em
process (Jgroup): 0

application : default
context : /jmsrouter, /j2ee
process (Jgroup): 0, 1

OC4J Process List

0 : duraace, 8888, ALIVE
1 : duraace, 8889, ALIVE

1 comment:

Anonymous said...

cool shit!