如何在OPENLDAP中配置镜像节点

问题描述 投票:0回答:1

我有两个OpenLDAP服务器:x.x.x.x:389和y.y.y.y:389。

我的第一台服务器的slapd.conf


include         /usr/local/etc/openldap/schema/core.schema

pidfile         /usr/local/var/run/slapd.pid
argsfile        /usr/local/var/run/slapd.args

modulepath      /usr/local/libexec/openldap
moduleload      back_mdb.la
moduleload      back_ldap.la
moduleload      syncprov.la

database        mdb
maxsize         1073741824
suffix          "dc=my-domain,dc=com"
rootdn          "cn=Manager,dc=my-domain,dc=com"
rootpw          ******

directory       /usr/local/var/openldap-data
# Indices to maintain
index   objectClass     eq

overlay syncprov

#Global section 
serverID 1


syncrepl rid=001
                 provider=ldap://y.y.y.y:389
                 binddn="cn=Manager,dc=my-domain,dc=com"
                 bindmethod=simple
                 credentials=****
                 searchbase="dc=my-domain,dc=com"
                 type=refreshAndPersist
                 interval=00:00:00:05
                 retry="5 5 300 5"
                 timeout=1

mirrormode on

第二台服务器的sldap.conf

include         /usr/local/etc/openldap/schema/core.schema

pidfile         /usr/local/var/run/slapd.pid
argsfile        /usr/local/var/run/slapd.args

modulepath      /usr/local/libexec/openldap
moduleload      back_mdb.la
moduleload      back_ldap.la
moduleload      syncprov.la

database        mdb
maxsize         1073741824
suffix          "dc=my-domain,dc=com"
rootdn          "cn=Manager,dc=my-domain,dc=com"
rootpw          ****

directory       /usr/local/var/openldap-data
# Indices to maintain
index   objectClass     eq

overlay syncprov

#Global section
serverID   2
#database section

syncrepl rid=001
                 provider=ldap://x.x.x.x:389
                 binddn="cn=Manager,dc=my-domain,dc=com"
                 bindmethod=simple
                 credentials=****
                 searchbase="dc=my-domain,dc=com"
                 type=refreshAndPersist
                 interval=00:00:00:05
                 retry="5 5 300 5"
                 timeout=1

mirrormode on

两台服务器都在运行,但是一台服务器尝试获取条目,但不复制任何数据。我的配置有问题吗?

ldap openldap
1个回答
0
投票

我做了几件事,现在可以了。我在这里共享我的conf文件。

第一台服务器的slapd.conf

modulepath      /usr/local/libexec/openldap
moduleload      back_mdb.la
moduleload      back_ldap.la
moduleload      syncprov.la

database        mdb
maxsize         1073741824
suffix          "dc=my-domain,dc=com"
rootdn          "cn=Manager,dc=my-domain,dc=com"
rootpw          ******

directory       /usr/local/var/openldap-data
# Indices to maintain
index   objectClass     eq

overlay syncprov

#Global section 
serverid 1                       // I changed serverID 1 to serverid 1 


syncrepl rid=001
                 provider=ldap://y.y.y.y:389
                 binddn="cn=Manager,dc=my-domain,dc=com"
                 bindmethod=simple
                 credentials=****
                 searchbase="dc=my-domain,dc=com"
                 type=refreshAndPersist
                 interval=00:00:00:05
                 retry="5 5 300 5"
                 timeout=1

syncrepl rid=002                                          // added this
         provider=ldap://x.x.x.x:389
         binddn="cn=Manager,dc=my-domain,dc=com"
         bindmethod=simple
         credentials=secret
         searchbase="dc=my-domain,dc=com"
         schemachecking=on
         type=refreshAndPersist
         interval=00:00:00:05
         retry="60 +"


mirrormode TRUE                         // I changed on to TRUE

[第二台服务器的C0]

slapd.conf
© www.soinside.com 2019 - 2024. All rights reserved.