Sun Java logo     Previous      Contents      Index      Next     

Sun logo
Sun Java System Application Server Standard and Enterprise Edition 7 2004Q2 Update 3 Administration Guide 

Chapter 18
Configuring RMI/IIOP Load Balancing and Failover (Enterprise Edition)

This chapter describes how to setup load balancing and failover of RMI-IIOP requests.

This chapter includes the following topics:


About RMI/IIOP Load Balancing and Failover

Sun Java™ System Application Server provides high availability of remote EJB references and name service objects over RMI-IIOP.

This section discusses the following topics:

Requirements for Load Balancing and Failover

The following section lists the requirements for setting up load balancing and failover over RMI/IIOP:

About RMI/IIOP Load Balancing and Failover Algorithm

High availability is achieved by enabling RMI/IIOP clients for load balancing and configuring the Application Server for failover of remote references.

The configuration settings required to enable RMI/IIOP based applications depends on the type of client. For detailed information on setting up various RMI/IIOP clients for load balancing, see Sun Java System Application Server 7 Developer’s Guide to Clients.

Load balancing is supported for the following RMI/IIOP clients.

Initial Context Based Failover Algorithm

Sun Java System Application Server Enterprise Edition 7 employs InitialContext based algorithm for load balancing and failover of remote references of EJBs and name service objects on the RMI/IIOP path.

When a RMI/IIOP client invokes an InitialContext lookup on a remote object, an Application Server instance (which is part of the IIOP Cluster) is randomly chosen to create the bean. One of the available IIOP endpoints (on the server instance selected in the IIOP cluster) is designated as the primary endpoint. The other IIOP endpoints in the cluster are designated as alternate endpoints.

The name service object used to create the InitialContext is then used to service all subsequent requests with the same InitialContext. Subsequent operations with this InitialContext will be assigned or stuck to the same Application Server instance.

If the primary endpoint corresponding to the remote reference becomes unavailable, further operations corresponding to this remote reference is failed over to one of the alternate endpoints.


Note

If an Application Server instance becomes unavailable while processing RMI/IIOP requests, that request will not be retried or failed over to another Application Server instance.



Configuring RMI/IIOP Failover

To configure high availability over RMI/IIOP, each Application Server instance needs to be configured with the available IIOP listeners that’s used for serving RMI-IIOP requests. The IIOP cluster configuration information is registered in server.xml.

For detailed information on configuring RMI/IIOP clients for load balancing, see Sun Java System Application Server 7 Developer’s Guide to Clients.


Note

Only IIOP listeners, configured under the ORB tab of the Admin Console, can be configured as IIOP endpoints.


Setting up a cluster and assigning endpoints can be performed from both the administration interface and command line. The user, via the Administration CLI or the GUI, changes the server.xml to define IIOP endpoints that will constitute the cluster of Application Server instances.

For details on using the administration console and the command line tool, asadmin, see the help associated with those tools.

The following topics are discussed in this section:

Using Admin Console to Configure RMI/IIOP Load Balancing

  1. In the left pane of the Administration Console, select Availability Service.
  2. Expand the Availability Service node.
  3. The right pane displays options to create and add Application Server instances to a IIOP cluster.

  4. Click New.
  5. The Administration console displays a page where you can specify the properties for a new IIOP Server instance (which is in-effect, the Application Server instance). Each IIOP server instance can have multiple IIOP endpoints.

    The default IIOP Server Instance name is the same as the Application Server instance’s name.

    1. Enter the IIOP Server Instance Name.
    2. This is the name of the Application Server instance that will be part of the IIOP cluster. For example, server2. In server.xml the IIOP Server Instance Name is identified by the property iiop-server-instance.

    3. Enter the ID of the IIOP Endpoint at which the ORB listens for IIOP connections.
    4. The IIOP Endpoint is an IIOP Listener that will be part of the IIOP Cluster. For example, orb-listener-2.


      Note

      The IIOP Endpoint specified must also exist as an IIOP Listener for the ORB. If you add an endpoint on this page, you must add it as a listener for the ORB, if it has not been added already.


      In server.xml, the IIOP endpoint that will be part of the IIOP Cluster is identified by the property iiop-endpoint-id.

    5. Enter the host ID of the Application Server instance.
    6. The host ID is the name of the machine on which the Application Server is installed, and which hosts the iiop-endpoint. For example, machine1.sun.com.

      In server.xml, the IIOP Endpoint is identified by the property iiop-endpoint-host.

    7. Enter the port number of the iiop-endpoint.
    8. This is a valid ORB listener port for the IIOP Endpoint. For example, 3700. This is an optional field. If it is left blank, the Application Server will assign a valid port number.

      In server.xml, the IIOP Endpoint port number is identified by the property iiop-endpoint-port.

  6. Click OK to add this IIOP Server Instance to the IIOP cluster.
  7. Select Apply Changes and restart the Application Server instance for the changes to take effect.
  8. Using the same procedure add more IIOP server instances to the IIOP cluster, depending on the requirements of your applications.

Using CLI to Configure RMI/IIOP Load Balancing

Use the following commands to set up IIOP Endpoints and Clusters from the command line:

For detailed information on these commands and how to use them, consult the online help.


Sample server.xml Configuration

The sun-server_1_2.dtd has been modified to include an iiop-cluster element under the availability-service element. The iiop-cluster element defines the IIOP Endpoints of Application Server instances forming the IIOP cluster. When you configure an IIOP Cluster, either through the Admin Console or the CLI, the changes are registered in the iiop-cluster element in server.xml.

Sample availability-service Configuration in server.xml

<availability-service availability-enabled=”true”>

<iiop-cluster>

<iiop-server-instance name="server1">

<iiop-endpoint id="orb-listener-1" host="machine1.sun.com" port="3700"/>

<iiop-endpoint id="orb-listener-2” host="machine2.sun.com" port="3800"/>

</iiop-server-instance>

<iiop-server-instance name="server2">

<iiop-endpoint id="orb-listener-3" host="machine3.sun.com" port="3900"/>

<iiop-endpoint id="orb-listener-4" host="machine4.sun.com" port="4000"/>

</iiop-server-instance>

</iiop-cluster>

</availability-service>



Previous      Contents      Index      Next     


Copyright 2005 Sun Microsystems, Inc. All rights reserved.