致命错误锁定文件"postmaster.pid"已经存在 [英] FATAL ERROR lock file "postmaster.pid" already exists
问题描述
我最近使用Homebrew在我的Mac(El Capitan 10.11.4,Postgres是9.5.1版)上安装了PostGIS,我正在遵循以下说明-
I have recently installed PostGIS on my Mac (El Capitan 10.11.4, Postgres is version 9.5.1) using Homebrew, and I am following these instructions - http://morphocode.com/how-to-install-postgis-on-mac-os-x/
当我尝试使用Postgres启动
When I try to start Postgres using
pg_ctl -D /usr/local/var/postgres start
我收到以下错误:
$ FATAL: lock file "postmaster.pid" already exists
HINT: Is another postmaster (PID 280) running in data directory "/usr/local/var/postgres"?
所以我花了几个小时研究如何解决这个问题,但无济于事.
So I spent a few hours researching how to address this, but to no avail.
Notably, I tried to kill the PID as recommended in an answer on Superuser - https://superuser.com/questions/553045/fatal-lock-file-postmaster-pid-already-exists- (in the case above, I ran kill 208
), but as soon as I tried to start Postgres again, I got the same error, albeit with a different PID number. I saw a few people recommended deleting the postmaster.pid file, but I feel like maybe I should save that as a last resort...
我不确定如何解决此问题的部分原因在于,我甚至还不清楚邮局局长是什么-我才刚刚开始学习所有这一切.
Admittedly part of the reason I'm not sure how to fix this is that I'm not really clear on what the postmaster even is - I'm just starting to learn about all of this.
通过psql db_name
命令跳入Postgres数据库就可以了,因为它值得.
Hopping into a Postgres database via the psql db_name
command works just fine, for what it's worth.
推荐答案
Postmaster 是PostgreSQL的主要过程.您正在尝试启动已经运行的PostgreSQL(您说自己可以连接到它).只需跳过过程的这一步即可.
Postmaster is the main PostgreSQL process. You're trying to start PostgreSQL that's already running (and you're saying yourself you can connect to it). Just skip that step of your process.
这篇关于致命错误锁定文件"postmaster.pid"已经存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!