Sun Java System Application Server Enterprise Edition 8.1 2005Q2 High Availability Administration Guide

ProcedureTo set up RMI-IIOP load balancing for the Application Client Container

This procedure gives an overview of the steps necessary to use RMI-IIOP load balancing and failover with the application client container (ACC). For additional information on the ACC, see Developing Clients Using the ACC in Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Developer’s Guide.

  1. Go to the install_dir /bin directory.

  2. Run package-appclient.

    This utility produces an appclient.jar file. For more information on package-appclient, see package-appclient( 1M).

  3. Copy the appclient.jar file to the machine where you want your client and extract it.

  4. Edit the asenv.conf or asenv.bat path variables to refer to the correct directory values on that machine.

    The file is at appclient-install-dir /config/.

    For a list of the path variables to update, see package-appclient( 1M).

  5. If required, make the appclient script executable.

    For example, on UNIX use chmod 700.

  6. Find the IIOP listener port numbers for the instances in the cluster.

    Specify the IIOP listeners as endpoints to determine which IIOP listener receives the requests. To display the IIOP listeners in the Admin Console:

    1. In the Admin Console’s tree component, expand the Clusters node.

    2. Expand the cluster.

    3. Select an instance in the cluster.

    4. In the right pane, click the Properties tab.

      Note the IIOP listener port for the specific instance.

    5. Repeat the process for every instance.

  7. Edit sun-acc.xml for the endpoint values.

    Using the IIOP Listeners from the previous step, create endpoint values in the form:

    machine1:instance1–iiop-port, machine2:instance2–iiop-port

    For example:

    <property name="com.sun.appserv.iiop.endpoints" value=",,"\>

  8. Deploy your client application with the --retrieve option to get the client jar file.

    Keep the client jar file on the client machine.

    For example:

    asadmin deploy --user admin --passwordfile pw.txt --retrieve /my_dir myapp

  9. Run the application client as follows:

    appclient -client clientjar -name appname

Next Steps

To test failover, stop one instance in the cluster and see that the application functions normally. You can also have breakpoints (or sleeps) in your client application.

To test load balancing, use multiple clients and see how the load gets distributed among all endpoints.