gpt4 book ai didi

postgresql - 配置单元:主机没有 pg_hba.conf 条目

转载 作者:行者123 更新时间:2023-11-29 13:45:05 31 4
gpt4 key购买 nike

我正在尝试为 Hive 设置 PostgreSQL。这是 /var/lib/pgsql/data/pg_hba.conf 的内容:

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local all postgres trust
# IPv4 local connections:
host all postgres 127.0.0.1/32 trust
# IPv6 local connections:
host all postgres ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 ident
#host replication postgres ::1/128 ident

local all ambari,mapred md5
host all ambari,mapred 0.0.0.0/0 md5
host all ambari,mapred ::/0 md5

当我检查连接时,出现错误:

2018-04-15 23:48:49,573 - Check db_connection_check was unsuccessful. Exit code: 1. Message: Apr 15, 2018 11:48:49 PM org.postgresql.core.v3.ConnectionFactoryImpl log
WARNING: SQLException occurred while connecting to master1.local.test.org:5432
org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "192.168.0.10", user "hive", database "hive", SSL off

我尝试向 /var/lib/pgsql/data/pg_hba.conf 添加新行并使用 systemctl restart postgresql 重新启动 PostgreSQL (Centos 7):

host   hive   hive     192.168.0.10    trust

但是我又遇到了另一个错误:

Job for postgresql.service failed because the control process exited with error code. See "systemctl status postgresql.service" and "journalctl -xe" for details.

最佳答案

我尝试了这个并且它起作用了。在 IP 地址后给出子网。

例如

host    all   postgre           IP-Adress/subnet         trust
host all postgres IP-Adress/subnet trust

host all hive IP-Adress/subnet trust
host all hive IP-Adress/subnet trust

关于postgresql - 配置单元:主机没有 pg_hba.conf 条目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49852064/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com