启动 PotgreSQL 时出现奇怪的日志条目

启动 PotgreSQL 时出现奇怪的日志条目

重新启动 pgSQL 时,我收到以下日志条目:

2010-02-10 16:08:05 EST LOG:  received smart shutdown request
2010-02-10 16:08:05 EST LOG:  autovacuum launcher shutting down
2010-02-10 16:08:05 EST LOG:  shutting down
2010-02-10 16:08:05 EST LOG:  database system is shut down
2010-02-10 16:08:07 EST LOG:  database system was shut down at 2010-02-10 16:08:05 EST
2010-02-10 16:08:07 EST LOG:  autovacuum launcher started
2010-02-10 16:08:07 EST LOG:  database system is ready to accept connections
2010-02-10 16:08:07 EST LOG:  connection received: host=[local]
2010-02-10 16:08:07 EST LOG:  incomplete startup packet
2010-02-10 16:08:07 EST LOG:  connection received: host=[local]
2010-02-10 16:08:07 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:08 EST LOG:  connection received: host=[local]
2010-02-10 16:08:08 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:08 EST LOG:  connection received: host=[local]
2010-02-10 16:08:08 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:09 EST LOG:  connection received: host=[local]
2010-02-10 16:08:09 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:09 EST LOG:  connection received: host=[local]
2010-02-10 16:08:09 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:10 EST LOG:  connection received: host=[local]
2010-02-10 16:08:10 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:10 EST LOG:  connection received: host=[local]
2010-02-10 16:08:10 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:11 EST LOG:  connection received: host=[local]
2010-02-10 16:08:11 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:11 EST LOG:  connection received: host=[local]
2010-02-10 16:08:11 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:12 EST LOG:  connection received: host=[local]
2010-02-10 16:08:12 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:12 EST LOG:  connection received: host=[local]
2010-02-10 16:08:12 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:12 EST LOG:  connection received: host=[local]
2010-02-10 16:08:12 EST LOG:  incomplete startup packet

关于此问题的潜在后果,我的问题发布在这里:https://stackoverflow.com/questions/2238954/mdb2-says-connection-failed-db-logs-say-otherwise,但是当我问这个问题时我并没有意识到这种情况的发生,我认为这部分问题出在 SF 身上。

编辑:我可以连接到数据库并使用 psql CLI 和 postgres 用户正常操作。

答案1

你有什么问题?

您的服务器启动正常 - “数据库系统已准备好接受连接”

一旦准备就绪,就会出现多次使用无效密码的“postgres”帐户进行连接尝试,这些尝试似乎来自本地服务器。

如果您询问这些条目,而他们不是您本人,则看起来有人正在对 PostgreSQL 进行字典攻击。奇怪的是,这些连接似乎来自本地主机,因此他们可能在伪造其源地址。

我建议安装防火墙来限制仅需要访问的 IP。

如果您正在寻找其他问题的答案,则需要更具体一些。

答案2

这看起来很像是两件事的结合:

- 您的 pg_hba.conf 不允许本地用户“postgres” - 您的 rc.d 脚本尝试通过以用户“postgres”身份连接到本地数据库来获取数据库状态,以确认启动

我建议检查 rc 脚本。如果您发现确实发生了这种情况,请修改脚本以提供密码或修改 pg_hba.conf 以信任该用户。重新启动并查看错误是否消失...

答案3

在 stackoverflow 上也有人回答了这个问题:https://stackoverflow.com/questions/7038342/password-authentication-failed-for-user-postgres

第一个答案来自 Berry Langerak,它为我解决了这个问题。

相关内容