OpenLDAP

From Mosuma
Jump to: navigation, search

Slave refuses to replicate/update from Master

If a slave OpenLDAP server is *suddenly* (no configuration has changed) refusing to update itself due to a failed connection to the master OpenLDAP server (e.g., master server rebooted), reporting errors like:

# /var/log/syslog
Apr  9 09:13:48 daqiao slapd[32518]: do_syncrep2: rid=002 (-1) Can't contact LDAP server
Apr  9 09:13:48 daqiao slapd[32518]: do_syncrepl: rid=002 rc -1 retrying (9 retries left)
Apr  9 09:15:51 daqiao slapd[32518]: do_syncrepl: rid=002 rc -1 retrying (8 retries left)

and if restarting the slave slapd does not make it sync, you can resort to the final method below:


On the slave:

/etc/init.d/slapd stop
mv /var/lib/ldap /var/lib/ldap.old
mkdir /var/lib/ldap
cp /var/lib/ldap.old/DB_CONFIG /var/lib/ldap
chown openldap.openldap /var/lib/ldap # may need to use uid/gid if your group info is based on the stopped openldap
/etc/init.d/slapd start

The slave ldap will now have a brand new replicated db refreshed from the master.