hive:没有主机的pg_hba.conf条目

jvidinwx  于 2021-06-26  发布在  Hive
关注(0)|答案(1)|浏览(425)

我正在尝试为配置单元设置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 (centos 7版):

host   hive   hive     192.168.0.10    trust

但我又犯了一个错误:
postgresql.service的作业失败,因为控制进程退出,错误代码为。有关详细信息,请参阅“systemctl status postgresql.service”和“journalctl-xe”。

093gszye

093gszye1#

我试过了,而且很管用。在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

相关问题