【发布时间】:2013-03-13 21:55:39
【问题描述】:
我正在尝试从另一个程序建立与 postgres 的 JDBC 连接。
当我运行程序时,我收到以下错误:
[2013-03-24 03:14:10,542][ERROR][org.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource] 打开读取连接时:jdbc:postgresql://[我的 postgres 服务器的 ip 地址]:5432/[my database name] FATAL: 主机“[my client ip address]”,用户“postgres”,数据库“[my database name]”没有 pg_hba.conf 条目,SSL 关闭
我可以通过运行以下命令使用命令行客户端成功连接到服务器: psql -d [我的数据库名称] -U postgres -p 5432 -h [我的postgres服务器ip地址]
我认为我有一个可以工作的 unix 套接字连接,但需要在 pg_hba.conf 中启用 tcp 连接,但看起来我已经在下面的 pg_hba.conf 文件中允许了多个 tcp 连接......任何人都可以建议我可能做错了什么?
我的 pg_hba.conf 包含以下未注释的行:
hostssl all all 0.0.0.0/0 md5
host all all 10.0.0.0/8 md5
local all postgres peer
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
【问题讨论】:
标签: postgresql jdbc configuration tcp ssh