[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re[6]: openldap db wiped?



>>>> QGM> Have you tried running "db_recover" (assuming you are using bdb)?
>>>>
>>>> QGM> What version of OpenLDAP are you using?
>>>>
>>>> QGM> Also, you probably want to use the "checkpoint" command in your
>>>> slapd.conf QGM> to force the database to checkpoint at times other than
>>>> shutdown.
>>>>
>>>> I have tried it after you suggested: no help :)
>>
>> QGM> You haven't answered the version question. ;)
>>
>> Hey, I have no experience with openldap, so I did:
>>
>> "strings log.0000000001" | more
>>
>> and I see some pieces of the data that is missing. This gives me a
>> hope that I can still get those lost records ;)

QGM> Well, "db_recover" is the command that is supposed to recover the data from
QGM> the log files and write it out to the DB.

QGM> I would try making sure slapd is stopped, and then running "db_recover"
QGM> twice in a row.  Sometimes it needs to recreate the DB environment the
QGM> first time it is run, before it'll do the rest of the recover.

QGM> Again, to avoid getting into this situation in the future, I suggest adding
QGM> the "checkpoint" directive to your slapd.conf, which will have OpenLDAP
QGM> checkpoint the database on a periodic basis, rather than just at shutdown
QGM> time.

QGM> --Quanah

QGM> --
QGM> Quanah Gibson-Mount
QGM> Principal Software Developer
QGM> ITSS/Shared Services
QGM> Stanford University
QGM> GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html

QGM> "These censorship operations against schools and libraries are stronger
QGM> than ever in the present religio-political climate. They often focus on
QGM> fantasy and sf books, which foster that deadly enemy to bigotry and blind
QGM> faith, the imagination." -- Ursula K. Le Guin


I have just tried running it 3 times in a row :) After doing this, ALL
the records dissapeared from DB. Here is what I got on the shell:

[root@s002 ldap]# service ldap stop
Stopping slapd: [  OK  ]
[root@s002 ldap]# db_recover -ev
db_recover: Finding last valid log LSN: file: 1 offset 2127417
db_recover: Recovery starting from [1][2126926]
db_recover: Recovery complete at Fri Jan  7 22:29:35 2005
db_recover: Maximum transaction ID 80000385 Recovery checkpoint [1][2127767]
[root@s002 ldap]# db_recover -ev
db_recover: Finding last valid log LSN: file: 1 offset 2127855
db_recover: Recovery starting from [1][2127365]
db_recover: Recovery complete at Fri Jan  7 22:29:38 2005
db_recover: Maximum transaction ID 80000385 Recovery checkpoint [1][2127855]
[root@s002 ldap]# db_recover -ev
db_recover: Finding last valid log LSN: file: 1 offset 2127943
db_recover: Recovery starting from [1][2127819]
db_recover: Recovery complete at Fri Jan  7 22:29:46 2005
db_recover: Maximum transaction ID 80000385 Recovery checkpoint [1][2127943]
[root@s002 ldap]# service ldap start
Starting slapd: [  OK  ]

Karolis