Rocky_Linux_8
Sponsored Link

OpenLDAP : Multi-Master Replication2021/08/05

 
Configure OpenLDAP Multi-Master Replication.
For the Settings of Provider/Consumer, Consumer Hosts are read only servers, however if configure Multi-Master Settings, it's possbile to add data on any Master servers.
[1]
[2] Configureon [syncprov] module on all servers.
[root@dlp ~]#
vi mod_syncprov.ldif
# create new

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

[root@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"

[root@dlp ~]#
vi syncprov.ldif
# create new

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

[root@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={2}mdb,cn=config"
[3] Configure Multi-Master settings on all servers.
For parameters [olcServerID] and [provider=***], specify uniq value on each server.
[root@dlp ~]#
vi master01.ldif
# create new

dn: cn=config
changetype: modify
replace: olcServerID
# specify uniq ID number on each server
olcServerID: 100

dn: olcDatabase={2}mdb,cn=config
changetype: modify
add: olcSyncRepl
olcSyncRepl: rid=001
  # specify another LDAP server's URI
  provider=ldap://10.0.0.52:389/
  bindmethod=simple
  # domain name suffix
  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
-
add: olcMirrorMode
olcMirrorMode: TRUE

dn: olcOverlay=syncprov,olcDatabase={2}mdb,cn=config
changetype: add
objectClass: olcOverlayConfig
objectClass: olcSyncProvConfig
olcOverlay: syncprov

[root@dlp ~]#
ldapmodify -Y EXTERNAL -H ldapi:/// -f master01.ldif

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "cn=config"

modifying entry "olcDatabase={2}mdb,cn=config"

adding new entry "olcOverlay=syncprov,olcDatabase={2}mdb,cn=config"
[4] Configure LDAP Client to bind all LDAP server.
[root@client ~]#
vi /etc/openldap/ldap.conf
# add additional LDAP server

URI ldap://dlp.srv.world/
ldap://node02.srv.world/
[root@client ~]#
vi /etc/sssd/sssd.conf
# add additional LDAP server

ldap_uri = ldap://dlp.srv.world/
,ldap://node02.srv.world/
[root@client ~]#
systemctl restart sssd
Matched Content