변군이글루

[LDAP] OpenLDAP 이중화 구성(syncrepl) 본문

* 리눅스

[LDAP] OpenLDAP 이중화 구성(syncrepl)

변군 변군이글루 2021. 9. 6. 09:01
728x90

OpenLDAP 이중화 구성(마스터-슬레이브 구성)

OpenLDAP 설치 및 구성

 : https://anti1346.tistory.com/1014

마스터 구성

replicator.ldif 편집

$ cat replicator.ldif
dn: uid=replicator,dc=4wxyz,dc=com
uid: replicator
objectclass: account
objectClass: simpleSecurityObject
description: Replication User
userPassword: qwER12#$

###
# ldapadd -x -D cn=Manager,dc=4wxyz,dc=com -w password1! -f replicator.ldif
$ ldapadd -x -D cn=Manager,dc=4wxyz,dc=com -w password1! -f replicator.ldif

syncprov-module.ldif 편집

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

###
# ldapadd -Y EXTERNAL -H ldapi:/// -f syncprov-module.ldif
$ ldapadd -Y EXTERNAL -H ldapi:/// -f syncprov-module.ldif

syncprov.ldif 편집

$ cat syncprov.ldif
dn: olcOverlay=syncprov,olcDatabase={2}hdb,cn=config
objectClass: olcOverlayConfig
objectClass: olcSyncProvConfig
olcOverlay: syncprov
olcSpSessionLog: 100

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

슬레이브 구성

replication.ldif 편집

$ vim replication.ldif
dn: olcDatabase={2}hdb,cn=config
changetype: modify
add: olcSyncRepl
olcSyncRepl: rid=300
  provider=ldap://192.168.50.201:389/
  bindmethod=simple
  binddn="uid=replicator,dc=4wxyz,dc=com"
  credentials=qwER12#$
  searchbase="dc=4wxyz,dc=com"
  scope=sub
  schemachecking=on
  type=refreshAndPersist
  retry="30 5 300 3"
  interval=00:00:05:00

###
# ldapadd -Y EXTERNAL -H ldapi:/// -f replication.ldif
$ ldapadd -Y EXTERNAL -H ldapi:/// -f replication.ldif
728x90
0 Comments
댓글쓰기 폼