我正在尝试为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
但后来又出现了另一个错误:
postgresql.service的作业失败,因为控制进程已退出 有错误代码。参见" systemctl status postgresql.service"和 " journalctl -xe"详情。
答案 0 :(得分:0)
我尝试了这个及其工作。 在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