PostgreSQL 服务器不会停止 [英] PostgreSQL server won't stop

查看:29
本文介绍了PostgreSQL 服务器不会停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Mac OS X 10.8.4 上使用 PostgreSQL 有点问题.我不小心在 postgres 服务器运行时执行了 brew rm postgresql --force.当我使用 brew install postgresql 安装并运行 pg_ctl -D/usr/local/var/postgres start 我得到:

Having a bit of an issue with PostgreSQL on Mac OS X 10.8.4. I accidentally did brew rm postgresql --force while the postgres server was running. When I installed using brew install postgresql and ran pg_ctl -D /usr/local/var/postgres start I get:

pg_ctl: another server might be running; trying to start server anyway
server starting
FATAL:  lock file "postmaster.pid" already exists                                                                       
HINT:  Is another postmaster (PID 752) running in data directory "/usr/local/var/postgres"?

当我运行ps -ef | grep postgres"时,我得到:

when I run "ps -ef | grep postgres" I get:

501   752   235   0 12:42PM ??         0:00.01 /usr/local/opt/postgresql/bin/postgres -D /usr/local/var/postgres -r /usr/local/var/postgres/server.log
501   754   752   0 12:42PM ??         0:00.00 postgres: checkpointer process       
501   755   752   0 12:42PM ??         0:00.34 postgres: writer process       
501   756   752   0 12:42PM ??         0:00.02 postgres: wal writer process       
501   757   752   0 12:42PM ??         0:00.01 postgres: autovacuum launcher process       
501   758   752   0 12:42PM ??         0:00.01 postgres: stats collector process       
501   945   452   0 12:58PM ttys000    0:00.00 grep postgres

当我尝试使用 pg_ctl stop -D/usr/local/var/postgres -m fastpg_ctl -D/usr/local/var/postgres stop 停止服务器时 -mi 我得到:

when I try to stop the server with pg_ctl stop -D /usr/local/var/postgres -m fast or pg_ctl -D /usr/local/var/postgres stop -mi I get:

waiting for server to shut down........................................... Failed
pg_ctl: server does not shut down

编辑

which pg_ctl
/usr/local/bin/pg_ctl
pg_ctl --version
pg_ctl (PostgreSQL) 9.2.4

server.log 的要点:https://gist.github.com/anonymous/6106182

推荐答案

原来我的 postgres brew.plist 需要在 ~/Library/LaunchAgents/卸载和删除.重启后一切正常……结束问题.

turns out that my brew.plist for postgres needed to be unloaded and removed at ~/Library/LaunchAgents/ . After a restart all is well... closing question.

这篇关于PostgreSQL 服务器不会停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