Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have machine installed OpenLdap which should replicated to another as slave. In this case, next time slave is on internet and use dynamic Ip Address which automatically change periodically.

I've read that there are method for overcome this problem with OpenLdap syncrepl Proxy (Openldap push based) like on http://www.openldap.org/doc/admin24/replication.html

I just have one server as master (192.168.2.23) and one as slave (192.168.2.28).

Bellow configuration on master server.

slapd.conf

#######################################################################
# Standard OpenLDAP Master/Provider
#######################################################################

include     /etc/openldap/schema/core.schema
include     /etc/openldap/schema/cosine.schema
include     /etc/openldap/schema/nis.schema
include     /etc/openldap/schema/inetorgperson.schema

include     /etc/openldap/slapd.acl

modulepath  /usr/lib/openldap
moduleload  back_hdb.la
moduleload  syncprov.la
moduleload  back_monitor.la
moduleload  back_ldap.la

pidfile     /var/run/openldap/slapd.pid
argsfile    /var/run/openldap/slapd.args

loglevel    sync stats

database    hdb
suffix      "dc=mydomain,dc=org"
directory   /var/lib/ldap

checkpoint      1024 5
cachesize       10000
idlcachesize    10000

index       objectClass eq
# rest of indexes
index       default     sub

rootdn  "cn=admin,dc=mydomain,dc=org"
rootpw  mydomain

# syncprov specific indexing
index entryCSN eq
index entryUUID eq

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

# Let the replica DN have limitless searches
limits dn.exact="cn=replicator,dc=mydomain,dc=org" time.soft=unlimited time.hard=unlimited size.soft=unlimited size.hard=unlimited

database    monitor

database    config
rootpw  mydomain

##############################################################################
# Consumer Proxy that pulls in data via Syncrepl and pushes out via slapd-ldap
##############################################################################

database ldap
# ignore conflicts with other databases, as we need to push out to same suffix
hidden      on
suffix  "dc=mydomain,dc=org"
rootdn  "cn=slapd-ldap"
uri     ldap://192.168.2.28:389/

lastmod on

# We don't need any access to this DSA
restrict all

acl-bind    bindmethod=simple
        binddn="cn=replicator,dc=mydomain,dc=org"
        credentials=testing

syncrepl    rid=001
        provider=ldap://localhost:389/
        binddn="cn=replicator,dc=mydomain,dc=org"
        bindmethod=simple
        credentials=testing
        searchbase="dc=mydomain,dc=org"
        type=refreshAndPersist
        retry="5 5 300 5"

overlay syncprov

bellow slapd.acl

# Give the replica DN unlimited read access.  This ACL may need to be
# merged with other ACL statements.

access to * by dn.base="cn=replicator,dc=mydomain,dc=org" write by * break

access to dn.base="" by * read

access to dn.base="cn=Subschema" by * read

access to dn.subtree="cn=Monitor" by dn.exact="uid=admin,dc=mydomain,dc=org" write by users read by * none

access to * by self write by * read

Firstly, i remove all of database on ldap and all of file and folder inside slap.d. Then i convert slapd.conf using slaptest with configuration above.

After that i add entry using ldiff file like bellow :

###########################################################
## file.ldif                                            ###
###########################################################

dn: dc=mydomain,dc=org
objectClass: dcObject
objectClass: organization
dc: mydomain
o : mydomain

Same step which i've done on master, i do too on slave server.But with different configuration like bellow :

slapd.conf

#######################################################################
# Standard OpenLDAP Slave without Syncrepl
#######################################################################

include     /etc/openldap/schema/core.schema
include     /etc/openldap/schema/cosine.schema
include     /etc/openldap/schema/nis.schema
include     /etc/openldap/schema/inetorgperson.schema

include     /etc/openldap/slapd.acl

modulepath  /usr/lib/openldap
moduleload  back_hdb.la
moduleload  syncprov.la
moduleload  back_monitor.la
moduleload  back_ldap.la

pidfile     /var/run/openldap/slapd.pid
argsfile    /var/run/openldap/slapd.args


loglevel    sync stats

database    hdb
suffix      "dc=mydomain,dc=org"
directory   /var/lib/ldap

checkpoint      1024 5
cachesize       10000
idlcachesize    10000

index       objectClass eq
# rest of indexes
index       default     sub

rootdn  "cn=admin,dc=mydomain,dc=org"
rootpw  mydomain

# Let the replica DN have limitless searches
limits dn.exact="cn=replicator,dc=mydomain,dc=org" time.soft=unlimited time.hard=unlimited size.soft=unlimited size.hard=unlimited

updatedn "cn=replicator,dc=mydomain,dc=org"

# Refer updates to the master
updateref   ldap://192.168.2.23:389

database    monitor

database    config
rootpw  mydomain

below slapd.acl

# Give the replica DN unlimited read access.  This ACL may need to be
# merged with other ACL statements.

access to * by dn.base="cn=replicator,dc=mydomain,dc=org" write by * break

access to dn.base="" by * read

access to dn.base="cn=Subschema" by * read

access to dn.subtree="cn=Monitor" by dn.exact="uid=admin,dc=mydomain,dc=org" write by users read by * none

access to * by self write by * read

file backend.ldif

dn: dc=mydomain,dc=org
objectClass: dcObject
objectClass: organization
dc: mydomain
o : mydomain

After all of them have done, replication is failure. when i add any entry on master not replicated on slave server.

Any missing configuration on my own ?

share|improve this question
    
You are more likely to get some attention if you show what you have already tried, how did it fail, what were the expected result, etc. –  dawud Jul 30 '13 at 17:45
    
Actually i have 2 machine which will be slave and master server.I have configuration on master like this >> pastebin.com/YuFNC6Xg and my slave configuration like this >> pastebin.com/ncvrLshA. is anywrong on my config ? –  Pirates Aug 1 '13 at 7:03
    
Please edit your question with that data instead of putting it in a comment. –  dawud Aug 1 '13 at 7:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.