Load Balance and Redundant LDAP config

Michael Ströder michael at stroeder.com
Fri Apr 1 08:45:04 CEST 2011


Bob Brandt wrote:
> I apologize if this is not the right place to ask this question...

You're welcome to discuss this here.

> I am looking to modify my LDAP scripts to be both Redundant and Load
> Balancing!

Although both things are mixed all the time these are two different goals.

> Right now, I have a script that has a list of LDAP servers and uses the
> first one that responses, but the problem is all later requests, use
> that single LDAP server. If that server were to fail, the script fails.

A simple solution would be to try to connect to a random LDAP server within
the list and catch ldap.SERVER_DOWN to reconnect. You could have a look at
ldap.ldapobject.ReconnectLDAPObject.reconnect() to get an idea how to do that
automatically when serving sychronous calls.

Feel free to provide an extension for ReconnectLDAPObject which deals with
more than one server.

If you're using the async methods your application has to deal with it.

Ciao, Michael.


More information about the python-ldap mailing list