|
Problem(Abstract) |
When using a DNS load balancer or IP failover, the web
service clients cache DNS addresses. (I would copy the paragraph "The
customer may see a wide variety of exceptions..." here. Also are there
WSWS messages that may be observed?) (Another question, is this only
applicable to Windows®? Your list of OS's only lists Windows.) |
|
|
|
Cause |
The caching of DNS addresses actually happens at the JVM
level. By default, DNS addresses are cached forever in the JVM.
Consider the following scenario. A Web service client is programmed to
send traffic to http://www.myhost.com. The DNS entry www.myhost.com maps
to two IP addresses: 192.168.1.1 and 192.168.1.2. Here is what happens
when the Web service client invokes the service:
- Web service client does a DNS lookup on "www.myhost.com."
- DNS server returns "192.168.1.1" for "www.myhost.com."
- The JVM caches this. The JVM has a cache that associates
"www.myhost.com" with "192.168.1.1."
- For every invocation onwards, the Web service client will not lookup
"www.myhost.com" from the DNS server. It will always assume that it is
"192.168.1.1."
The customer can see a wide variety of exceptions related to this. Some
examples are:
java.net.ConnectException: A remote host refused an
attempted connect operation
java.io.IOException: Connection reset by
peer
|
|
|
Resolving the
problem |
You can set a parameter to give a refresh rate for this
cache:
sun.net.inetaddr.ttl=time_in_seconds
After the specified number of seconds has passed, the cache is refreshed
and picks up any changes made to the DNS, so an application can go to the
correct IP.
Add this parameter as a command line property by preceding it with a "-D"
on the Application Server running the application in question.
For WebSphere® Application Server V5.0, V5.1 and V6.0 releases:
Application Servers > Server name > Process
Definition > Java™ Virtual Machine > Generic JVM
Arguments
Refer to the Sun documentation regarding
these properties under the Related information section for additional
information.
|
|
|
|