FATAL: the database system is starting up

详细的报错信息如下:

LOG:  database system is ready to accept connections
LOG:  database system was interrupted;
LOG:  database system was not properly shut down; automatic recovery in progress
LOG:  invalid record length at 0/2EA3830: wanted 24, got 0
LOG:  redo is not required
LOG:  MultiXact member wraparound protections are now enabled
LOG:  database system is ready to accept connections
LOG:  autovacuum launcher started
LOG:  database system was interrupted; last known up at 2017-03-02 00:32:34 UTC
LOG:  received smart shutdown request

因为项目集成了docker,docker里又有postgresql数据库,所以在调试程序的时候,经常会有重启项目的时候(一般修改代码,会自动重启服务的,特殊情况除外),因为是刚结束服务,有立马启动服务,所以会经常启动不了,报错如上。

网上也查了一下,最后确定问题的原因:
postgresql数据库里有一个文件“postmaster.pid”,它是记录postgresql启动时的pid信息的,理论上在停止服务的时候,此文件会被删除掉的,但由于我操作频繁,导致它还没有被删除,在启动postgresql服务的时候,postgresql查询到pid文件的存在,以为服务已经启动起来了,为了不重新加载就不再启动服务了…
所以就直接 把那个pid文件删除掉…之后再启动服务,果然就正常咯

IT文库 » FATAL: the database system is starting up
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址