SLES 12
Sponsored Link

OpenLDAP Replication2015/12/01

 
Configure OpenLDAP Replication to continue Directory service if OpenLDAP master server would be down. OpenLDAP master server is called "Provider" and OpenLDAP Slave server is called "Consumer" on OpenLDAP.
[1]
[2] Configure LDAP Provider. Add syncprov module.
dlp:~ #
vi mod_syncprov.ldif
# create new

dn: cn=module,cn=config
objectClass: olcModuleList
cn: module
olcModulePath: /usr/lib/openldap
olcModuleLoad: syncprov.la

dlp:~ #
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"

dlp:~ #
vi syncprov.ldif
# create new

dn: olcOverlay=syncprov,olcDatabase={1}hdb,cn=config
objectClass: olcOverlayConfig
objectClass: olcSyncProvConfig
olcOverlay: syncprov
olcSpSessionLog: 100

dlp:~ #
ldapadd -Y EXTERNAL -H ldapi:/// -f syncprov.ldif

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "olcOverlay=syncprov,olcDatabase={1}hdb,cn=config"
[3] Configure LDAP Consumer.
node01:~ #
vi syncrepl.ldif
# create new

dn: olcDatabase={1}hdb,cn=config
changetype: modify
add: olcSyncRepl
olcSyncRepl: rid=001
 
# LDAP server's URI

  provider=ldap://10.0.0.30:389/
  bindmethod=simple
 
# own domain name

  binddn="cn=Manager,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

node01:~ #
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}hdb,cn=config"

# verify settings to search datas

node01:~ #
ldapsearch -x -b 'ou=People,dc=srv,dc=world'

# People, srv.world
dn: ou=People,dc=srv,dc=world
objectClass: organizationalUnit
ou: People
...
...
[4] Configure LDAP Client to bind LDAP Consumer, too.
www:~ #
vi /etc/sssd/sssd.conf
# add consumer's URI in [domain/default] section

[domain/default]
ldap_uri = ldap://node01.srv.world
www:~ #
systemctl restart nscd sssd

Matched Content