Problems with openldap replication with slurpd
Hi. Trying to make openldap replication Master server is openldap 2.0.27_3, slave server is openldap 2.2.30 Using stunnel to get acces to slave ldap master:localhost:636 -> stunnel -> slave:127.0.0.1:389
Master server config
include /usr/local/etc/openldap/schema/core.schema include /usr/local/etc/openldap/schema/cosine.schema include /usr/local/etc/openldap/schema/nis.schema include /usr/local/etc/openldap/schema/inetorgperson.schema include /usr/local/etc/openldap/schema/samba.schema
pidfile /var/run/openldap/slapd.pid argsfile /var/run/openldap/slapd.args loglevel 64
atabase ldbm cachesize 10000 dbcachesize 1000000 threads 128 dbnosync dbsync 2 12 5 sizelimit 10000
suffix "o=campus,c=ru" rootdn "cn=Manager,o=campus,c=ru"
rootpw {SSHA}password1 directory /var/db/openldap-ldbm
replogfile /var/log/slurpd.replog replica host=127.0.0.1:636 binddn="cn=replicator,o=campus,c=ru" bindmethod=simple credentials=bind_password
index objectClass eq index uid pres,eq index rid eq index uidNumber eq index gidNumber eq index cn eq,subinitial index memberUid eq
index gecos eq index description eq index default sub
access to attr=userPassword,lmPassword,ntPassword by self write by * auth
access to * by * read
----------------------------------------------------- Slave LDAP config
include /usr/local/etc/openldap/schema/core.schema include /usr/local/etc/openldap/schema/cosine.schema include /usr/local/etc/openldap/schema/nis.schema include /usr/local/etc/openldap/schema/inetorgperson.schema include /usr/local/etc/openldap/schema/samba.schema
pidfile /var/run/openldap/slapd.pid argsfile /var/run/openldap/slapd.args loglevel 64
database bdb
suffix "o=campus,c=ru" rootdn "cn=Manager,o=campus,c=ru"
rootpw {SSHA}paasswoord2 directory /var/db/openldap-data index objectClass eq index uid pres,eq index rid eq index uidNumber eq index gidNumber eq index cn eq index memberUid eq index gecos eq index description eq index default sub
access to * by dn="cn=replicator,o=campus,c=ru" write by * read
First, i am doing "slapcat" at master server and adding LDIFF file to SLAVE ldap. Then i turning on replication by adding lines
updatedn "cn=replicator,o=campus,c=ru" updateref ldap://127.0.0.1:636
to the slave config file.
Master has no runnig slurpd. I am adding new samba user at master and receiving replog file.
Running daemon slurpd at master i receiving "unknown error" then adding new user at slave.
But when i changes something at existent users (password,description,etc) - it replies to slave! Coult you help me to find bug with replica then adding user?
Here is some files:
slurpd.replog
replica: 127.0.0.1:636 time: 1160060587.0 dn: uid=test0981,ou=People,o=campus,c=ru changetype: add objectClass: top objectClass: account objectClass: posixAccount cn: test0981 uid: test0981 uidNumber: 11686 gidNumber: 545 homeDirectory: /home/test0981 loginShell: /usr/bin/false gecos: System User description: System User userPassword:: e2NyeXB0fXg= creatorsName: cn=Manager,o=campus,c=ru createTimestamp: 20061005150306Z modifiersName: cn=Manager,o=campus,c=ru modifyTimestamp: 20061005150306Z
replica: 127.0.0.1:636 time: 1160060596 dn: uid=test0981,ou=People,o=campus,c=ru changetype: modify replace: objectClass objectClass: top objectClass: account objectClass: posixAccount objectClass: sambaAccount - replace: logonTime logonTime: 0 - replace: logoffTime logoffTime: 2147483647 -
... ...
127.0.0.1:636.rej
ERROR: Unknown error replica: 127.0.0.1:636 time: 1160057891.0 dn: uid=test6789,ou=People,o=campus,c=ru changetype: add objectClass: top objectClass: account objectClass: posixAccount cn: test6789 uid: test6789 uidNumber: 11685 gidNumber: 545 homeDirectory: /home/test6789 loginShell: /usr/bin/false gecos: System User description: System User userPassword:: e2NyeXB0fXg= creatorsName: cn=Manager,o=campus,c=ru createTimestamp: 20061005141804Z modifiersName: cn=Manager,o=campus,c=ru modifyTimestamp: 20061005141804Z
ERROR: No such object replica: 127.0.0.1:636 time: 1160057921.0 dn: uid=test6789,ou=People,o=campus,c=ru changetype: modify replace: objectClass objectClass: top objectClass: account objectClass: posixAccount objectClass: sambaAccount -
... ...
slurpd -d 64
output:
...<skip> ...
Config: (directory /var/db/openldap-ldbm) Config: (replogfile /var/log/slurpd.replog) Config: (replica host=127.0.0.1:636 binddn="cn=replicator,o=campus,c=ru" bindmethod=simple credentials=campus_replicator ) Config: ** successfully added replica "127.0.0.1:636" Config: (index objectClass eq) Config: (index uid pres,eq) Config: (index rid eq) Config: (index uidNumber eq) Config: (index gidNumber eq) Config: (index cn eq,subinitial) Config: (index memberUid eq) Config: (index gecos eq) Config: (index description eq) Config: (index default sub) Config: (access to attr=userPassword,lmPassword,ntPassword by self write by * auth) Config: (access to * by * read) Config: ** configuration file successfully read and parsed ber_flush: 58 bytes to sd 8 request 1 done ber_flush: 418 bytes to sd 8 request 2 done
... ... request 6 done Error: ldap_add_s failed adding "Unknown error": uid=test6789,ou=People,o=campus,c=ru Error: ldap operation failed, data written to "/var/db/openldap-slurp/replica/127.0.0.1:636.rej" ber_flush: 51784 bytes to sd 8 request 7 done ber_flush: 471 bytes to sd 8 request 8 done Error: ldap_modify_s failed modifying "No such object": uid=test6789,ou=People,o=campus,c=ru Error: ldap operation failed, data written to "/var/db/openldap-slurp/replica/127.0.0.1:636.rej" ber_flush: 418 bytes to sd 8 request 9 done Error: ldap_modify_s failed modifying "No such object": uid=test6789,ou=People,o=campus,c=ru Error: ldap operation failed, data written to "/var/db/openldap-slurp/replica/127.0.0.1:636.rej" ber_flush: 315 bytes to sd 8 request 10 done
...
WBR, Yushin Roman
--On Thursday, October 05, 2006 8:32 PM +0400 Roman Yushin romen@infosite.ru wrote:
Problems with openldap replication with slurpd
Hi. Trying to make openldap replication Master server is openldap 2.0.27_3, slave server is openldap 2.2.30 Using stunnel to get acces to slave ldap master:localhost:636 -> stunnel -> slave:127.0.0.1:389
I'm pretty sure this isn't even possible. I'll note that both releases you are using are very old, the 2.0 one being ancient. I advise upgrading to a modern release of OpenLDAP.
--Quanah
-- Quanah Gibson-Mount Principal Software Developer ITS/Shared Application Services Stanford University GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html
On 10/5/06, Roman Yushin romen@infosite.ru wrote:
Problems with openldap replication with slurpd
Hi. Trying to make openldap replication Master server is openldap 2.0.27_3, slave server is openldap 2.2.30 Using stunnel to get acces to slave ldap master:localhost:636 -> stunnel -> slave:127.0.0.1:389
slurpd.replog
replica: 127.0.0.1:636 time: 1160060587.0 dn: uid=test0981,ou=People,o=campus,c=ru changetype: add objectClass: top objectClass: account objectClass: posixAccount cn: test0981 uid: test0981 uidNumber: 11686 gidNumber: 545 homeDirectory: /home/test0981 loginShell: /usr/bin/false gecos: System User description: System User userPassword:: e2NyeXB0fXg= creatorsName: cn=Manager,o=campus,c=ru createTimestamp: 20061005150306Z modifiersName: cn=Manager,o=campus,c=ru modifyTimestamp: 20061005150306Z
replica: 127.0.0.1:636 time: 1160060596 dn: uid=test0981,ou=People,o=campus,c=ru changetype: modify replace: objectClass objectClass: top objectClass: account objectClass: posixAccount objectClass: sambaAccount
replace: logonTime logonTime: 0
replace: logoffTime logoffTime: 2147483647
... ...
127.0.0.1:636.rej
ERROR: Unknown error replica: 127.0.0.1:636 time: 1160057891.0 dn: uid=test6789,ou=People,o=campus,c=ru changetype: add objectClass: top objectClass: account objectClass: posixAccount cn: test6789 uid: test6789 uidNumber: 11685 gidNumber: 545 homeDirectory: /home/test6789 loginShell: /usr/bin/false gecos: System User description: System User userPassword:: e2NyeXB0fXg= creatorsName: cn=Manager,o=campus,c=ru createTimestamp: 20061005141804Z modifiersName: cn=Manager,o=campus,c=ru modifyTimestamp: 20061005141804Z
request 6 done Error: ldap_add_s failed adding "Unknown error": uid=test6789,ou=People,o=campus,c=ru Error: ldap operation failed, data written to "/var/db/openldap-slurp/replica/127.0.0.1:636.rej" ber_flush: 51784 bytes to sd 8 request 7 done ber_flush: 471 bytes to sd 8 request 8 done Error: ldap_modify_s failed modifying "No such object": uid=test6789,ou=People,o=campus,c=ru Error: ldap operation failed, data written to "/var/db/openldap-slurp/replica/127.0.0.1:636.rej" ber_flush: 418 bytes to sd 8 request 9 done Error: ldap_modify_s failed modifying "No such object": uid=test6789,ou=People,o=campus,c=ru Error: ldap operation failed, data written to "/var/db/openldap-slurp/replica/127.0.0.1:636.rej" ber_flush: 315 bytes to sd 8 request 10 done
You should upgrade. You also need to provide the log output from the slave server. That will give the actual error code, which your master does not understand. "Unknown errors", such as code 80, can often mean you have database corruption.
_Matt
Thanks. I have forgotten about logs of slave :)
Here it is:
Oct 6 09:56:14 fs slapd[73322]: slapd stopped. Oct 6 09:56:17 fs slapd[75559]: @(#) $OpenLDAP: slapd 2.2.30 (Mar 10 2006 11:31:03) $ root@slave_server:/usr/ports/net/openldap22-server/work/openldap-2.2.30/s ervers/slapd Oct 6 09:56:17 fs slapd[75559]: line 51 (database bdb) Oct 6 09:56:17 fs slapd[75559]: bdb_db_init: Initializing BDB database Oct 6 09:56:17 fs slapd[75559]: line 53 (suffix "o=campus,c=ru") Oct 6 09:56:17 fs slapd[75559]: line 54 (rootdn "cn=Manager,o=campus,c=ru") Oct 6 09:56:17 fs slapd[75559]: line 58 (rootpw ***) Oct 6 09:56:17 fs slapd[75559]: line 61 (directory /var/db/openldap-data) Oct 6 09:56:17 fs slapd[75559]: line 63 (index objectClass eq) Oct 6 09:56:17 fs slapd[75559]: index objectClass 0x0004 Oct 6 09:56:17 fs slapd[75559]: line 65 (index uid pres,eq) Oct 6 09:56:17 fs slapd[75559]: index uid 0x0006 Oct 6 09:56:17 fs slapd[75559]: line 67 (index rid eq) Oct 6 09:56:17 fs slapd[75559]: index rid 0x0004 Oct 6 09:56:17 fs slapd[75559]: line 70 (index uidNumber eq) Oct 6 09:56:17 fs slapd[75559]: index uidNumber 0x0004 Oct 6 09:56:17 fs slapd[75559]: line 71 (index gidNumber eq) Oct 6 09:56:17 fs slapd[75559]: index gidNumber 0x0004 Oct 6 09:56:17 fs slapd[75559]: line 72 (index cn eq) Oct 6 09:56:17 fs slapd[75559]: index cn 0x0004 Oct 6 09:56:17 fs slapd[75559]: line 73 (index memberUid eq) Oct 6 09:56:17 fs slapd[75559]: index memberUid 0x0004 Oct 6 09:56:17 fs slapd[75559]: line 74 (index gecos eq) Oct 6 09:56:17 fs slapd[75559]: index gecos 0x0004 Oct 6 09:56:17 fs slapd[75559]: line 75 (index description eq) Oct 6 09:56:17 fs slapd[75559]: index description 0x0004 Oct 6 09:56:17 fs slapd[75559]: line 76 (index default sub) Oct 6 09:56:17 fs slapd[75559]: line 101 (access to * by dn="cn=replicator,o=campus,c=ru" write by * read) Oct 6 09:56:17 fs slapd[75560]: slapd starting Oct 6 09:56:52 fs slapd[75560]: bdb(o=campus,c=ru): illegal flag specified to txn_begin Oct 6 09:56:52 fs slapd[75560]: bdb_txn_get: BerkeleyDB 4.2.52 library needs TXN patch! Oct 6 09:59:35 fs slapd[73322]: No structuralObjectClass for entry (uid=romen5,ou=People,o=campus,c=ru)
Here is the error!
"No structuralObjectClass for entry (uid=....)"
But i didn't understand this. I am copied ldiff from master's slurpd.replog, comment few lines like this:
#ERROR: Unknown error #replica: 127.0.0.1:636 #time: 1160113877.0
dn: uid=romen5,ou=People,o=campus,c=ru #changetype: add objectClass: top objectClass: account objectClass: posixAccount cn: romen5 uid: romen5 uidNumber: 11693 gidNumber: 545 homeDirectory: /home/romen5 loginShell: /usr/bin/false gecos: System User description: System User userPassword:: e2NyeXB0fXg= #creatorsName: cn=Manager,o=campus,c=ru #createTimestamp: 20061006055117Z #modifiersName: cn=Manager,o=campus,c=ru #modifyTimestamp: 20061006055117Z
Turned off replication at slave (removed updatedn "cn=replicator,o=campus,c=ru" updateref ldap://127.0.0.1:636) And then i am added that ldiff!
[root@slave_server]# ldapadd -D "cn=manager,o=campus,c=ru" -w password -f /path-to/test_replica.ldiff adding new entry "uid=romen5,ou=People,o=campus,c=ru"
Replication between those tho servers worked fine recently. At march of this year i tune it up, but now prblems have appeared now.. We don't need to upgrade openldap cause soon we will change our servers. Then i'll set up latest release of openldap.
WBR, Yushin Roman
On 10/6/06, Roman Yushin romen@infosite.ru wrote:
Thanks. I have forgotten about logs of slave :)
Here it is:
Oct 6 09:56:14 fs slapd[73322]: slapd stopped. Oct 6 09:56:17 fs slapd[75559]: @(#) $OpenLDAP: slapd 2.2.30 (Mar 10 2006 11:31:03) $ root@slave_server:/usr/ports/net/openldap22-server/work/openldap-2.2.30/s ervers/slapd Oct 6 09:56:17 fs slapd[75559]: line 51 (database bdb) Oct 6 09:56:17 fs slapd[75559]: bdb_db_init: Initializing BDB database Oct 6 09:56:17 fs slapd[75559]: line 53 (suffix "o=campus,c=ru") Oct 6 09:56:17 fs slapd[75559]: line 54 (rootdn "cn=Manager,o=campus,c=ru") Oct 6 09:56:17 fs slapd[75559]: line 58 (rootpw ***) Oct 6 09:56:17 fs slapd[75559]: line 61 (directory /var/db/openldap-data) Oct 6 09:56:17 fs slapd[75559]: line 63 (index objectClass eq) Oct 6 09:56:17 fs slapd[75559]: index objectClass 0x0004 Oct 6 09:56:17 fs slapd[75559]: line 65 (index uid pres,eq) Oct 6 09:56:17 fs slapd[75559]: index uid 0x0006 Oct 6 09:56:17 fs slapd[75559]: line 67 (index rid eq) Oct 6 09:56:17 fs slapd[75559]: index rid 0x0004 Oct 6 09:56:17 fs slapd[75559]: line 70 (index uidNumber eq) Oct 6 09:56:17 fs slapd[75559]: index uidNumber 0x0004 Oct 6 09:56:17 fs slapd[75559]: line 71 (index gidNumber eq) Oct 6 09:56:17 fs slapd[75559]: index gidNumber 0x0004 Oct 6 09:56:17 fs slapd[75559]: line 72 (index cn eq) Oct 6 09:56:17 fs slapd[75559]: index cn 0x0004 Oct 6 09:56:17 fs slapd[75559]: line 73 (index memberUid eq) Oct 6 09:56:17 fs slapd[75559]: index memberUid 0x0004 Oct 6 09:56:17 fs slapd[75559]: line 74 (index gecos eq) Oct 6 09:56:17 fs slapd[75559]: index gecos 0x0004 Oct 6 09:56:17 fs slapd[75559]: line 75 (index description eq) Oct 6 09:56:17 fs slapd[75559]: index description 0x0004 Oct 6 09:56:17 fs slapd[75559]: line 76 (index default sub) Oct 6 09:56:17 fs slapd[75559]: line 101 (access to * by dn="cn=replicator,o=campus,c=ru" write by * read) Oct 6 09:56:17 fs slapd[75560]: slapd starting Oct 6 09:56:52 fs slapd[75560]: bdb(o=campus,c=ru): illegal flag specified to txn_begin Oct 6 09:56:52 fs slapd[75560]: bdb_txn_get: BerkeleyDB 4.2.52 library needs TXN patch! Oct 6 09:59:35 fs slapd[73322]: No structuralObjectClass for entry (uid=romen5,ou=People,o=campus,c=ru)
Here is the error!
"No structuralObjectClass for entry (uid=....)"
But i didn't understand this. I am copied ldiff from master's slurpd.replog, comment few lines like this:
#ERROR: Unknown error #replica: 127.0.0.1:636 #time: 1160113877.0
dn: uid=romen5,ou=People,o=campus,c=ru #changetype: add objectClass: top objectClass: account objectClass: posixAccount cn: romen5 uid: romen5 uidNumber: 11693 gidNumber: 545 homeDirectory: /home/romen5 loginShell: /usr/bin/false gecos: System User description: System User userPassword:: e2NyeXB0fXg= #creatorsName: cn=Manager,o=campus,c=ru #createTimestamp: 20061006055117Z #modifiersName: cn=Manager,o=campus,c=ru #modifyTimestamp: 20061006055117Z
Turned off replication at slave (removed updatedn "cn=replicator,o=campus,c=ru" updateref ldap://127.0.0.1:636) And then i am added that ldiff!
[root@slave_server]# ldapadd -D "cn=manager,o=campus,c=ru" -w password -f /path-to/test_replica.ldiff adding new entry "uid=romen5,ou=People,o=campus,c=ru"
Replication between those tho servers worked fine recently. At march of this year i tune it up, but now prblems have appeared now.. We don't need to upgrade openldap cause soon we will change our servers. Then i'll set up latest release of openldap.
Your master server is not producing valid slurpd replication, which includes structural attributes.
--On Friday, October 06, 2006 8:18 AM -0400 matthew sporleder msporleder@gmail.com wrote:
Your master server is not producing valid slurpd replication, which includes structural attributes.
Right, as I noted earlier... Replication from a 2.0 master to a 2.2 slave is not possible.
I highly advise updating your versions of OpenLDAP to something modern and supported, also as I noted earlier. It will take you some time, I'm guessing, because it sounds like you have entries that are not valid (i.e., missing structuralobjectclasses).
--Quanah
-- Quanah Gibson-Mount Principal Software Developer ITS/Shared Application Services Stanford University GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html
openldap-software@openldap.org