部署 重启服务器无法连接上 Postgres 数据库

helapu · 2017年06月28日 · 1971 次阅读

服务器为青云上的 ubuntu 服务器 环境

ubuntu 16.04
RoR 5.1.1
Ruby 2.4
Postgres 9.4

本来已经部署 OK 了,正常运行。修复一个 bug 后,重启了服务器了。然后就报数据库无法连接

PG::ConnectionBad (could not connect to server: Connection refused
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

搜索到了一些类似问题,但跟我不一样。https://stackoverflow.com/questions/19828385/pgconnectionbad-could-not-connect-to-server-connection-refused 大概知道是 postgres 防止重复连接,我居然尝试了重启数据库,但是还是不行! 重启服务器使用的是

RAILS_ENV=production pumactl restart
#  也试过关闭了再启动
RAILS_ENV=production pumactl start

大概知道 pumactl 不会断掉数据库的连接吧,但是 mysql 是没有类似的问题的。不知道各位有知道相关信息的吗

暂无回复。
需要 登录 后方可回复, 如果你还没有账号请 注册新账号