Navicat Premium远程连接GP(Greenplum)集群 解决FATAL:no pg_hba.conf entry for host "172.20.20.2"问题

Navicat Premium远程连接GP(Greenplum)集群并解决FATAL:  no pg_hba.conf entry for host "172.20.20.2", user "gpadmin", database "ddata", SSL off问题

1、使用环境

(1)客户端:MacOS版Navicat Premium 12.0.19

(2)服务端:Greenplum Version: postgres (Greenplum Database) 4.3.8.2 build 1

2、配置方法

(1)在配置文件pg_hba.conf中添加客户端的ip地址,按照以下格式:

# IPv4 local connections:
# IPv6 local connections:
# standby master host ip addresses

host     all         gpadmin         172.20.20.2/32     trust

备注:pg_hba.conf文件的路径通过find查找即可,我的位于/hdfs/data1/gpdata/master/gpseg-1/pg_hba.conf。gpadmin用户是部署GP集群时创建的账户。


(2)切换到gpadmin,执行gpstop -u

[root@gpm ~]# su - gpadmin

[gpadmin@gpm ~]$ gpstop -u
20171213:17:17:16:012774 gpstop:gpm:gpadmin-[INFO]:-Starting gpstop with args: -u
20171213:17:17:16:012774 gpstop:gpm:gpadmin-[INFO]:-Gathering information and validating the environment...
20171213:17:17:16:012774 gpstop:gpm:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20171213:17:17:16:012774 gpstop:gpm:gpadmin-[INFO]:-Obtaining Segment details from master...
20171213:17:17:16:012774 gpstop:gpm:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.3.8.2 build 1'
20171213:17:17:16:012774 gpstop:gpm:gpadmin-[INFO]:-Signalling all postmaster processes to reload

[gpadmin@gpm ~]$ 


备注:gpstop -u的意思是将pg_hba.conf文件重新上传并运行master中的postgresql.conf 文件的参数,期间不会中断服务。已建立连接的用户将不会使用最新配置,重连后将应用最新。起到了使刚刚修改的pg_hba.conf配置文件生效的作用。


(3)此时配置Navicat Premium远程连接该GP(GreenPlum)集群,创建新的连接选择PostgreSQL即可。

因为GreenPlum官网介绍说:Database users interact with Greenplum Database as they would a regular PostgreSQL DBMS.可以像与Postgresql交互那样与GP交互,所以这里选择Postgresql就好了。

Greenplum Database is based on PostgreSQL open-source technology. It is essentially several PostgreSQL database instances acting together as one cohesive database management system (DBMS). It is based on PostgreSQL 8.2.15, and in most cases is very similar to PostgreSQL with regard to SQL support, features, configuration options, and end-user functionality. Database users interact with Greenplum Database as they would a regular PostgreSQL DBMS.




你可能感兴趣的:(Navicat Premium远程连接GP(Greenplum)集群 解决FATAL:no pg_hba.conf entry for host "172.20.20.2"问题)