Я изменил пару вещей, и теперь это работает. Я делюсь своим файлом конфигурации здесь.
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
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 2 //serverID --> serverid
#database section
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 // on --> TRUE