我使用Fedora 15
带PostgreSQL 9.1.4
。Fedora最近崩溃了,之后:
尝试启动PostgreSQL服务器:
service postgresql-9.1 start
给
Starting postgresql-9.1 (via systemctl): Job failed. See system logs and 'systemctl status' for details.
[FAILED]
虽然,在系统重启后第一次启动服务器时,服务器可以正常启动。
但是,尝试使用psql
会出现此错误:
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.5432
文件在系统上任何地方都不存在。A locate .s.PGSQL.5432
什么也没输出。
系统日志具有以下内容:
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.
一个
systemctl status postgresql-9.1.service
给
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
我没有更改fsync的默认设置,所以我猜测它设置为on
。我在硬盘上。硬盘崩溃。
硬盘崩溃
HDD崩溃导致在fsck
提示而非基于gui的情况下运行手册。用它来修复gazillion的inode等。之后,我用Ctrl+ Alt+ 重新启动了系统Delete。
PostgreSQL的日志具有以下内容:
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
更新资料
在获取目录的文件系统级副本之后尝试启动服务器/var/lib/pgsql
,并运行./pg_resetxlog -f /var/lib/pgsql/9.1/data/
结果xlog -f /var/lib/pgsql/9.1/data/
仍然会产生:
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_resetxlog
没有任何好处,因此您会进入有趣的领域。您是否有崩溃之前的该数据库的备份?
pg_multixact/offsets/0000
为该Pg接受一些虚拟内容,则可以接受...