Skip Headers
Oracle® Application Server Wireless Administrator's Guide
10g Release 2 (10.1.2)
B13820-02
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

14 Load Balancing and Failover

This chapter, through the following sections, discusses Oracle Application Server Wireless load balancing and failover.

14.1 Overview of Load Balancing and Failover

OracleAS Wireless offers a scalable, reliable server infrastructure through clustering and high availability. The clustering structure includes the following two features.

14.2 Clustering Architecture

Each OracleAS Wireless Server process which runs on a single Java Virtual Machine (JVM) is referred to as a node. One or more nodes comprise an island. Nodes within an island are capable of serving the same applications, because the session for each client is replicated among all the nodes within an island in preparation of failover. One or more islands together form an OC4J (OracleAS Containers for J2EE) instance for the purpose of load balancing. The entire OC4J instance is linked by mod_oc4j to a simple front-end, Oracle HTTP Server (OHS). Typically, an island has two to four nodes.

By default, the requests from the same client are always redirected to the same OracleAS Wireless Server process. If one process goes down, then the fault tolerance feature is supported for both stateful and stateless requests as follows:

14.3 Clustering Configuration

This section describes how to configure the Oracle HTTP Server (OHS), Oracle Process Management and Notification (OPMN), and OracleAS Containers for J2EE (OC4J).

14.3.1 Configuring Oracle HTTP Server (OHS)

The configuration file for OHS is httpd.conf, which includes mod_oc4j.conf, located in the ORACLE_HOME/Apache/Apache/conf/ directory. Example 14-1 illustrates how the mounting point from the HTTP request to the OracleAS Wireless Server clustering instance is specified in mod_oc4j.conf.

Example 14-1 mod_oc4j.conf

