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

helapu · June 28, 2017 · 1972 hits

服务器为青云上的 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 是没有类似的问题的。不知道各位有知道相关信息的吗

No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.