ITPub博客

首页 > 大数据 > 数据挖掘 > pg无法登陆

pg无法登陆

原创 数据挖掘 作者:orclwujian 时间:2016-08-05 15:00:12 0 删除 编辑
远程登陆GP的时候无法登陆
[gpadmin@gp-master ~]$ psql -h172.30.248.18 -p5432 -dpostgres -Upgadmin
psql: FATAL:  no pg_hba.conf entry for host "172.30.248.18", user "pgadmin", database "postgres", SSL off

原因:pg对IP控制很严,需要在pg_hba.conf中设置信任的IP地址信息才可以登陆,以下是pg_hba.conf文件信息
local    all         gpadmin         ident
host     all         gpadmin         127.0.0.1/28    trust
host     all         gpadmin         172.30.248.18/32       trust
host     all         gpadmin         ::1/128       trust
host     all         gpadmin         fe80::f816:3eff:fe15:2242/128       trust
local    replication gpadmin         ident
host     replication gpadmin         samenet       trust

在pg_hba.conf配置文件中加入
host     all         all             0.0.0.0/0 trust  允许所有IP登陆数据库
修改完后不是即时生效需要,需要重新加载配置
[gpadmin@gp-master ~]$ gpstop -u
20160720:09:51:12:006711 gpstop:gp-master:gpadmin-[INFO]:-Starting gpstop with args: -u
20160720:09:51:12:006711 gpstop:gp-master:gpadmin-[INFO]:-Gathering information and validating the environment...
20160720:09:51:12:006711 gpstop:gp-master:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20160720:09:51:12:006711 gpstop:gp-master:gpadmin-[INFO]:-Obtaining Segment details from master...
20160720:09:51:13:006711 gpstop:gp-master:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.3.8.0 build 1'
20160720:09:51:13:006711 gpstop:gp-master:gpadmin-[INFO]:-Signalling all postmaster processes to reload
再次连接,成功

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29989552/viewspace-2123043/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: greenplum安装部署
请登录后发表评论 登录
全部评论

注册时间:2014-10-29

  • 博文量
    95
  • 访问量
    322690