OpenLDAP 的 cn=config 未完全复制

OpenLDAP 的 cn=config 未完全复制

我有 OpenLDAP 2.4.39 主服务器和只读副本,使用cn=configaka“OLC”配置(与旧方法相反slapd.conf)。

复制适用于数据(用户帐户等),但不适用于配置 - 当我使用更改主服务器上的配置时ldapmodify,例如在dn: cn=config副本中注意到更改并更新contextCSN: ...时间戳,/etc/openldap/slapd.d/cn=config.ldif但不接受更改的数据。例如通过更改olcGentleHUP: ...属性进行测试。

在主服务器上,记录与时间戳一起更新olcGentleHUP: ...,在副本上,仅将时间戳更新为与主服务器上完全相同的值。/etc/openldap/slapd.d/cn=config.ldifcontextCSN: ...contextCSN: ...

知道这是怎么回事吗?我该如何调试它?

更新(2015 年 2 月 7 日)

事实证明我们searchbase="cn=schema,cn=config"olcSyncrepl奴隶的设置中。将其更改为searchbase="cn=config"现在整个配置已同步。

答案1

olcDatabase={0}config,cn=config除了 中的数据之外,您是否还为 OLC 设置了复制oldDatabase={1}hdb,cn=config?基本上,cn=config复制需要特殊的引导程序手册中解释了

我的工作配置(在镜像模式下)如下所示:

dn: olcDatabase={0}config,cn=config
objectClass: olcDatabaseConfig
olcDatabase: {0}config
olcAccess: {0}to * by dn.exact=gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth manage by * break
olcRootDN: cn=config
olcRootPW:: hogehogehogehoge==
olcSyncrepl: {0}rid=001 provider=ldap://server1/ starttls=critical tls_reqcert=demand bindmethod=simple binddn="cn=config" credentials=secret searchbase="cn=config" type=refreshAndPersist retry="5 5 300 5" timeout=1
olcSyncrepl: {1}rid=002 provider=ldap://server2/ starttls=critical tls_reqcert=demand bindmethod=simple binddn="cn=config" credentials=secret searchbase="cn=config" type=refreshAndPersist retry="5 5 300 5" timeout=1
olcMirrorMode: TRUE

dn: olcOverlay={0}syncprov,olcDatabase={0}config,cn=config
objectClass: olcOverlayConfig
objectClass: olcSyncProvConfig
olcOverlay: {0}syncprov

dn: olcDatabase={1}hdb,cn=config
objectClass: olcDatabaseConfig
objectClass: olcHdbConfig
olcDatabase: {1}hdb
olcDbDirectory: /var/lib/ldap
olcSuffix: dc=your,dc=domain
olcAccess: {0}to attrs=userPassword,shadowLastChange by self write by anonymous auth by .... read by .... write by dn="cn=config" read
olcAccess: {1}to dn.base="" by * read
olcAccess: {2}to * by .... write by * read
olcLastMod: TRUE
olcRootDN: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
olcSyncrepl: {0}rid=011 provider=ldap://server1/ starttls=critical tls_reqcert=demand bindmethod=simple binddn="cn=config" credentials=secret searchbase="dc=your,dc=domain" type=refreshAndPersist retry="60 +" timeout=1
olcSyncrepl: {1}rid=012 provider=ldap://server2/ starttls=critical tls_reqcert=demand bindmethod=simple binddn="cn=config" credentials=secret searchbase="dc=your,dc=domain" type=refreshAndPersist retry="60 +" timeout=1
olcMirrorMode: TRUE
olcDb....: ... (other hdb configuration)

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

重点是使用olcRootDNolcRootPW设置cn=config复制器 ( syncprov) 的凭据以绑定在对等服务器上。您还需要进行适当的设置olcAccess,以便它们可以从对等方获取所有内容。无需向他们授予写入权限,因为他们已经知道如何更新自己的本地数据库。

相关内容