Subject: JNDI Failover behavior
Author: JNDI
Posted on: 11/02/2011 05:27:40 PM
If you set the java.naming.provider.url to a list of LDAP servers:
env.put(Context.PROVIDER_URL, "ldap://server1:389/ ldap://server2:389/");
then each connection is attempted in turn until a single connection is successfully established.
The question is: What happens if the dropped connection come back:
Testing scenarios:
Stage #1: primary server(1) is up + sencondary server(2) is up
Stage #2: primary server(1) is down + sencondary server(2) is up
Stage #3: primary server(1) is up + sencondary server(2) is up
Test results:
Stage #1: client connection goes to the primary server(1)
Stage #2: client connection goes to the secondary server(2)
Stage #3: client connection goes back to the primary server(1) again.
Replies:
References: