SHARE
Facebook X Pinterest WhatsApp

LDAP Master Server Problems

Written By
thumbnail Juliet Kemp
Juliet Kemp
Jul 20, 2010
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



Juliet Kemp

LDAP allows you to have a master+slave server setup, with automatic failover in case of problems or just to spread the load. This has obvious advantages, but it can hide problems with the master server.

Tip of the Trade: Finding and fixing master server issues isn’t always easy, especially when the slave servers seem to be working fine. With careful searching, ldapsearch handily resolves issues.

If your master server is down but the slaves are OK, ldapsearch and other lookups will work fine. But if you try to modify the database (e.g., with ldapadd), you’ll get this kind of error message:

ldap_add: Referral (10)
	referrals:
		ldaps://masterldap.example.com/uid=test,ou=People,
dc=example,dc=com

Slave servers can’t modify the database, so it tries to redirect to the master, and fails. If you now use ldapsearch to look for your new entry, you will not find it.

Recent Tips
» perltidy
» IPTraf
» PAM

Read All Tips of the Trade

You can confirm the diagnosis by trying: ldapsearch -H ldaps://masterldap.example.com to force a bind to the master server.

The next stage is to find out what’s causing the problem. Set the loglevel in /etc/ldap/slapd.conf to 1, then restart slapd and check the logs.

Two common problems:

  • An old slapd process that hasn’t been killed off properly. Check with ps and kill it if necessary.
  • An alockproblem, which looks like this in the log:
    	slapd[27069]: bdb_db_open: alock package is unstable 
    	slapd[27069]: backend_startup_one: bi_db_open failed! (-1) 
    	

    To resolve, remove the /var/lib/ldap/alock file (or check your slapd.conf for your local data directory). Run db_recover to fix the database, or just restart slapd and it should recover itself. You may need to give it a little time or restart it again.

Remember to return the loglevel to normal afterward, or the server will be very slow. Also, consider using monitoring software to catch these silent problems!

thumbnail Juliet Kemp

Juliet Kemp is a ServerWatch contributor.

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
What Is a Network Policy Server (NPS)? | Essential Guide
Virtual Servers vs. Physical Servers: Comparison and Use Cases
Ray Fernandez
Nov 14, 2023
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.