【发布时间】:2014-06-27 01:17:37
【问题描述】:
我在创建与 PostgreSQL 9.2 服务器的 PostgreSQL JDBC 连接时收到 FATAL: the database system is shutting down 错误。我从 JDBC 得到的具体异常路径在这里:
Caused by: org.postgresql.util.PSQLException: FATAL: the database system is shutting down
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:398)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:173)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:64)
at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:136)
at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:29)
at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:21)
at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:31)
at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
at org.postgresql.Driver.makeConnection(Driver.java:393)
at org.postgresql.Driver.connect(Driver.java:267)
从各种日志文件(来自 PostgreSQL,来自我们的管理层,来自使用 PostgreSQL 的应用程序),我没有看到任何实际发生的数据库关闭(其他连接像往常一样创建到 PostgreSQL,没有从我们的管理层启动关闭等),但是在 PostgreSQL 服务器日志中,我确实看到了具有相同时间戳的错误消息:
2014-06-16 12:30:00.736 GMT LOG: connection received: host=127.0.0.1 port=38530
2014-06-16 12:30:00.737 GMT FATAL: the database system is shutting down
上网查了一下,得知PostgreSQL关闭连接的时候都会出现这个错误信息。
为什么 PostgreSQL 会拒绝给我一个新的连接?这可能是由某种资源争用引起的吗?如何从 PostgreSQL 本身获取有关错误的更多信息?
【问题讨论】:
-
进一步查看数据库服务器日志以了解它被关闭的原因。你用了
pg_ctl stop什么的? -
PostgreSQL 安装端口是什么???
标签: postgresql jdbc postgresql-9.2