Używam Fedora 15z PostgreSQL 9.1.4. Fedora niedawno uległa awarii, po czym:
Próba uruchomienia serwera PostgreSQL:
service postgresql-9.1 start
daje
Starting postgresql-9.1 (via systemctl): Job failed. See system logs and 'systemctl status' for details.
[FAILED]
Chociaż serwer uruchamia się normalnie, gdy uruchamiam go po raz pierwszy po ponownym uruchomieniu systemu .
Ale próba użycia psqlpowoduje następujący błąd:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
.s.PGSQL.5432plik nie jest nigdzie w systemie. A locate .s.PGSQL.5432Wyjścia nic.
Dziennik systemu ma to:
Aug 14 17:31:58 localhost systemd[1]: postgresql-9.1.service: control process exited, code=exited status=1
Aug 14 17:31:58 localhost systemd[1]: Unit postgresql-9.1.service entered failed state.
ZA
systemctl status postgresql-9.1.service
daje
postgresql-9.1.service - SYSV: PostgreSQL database server.
Loaded: loaded (/etc/rc.d/init.d/postgresql-9.1)
Active: failed since Tue, 14 Aug 2012 17:31:58 +0530; 58s ago
Process: 2811 ExecStop=/etc/rc.d/init.d/postgresql-9.1 stop (code=exited, status=1/FAILURE)
Process: 12423 ExecStart=/etc/rc.d/init.d/postgresql-9.1 start (code=exited, status=1/FAILURE)
Main PID: 2551 (code=exited, status=1/FAILURE)
CGroup: name=systemd:/system/postgresql-9.1.service
Nie zmieniłem domyślnego ustawienia fsync, więc zgaduję, że było ustawione na on. Jestem na dysku twardym. Dysk twardy się zawiesił.
Awaria dysku twardego
Awaria dysku twardego spowodowała uruchomienie instrukcji fsckw trybie szybkim i bez interfejsu GUI. Dzięki niemu naprawia iglice gazillionowe itp. Następnie zrestartowałem system za pomocą Ctrl+ Alt+ Delete.
Dziennik PostgreSQL ma to:
LOG: database system was interrupted; last known up at 2012-08-14 17:31:57 IST
LOG: database system was not properly shut down; automatic recovery in progress
LOG: record with zero length at 0/41A4E58
LOG: redo is not required
FATAL: could not access status of transaction 1
DETAIL: Could not open file "pg_multixact/offsets/0000": No such file or directory.
LOG: startup process (PID 13016) exited with exit code 1
LOG: aborting startup due to startup process failure
Aktualizacja
Próba uruchomienia serwera po pobraniu kopii /var/lib/pgsqlkatalogu na poziomie systemu plików i uruchomieniu ./pg_resetxlog -f /var/lib/pgsql/9.1/data/z wynikiem xlog -f /var/lib/pgsql/9.1/data/nadal daje:
LOG: database system was interrupted; last known up at 2012-08-14 18:46:36 IST
LOG: database system was not properly shut down; automatic recovery in progress
LOG: record with zero length at 0/6000078
LOG: redo is not required
FATAL: could not access status of transaction 1
DETAIL: Could not open file "pg_multixact/offsets/0000": No such file or directory.
LOG: startup process (PID 13766) exited with exit code 1
LOG: aborting startup due to startup process failure
pg_resetxlognie zrobiło nic dobrego, więc jesteś na terytorium zabawy. Czy masz kopię zapasową tej bazy danych sprzed awarii?
pg_multixact/offsets/0000tego Pg, zaakceptowałby ...