Skip Headers
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g (10.1.3.5.0)

Part Number E13981-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

Configuring DNS Load Balancing

To use DNS load balancing, do the following:

  1. Within DNS, map a single host name to several IP addresses. Each of the port numbers must be the same for each IP address. Set up the DNS server to return the addresses either in a round-robin or random fashion.

    The IP address identifies the OC4J running; the port number is an RMI port number.

  2. Turn off DNS caching on the client. For UNIX machines, you must turn off DNS caching as follows:

    1. Kill the NSCD daemon process on the client.

    2. Start the OC4J client with the -Dsun.net.inetaddr.ttl=0 option.

  3. Within each client, configure JNDI properties as follows (see "Using JNDI Properties"):

    • For java.naming.factory.initial, use any initial context factory.

    • For the java.naming.provider.url, provide single host name to which the OC4J IP addresses are mapped and the common RMI port in the form <prefix>://<hostname>:<port>/<application-name> where <prefix> is opmn:ormi for OC4J in Oracle Application Server or ormi for OC4J standalone.

  4. Configure load balancing behavior (see "Configuring Load Balancing Behavior").

Each time the lookup occurs on the DNS server, the DNS server hands back one of the many IP addresses that are mapped to it.

For more information, see the following:

Using JNDI Properties

In Example 24-3, the initial context factory is RMIInitialContextFactory (however, you can use any initial context factory for DNS load balancing), myserver is the host name set up in the DNS server for the list of servers, and the RMI port is the default port.

Example 24-3 JNDI Properties for DNS Load Balancing

java.naming.factory.initial= oracle.j2ee.rmi.RMIInitialContextFactory
java.naming.provider.url=ormi://myserver/applname
java.naming.security.principal=admin
java.naming.security.credentials=welcome