LoadModule oc4j_module libexec/mod_oc4j.so
<IfModule mod_oc4j.c>
Oc4jMount /ptg OC4J_Wireless
Oc4jMount /ptg/* OC4J_Wireless
Oc4jMount /mcs OC4J_Wireless
Oc4jMount /mcs/* OC4J_Wireless
Oc4jMount /mcs/media OC4J_Wireless
Oc4jMount /mcs/media/* OC4J_Wireless
</IfModule>

When installing the OracleAS Wireless Server from Oracle Universal Installer (OUI), these lines should be automatically populated in the mod_oc4j.conf file.

14.3.2 Configuring Oracle Process Management and Notification (OPMN)

The major configuration file for OPMN is opmn.xml, located in the ORACLE_HOME/opmn/conf/directory. The definition for the process-type Id for oc4j_wireless in opmn.xml should be the exactly same as it appears in the mounting specification of the mod_oc4j.conf (Example 14-1). The number of islands, the number of processes, and the other configuration parameters are also defined within opmn.xml. Example 14-2 illustrates a sample configuration.

Example 14-2 Sample Configurations of Islands and Processes for opnm.xml

<ias-component id="wireless" status="enabled">
    <process-type id="OC4J_Wireless" module-id="OC4J">
       <environment>
       ...
       </environment>
       <module-data>
          <category id="start-parameters">
          ...
          </category>
       </module-data>
       ...
       <port id="ajp" range="3301-3400"/>
       <port id="rmi" range="3201-3300"/>
       <port id="jms" range="3701-3800"/>
       <process-set id="OC4J_WirelessIslandA" numprocs="2"/>
       <process-set id="OC4J_WirelessIslandB" numprocs="3"/>
    </process-type>
 </ias-component>

For this OC4J_Wireless cluster, two islands (OC4J_WirelessIslandA and OC4J_WirelessIslandB) share the request workload. OC4J_WirelessIslandA is comprised of two wireless server processes while OC4J_WirelessIslandB is comprised of three OracleAS Wireless Server processes. Altogether, five ports are needed for each type of protocol. The port number range is from the base-port number to the base-port number plus five. The base-port numbers are dynamically allocated during the installation time.

By default, the OracleAS Wireless Server <process-set> element should be populated within opmn.xml. However, the populated entry only supports a single OracleAS Wireless Server process and thus is not suitable for load balancing and failover. The configuration for load balancing and failover must be manually added.

14.3.3 Configuring OC4J

The OC4J-related configuration files are located in ORACLE_HOME/j2ee/OC4J_Wireless/config directory. The default configuration is set for running single OracleAS Wireless Server process.

To support load balancing and failover features, you must modify the OC4J configuration files orion-web.xml and /WEB-INF/web.xml as described in the following steps.

  1. Modify orion-web.xml.

    There are two orion-web.xml files, one for Multi-Channel server and one for the wireless mcs applications. They are located in the following directories:

    • ORACLE_HOME/j2ee/OC4J_Wireless/application-deployments/ptg/ptg-web/

    • ORACLE_HOME/j2ee/OC4J_Wireless/application-deployments/mcs/mcs-web/

    For both of these files, add <cluster-config /> to the main body of the <orion-web-app> tag.

  2. Modify /WEB-INF/web.xml

    There are two web.xml files, one for OracleAS Wireless web server and one for the mcs modules. They are located in the following directories:

    • ORACLE_HOME/j2ee/OC4J_Wireless /applications/ptg/ptg-web/WEB-INF/

    • ORACLE_HOME/j2ee/ OC4J_Wireless /applications/mcs/mcs-web/WEB-INF/

    For both of these files, add the <distributable /> tag to the main body of <web-app>

14.4 Configuring OracleAS Wireless for High-Availability Deployment

In Oracle Application Server 10g Release 2 (10.1.2.02), OracleAS Wireless applications cannot be clustered using the Oracle9iAS clustering mechanism. However, you can configure Oracle Application Server 10g Release 2 (10.1.2.02) to achieve a high-availability deployment by completing the following steps.


Note:

You must back up all files before you modify them.

  1. Install the Oracle Application Server 10g Release 2 (10.1.2.02) infrastructure tier on one machine and install multiple middle tiers on separate machines. Ensure that each of these middle-tier installations point to the infrastructure tier.

  2. Shut down DCM and all of process by running the command

    [oracle home]/dcm/bin/dcmctl stop

  3. Shut down Oracle Enterprise Manager (OEM) using the command

    [oracle home]/bin/emctl stop

  4. Verify that the file [oracle home]/opmn/conf/ons.conf exists on each of the mid-tiers. Verify that the infrastructure tier contains IP-address entries for all the other tiers. If not, file and add missing IP-address entries.

  5. On each middle tier, increase the number of processes that need to participate in the default island for the OC4J_Wireless OC4J instance to the desired number. This can be done from the Oracle Enterprise Manager Application Server Control or by modifying the file:

    [oracle home]/opmn/conf/opmn.xml.

    For details and concepts of OC4J instance and OC4J islands, refer to Oracle Application Server Containers for J2EE Services Guide

  6. In the mod_oc4j configuration file for each middle-tier (that is, [oracle home]/Apache/Apache/conf/mod_oc4j.conf), modify the mount-point entries for the OracleAS Wireless runtime. These entries should be of the form illustrated in Example 14-3 and must be the same for all middle- tier machines.

    Example 14-3 Mount-Point Entries in mod_oc4j.conf

    Oc4jMount /ptg instance://c.host4CPU.mysite.com:OC4J_Wireless, c.host2CPU.mysite.com:OC4J_Wireless 
    
    Oc4jMount /ptg/* instance://c.host4CPU.mysite.com:OC4J_Wireless, c.host2CPU.mysite.com:OC4J_Wireless 
    
    Oc4jMount /mcs instance://c.host4CPU.mysite.com:OC4J_Wireless, c.host2CPU.mysite.com:OC4J_Wireless
    
    Oc4jMount /mcs/* instance://c.host4CPU.mysite.com:OC4J_Wireless,c.host2CPU.mysite.com:OC4J_Wireless 
    
    Oc4jMount /mcs/media instance://c.host4CPU.mysite.com:OC4J_Wireless,c.host2CPU.mysite.com:OC4J_Wireless 
    
    Oc4jMount /mcs/media/* instance://c.host4CPU.mysite.com:OC4J_Wireless,c.host2CPU.mysite.com:OC4J_Wireless 
    
    Oc4jSelectMethod roundrobin:weighted
    Oc4jRoutingWeight host4CPU.mysite.com 2
    Oc4jRoutingWeight host2CPU.mysite.com 1
    
    

    Note:

    In Example 14-3, c represents the instance name.

  7. Run [oracle home]/dcm/bin/dcmctl updateConfig to update the DCM repository with the configuration file changes.

    On slow machines, a DCM error (timeout) of the form ADMN-906005 may appear. If this occurs, run the command [oracle home]/dcm/bin/dcmctl getReturnStatus and wait until the command exits. This confirms that the changes have been propagated to the DCM repository.

  8. Add the <cluster-config/> tag under the <orion-web-app> tag in [oracle home]/j2ee/OC4J_wireless/application-deployments/ptg/ptg-web/orion-web.xml.

  9. Start DCM and all processes by running the command

    [oracle home]/dcm/bin/dcmctl start.

  10. Start Enterprise Manager by running the command

    [oracle home]/bin/emctl start

  11. Configure a hardware load-balancer to point to the middle-tiers.

Currently, high-availability support is only available for the core server runtime (by default mapped to the URI /ptg/rm).

For more information, refer to the Oracle Application Server Containers for J2EE User's Guide .