Postmaster.pid已经存在,说PID编号在目录中运行但没有进程?

时间:2017-04-06 13:27:48

标签: database postgresql postgresql-9.6

我正在尝试为新项目运行PostgreSQL 9.6.2 db。

当我输入

postgres -D /usr/local/var/postgres

我收到以下错误消息:

FATAL:  lock file "postmaster.pid" already exists
HINT:  Is another postmaster (PID 49425) running in data directory "/usr/local/var/postgres"?

当我获得该文件夹的所有进程列表时,它会显示:

49425
/usr/local/var/postgres
1491484894
5432
/tmp
localhost

然后当我尝试

kill 49425

它仍然在列表中

当我进入

pd

49425 PID编号不在列表中。

这里出了什么问题?

1 个答案:

答案 0 :(得分:0)

它说文件/usr/local/var/postgres/postmaster.pid,所以它不会启动。

而不是使用postgres -D /usr/local/var/postgres开始postgres,而不是尝试pg_ctl -D /usr/local/var/postgres start