【问题标题】:Cannot run 'kong migrations bootstrap' ( Ident authentication failed for user "kong")无法运行“kong migrations bootstrap”(用户“kong”的身份验证失败)
【发布时间】:2021-01-18 04:11:42
【问题描述】:

我正在学习使用 Kong。我在centos 7上安装它。我按照https://docs.konghq.com/install/centos/的教程进行操作,我坚持

kong 迁移引导 [-c /path/to/kong.conf]

我已经按照这个教程在 Centos 上安装了 Postgres https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-centos-7

我也已经创建了kong数据库和用户

并且已经执行此命令为 kong 用户设置密码

ALTER USER kong WITH PASSWORD 'password';

这是我的 kong.conf

pg_host = 127.0.0.1
pg_port = 5432
pg_timeout = 5000
pg_user = kong
pg_password = password
pg_database = kong

当我执行命令 kong migrations bootstrap -c kong.conf 我会得到这个错误

错误:[PostgreSQL 错误] 无法检索 PostgreSQL server_version_num:致命:用户“kong”的身份验证失败

我在这上面浪费了大约 3-4 个小时。我真的需要帮助。

**编辑这是我的 pg_hba.conf

host    all             all             127.0.0.1/32            md5
host    all             all             ::1/128                 md5

附言。我在某处发现它,建议从

host    all             all             127.0.0.1/32            ident
host    all             all             ::1/128                ident

【问题讨论】:

  • 请将您的pg_hba.conf 的内容添加到您的问题中。
  • @AdrianKlaver 我添加了它。谢谢。
  • 不清楚你当前的pg_hba.conf文件是md5还是ident
  • 以下内容为原创。以上是我目前的内容
  • 您是否在进行更改后重新加载/重新启动 Postgres 服务器?

标签: postgresql centos kong


【解决方案1】:

对于 IPv4 本地连接:

host all all 127.0.0.1/32 trust
host all all 0.0.0.0/0 trust

我在它的工作中做了这个!

【讨论】:

  • 很好,但我会指出这意味着没有进行身份验证。它是localhost,这样可以限制潜在的损害。我仍然会弄清楚为什么password 不起作用。至少暂时将auth 改回 md5。然后为了排除故障,我将使用psql -h 127.0.0.1 -U kong -d kong 并跟踪 Postgres 日志以查看它的内容。
猜你喜欢
  • 2017-09-07
  • 1970-01-01
  • 2020-01-31
  • 1970-01-01
  • 2023-03-11
  • 1970-01-01
  • 2018-02-27
  • 1970-01-01
  • 2017-07-25
相关资源
最近更新 更多