openldap数据双向同步
配置双主复制功能,在主1和主2上执行均下面的步骤
vim syncprov_mod.ldif
dn: cn=module,cn=config
objectclass: olcmodulelist
cn: module
olcmodulepath: /usr/lib64/openldap
olcmoduleload: syncprov.la
ldapadd -y external -h ldapi:/// -f syncprov_mod.ldif
vim configrep.ldif
dn: cn=config
changetype: modify
replace: olcserverid
olcserverid: 1 ldap://openldap-01:389
olcserverid: 2 ldap://openldap-02:389
dn: olcdatabase={2}hdb,cn=config
changetype: modify
add: olcsyncrepl
olcsyncrepl: rid=001
provider=ldap://openldap-02:389
binddn="cn=manager,dc=jackcui,dc=com"
bindmethod=simple
credentials=密码
searchbase="dc=jackcui,dc=com"
type=refreshandpersist
retry="5 5 300 5"
timeout=1
olcsyncrepl: rid=002
provider=ldap://openldap-02:389
binddn="cn=manager,dc=jackcui,dc=com"
bindmethod=simple
credentials=密码
searchbase="dc=jackcui,dc=com"
type=refreshandpersist
retry="5 5 300 5"
timeout=1
add: olcmirrormode
olcmirrormode: true
dn: olcoverlay=syncprov,olcdatabase={2}hdb,cn=config
changetype: add
objectclass: olcoverlayconfig
objectclass: olcsyncprovconfig
olcoverlay: syncprov
ldapmodify -y external -h ldapi:/// -f configrep.ldif