22-02-05 11:25
Razrušena baza LDAP daemona
piše IVAN RAKO
Nedavno smo na helpdesku rješavali dva slična problema. Slapd je radio uredno, a db_recover nije prolazio. Evo primjera:
# db(4.2)_recover -h /var/lib/ldap/ db_recover: DB_ENV->log_flush: LSN of 3/5383287 past current end-of-log of 3/5290658 db_recover: Database environment corrupt; the wrong log files may have been removed or incompatible database files imported from another environment db_recover: id2entry.bdb: unable to flush page: 0 db_recover: txn_checkpoint: failed to flush the buffer cache Invalid argument db_recover: PANIC: Invalid argument db_recover: PANIC: fatal region error detected; run recovery db_recover: PANIC: fatal region error detected; run recovery db_recover: PANIC: fatal region error detected; run recovery db_recover: PANIC: fatal region error detected; run recovery db_recover: PANIC: fatal region error detected; run recovery db_recover: PANIC: fatal region error detected; run recovery db_recover: PANIC: fatal region error detected; run recovery db_recover: PANIC: fatal region error detected; run recovery db_recover: PANIC: fatal region error detected; run recovery db_recover: PANIC: fatal region error detected; run recovery db_recover: PANIC: fatal region error detected; run recovery db_recover: PANIC: fatal region error detected; run recovery db_recover: PANIC: fatal region error detected; run recovery db_recover: PANIC: fatal region error detected; run recovery db_recover: PANIC: fatal region error detected; run recovery db_recover: PANIC: fatal region error detected; run recovery db_recover: PANIC: fatal region error detected; run recovery db_recover: PANIC: fatal region error detected; run recovery db_recover: DB_ENV->open: DB_RUNRECOVERY: Fatal error, run database recovery
Pokušali smo -c, ali nije pomoglo.
U oba slučaja je slapcat uredno "dumpao" LDAP bazu u tekstualnu datoteku.
Problem je na kraju riješen ovako:
# pkill -9 slapd # tar cfvz /tmp/var-lib-ldap.tar.gz /var/lib/ldap
Time smo napravili backup, za svaki slučaj.
# slapcat -l /var/backups/slapcat.openldap-cn # rm /var/lib/ldap/* # /etc/init.d/slapd start
To kreira praznu ldap bazu unutar direktorija /var/lib/ldap.
Zatim se naredbom slapadd u bazu vrate stari podaci:
# /etc/init.d/slapd stop # slapadd -l /var/backups/slapcat.openldap-cn # /etc/init.d/slapd start
Nakon toga slapd radi, a db(4.2)_recover uredno prolazi.
|