# Schema include
include         ....
....

# Modules
modulepath /opt/openldap-2.4/usr/lib64/openldap
moduleload accesslog
moduleload syncprov

serverID 2

# AccessLog
database hdb
suffix cn=accesslog
directory /opt/openldap-2.4/var/lib/accesslog
rootdn cn=accesslog
checkpoint 256 30
index default eq
index entryCSN,objectClass,reqEnd,reqResult,reqStart

overlay syncprov
syncprov-nopresent TRUE
syncprov-reloadhint TRUE

# Limit for repl on accesslog
limits dn.exact="cn=repl,dc=example,dc=com" time.soft=unlimited time.hard=unlimited size.soft=unlimited size.hard=unlimited

# Primary database
database        hdb
suffix          "dc=br"
rootdn          "cn=Manager,dc=example,dc=com"
directory       /opt/openldap-2.4/var/lib/ldap
rootpw          XXXXXXXXXX
cachesize       100000
idlcachesize    400000
sizelimit       100000
checkpoint 256 30

pidfile         /opt/openldap-2.4/var/run/openldap/slapd.pid
argsfile        /opt/openldap-2.4/var/run/openldap/slapd.args

loglevel        256
threads         4
writetimeout    1200
idletimeout     300

# syncrepl Provider for primary db
overlay syncprov
syncprov-checkpoint 1000 60

# accesslog overlay definitions for primary db
overlay accesslog
logdb cn=accesslog
logops writes
logsuccess TRUE
# Scan and purge 7 days
logpurge 07+00:00 01+00:00

# Limit for repl on dc=example,dc=com
limits dn.exact="cn=repl,dc=example,dc=com" time.soft=unlimited time.hard=unlimited size.soft=unlimited size.hard=unlimited

# MirrorMode
syncrepl      rid=001
              provider=ldap://master1.example.com
              bindmethod=simple
              binddn="cn=repl,dc=example,dc=com"
              credentials=XXXXXXXXXXXX
              searchbase="dc=example,dc=com"
              type=refreshAndPersist
              retry="60 +"
mirrormode on

# Monitor
database        monitor
