用户 "ckan_default" 的身份验证失败

Ident authentication failed for user "ckan_default"

我正在尝试通过 yum 在 RHEL 7 上使用 Apache SOLR 7.4、Postgresql 9.2.23 和所有其他要求获取 CKAN(最新 - 2.8.1)运行 作为最新版本。

我创建 ckan_default 用户和数据库没有问题。但是,当我进行到这一步时:

paster db init -c /etc/ckan/default/production.ini 

我收到身份验证错误。

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL:  Ident authentication failed for user "ckan_default"

我想也许我输入的密码很糟糕,但我已经两次吹走了postgres并且非常小心地输入了ckan_default密码。

所有先决条件都工作正常,我已经独立测试了它们。

最疯狂的是,我一个月前刚设置好,没问题。但是我确实使用了 CKAN 2.8.0 和 SOLR 6.3.0。我想使用最新的 SOLR,因为现在不支持 6.3。不过,这似乎不是 SOLR 问题。

我已经在这里和其他地方彻底搜索了解决方案,但我无法弄清楚。

错误消息提到 'Ident authentication',但听起来您需要密码验证。为您的 pg_hba.conf 文件试试这个:

# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
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

现在重新启动 postgres 并重试。