pg无法登陆

远程登陆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博客 ” ,链接:http://blog.itpub.net/29989552/viewspace-2123043/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29989552/viewspace-2123043/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值