Skip Headers
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g Release 3 (10.1.3)
B14428-01
  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
 

Configuring DNS Load Balancing

To use DNS load balancing:

  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, use the ormi:// prefix, the single host name to which the OC4J IP addresses are mapped, and the common RMI port.

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 "DNS Load Balancing".

Using JNDI Properties

In Example 24-5, 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-5 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