OpenLDAP : Replication2025/09/05 |
|
Configure OpenLDAP Replication to continue Directory service if OpenLDAP master server would be down. |
|
| [1] |
Configure Basic LDAP Server settings on both Provider and Consumer, refer to here. |
| [2] | Configure LDAP Provider. Add syncprov module. |
|
root@dlp:~#
vi mod_syncprov.ldif # create new
dn: cn=module,cn=config
objectClass: olcModuleList
cn: module
olcModulePath: /usr/lib/ldap
olcModuleLoad: syncprov.la
dn: olcOverlay=syncprov,olcDatabase={1}mdb,cn=config
objectClass: olcOverlayConfig
objectClass: olcSyncProvConfig
olcOverlay: syncprov
olcSpSessionLog: 100
ldapadd -Y EXTERNAL -H ldapi:/// -f mod_syncprov.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=module,cn=config"
adding new entry "olcOverlay=syncprov,olcDatabase={1}mdb,cn=config"
|
| [3] | Configure LDAP Consumer. |
|
root@node01:~#
vi syncrepl.ldif # create new
dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcSyncRepl
olcSyncRepl: rid=001
# LDAP server's URI
provider=ldap://dlp.srv.world:389/
bindmethod=simple
# your domain suffix
binddn="cn=admin,dc=srv,dc=world"
# directory manager's password
credentials=password
searchbase="dc=srv,dc=world"
# includes subtree
scope=sub
schemachecking=on
type=refreshAndPersist
# [retry interval] [retry times] [interval of re-retry] [re-retry times]
retry="30 5 300 3"
# replication interval
interval=00:00:05:00
ldapadd -Y EXTERNAL -H ldapi:/// -f syncrepl.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "olcDatabase={1}mdb,cn=config"
# confirm settings to search data root@node01:~# ldapsearch -x -b 'ou=people,dc=srv,dc=world' # extended LDIF # # LDAPv3 # base <ou=people,dc=srv,dc=world> with scope subtree # filter: (objectclass=*) # requesting: ALL # # people, srv.world dn: ou=people,dc=srv,dc=world objectClass: organizationalUnit ou: people # debian, people, srv.world dn: uid=debian,ou=people,dc=srv,dc=world objectClass: inetOrgPerson objectClass: posixAccount objectClass: shadowAccount sn: debian givenName: debian cn: debian displayName: debian uidNumber: 1000 gidNumber: 1000 gecos: debian loginShell: /bin/bash homeDirectory: /home/debian shadowExpire: -1 shadowFlag: 0 shadowWarning: 7 shadowMin: 0 shadowMax: 99999 shadowLastChange: 20310 uid: debian ..... ..... |
| [4] | Configure LDAP Client to bind LDAP Consumer, too. |
|
root@client:~#
vi /etc/nslcd.conf # line 10 : add LDAP Consumer uri ldap://dlp.srv.world/ ldap://node01.srv.world/
systemctl restart nslcd |
| Sponsored Link |
|
|