客户端接口和程序
配置客户端认证
允许连接到GPDB,在Master节点上编辑pg_hba.conf 文件
1) 依次查看Master节点和Slave节点中该文件:
[gpadmin@master gpseg-1]$ pwd /data/master/gpseg-1 [gpadmin@master gpseg-1]$ cat pg_hba.conf # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only # IPv4 local connections: # IPv6 local connections: local all gpadmin ident host all gpadmin 127.0.0.1/28 trust host all gpadmin 192.168.80.200/24 trust host all gpadmin ::1/128 trust host all gpadmin fe80::20c:29ff:fe9d:3bd6/128 trust |
[gpadmin@slave1 gpseg0]$ pwd /data/primary/gpseg0 [gpadmin@slave1 gpseg0]$ cat pg_hba.conf # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/24 trust # IPv6 local connections: host all all ::1/128 trust host all all ::1/128 trust host all all 192.168.80.200/32 trust host all all fe80::20c:29ff:fe9d:3bd6/128 trust host all gpadmin 192.168.80.201/32 trust host all gpadmin ::1/128 trust host all gpadmin fe80::250:56ff:fe24:a00/128 trust |
2) 编辑文件,示例文件如下所示:
# allow the gpadmin user local access to all databases 允许gpadmin用户连接本机所有数据库 # using ident authentication local all gpadmin ident sameuser host all gpadmin 127.0.0.1/32 ident host all gpadmin ::1/128 ident host all dba 192.168.0.0/32 md5 host all all 192.168.0.0/32 ldap ldapserver=usldap1 ldapport=1389 ldapprefix="cn=" ldapsuffix=",ou=People,dc=company,dc=com” |
3) 保存并关闭文件
4) 重新加载pg_hba.conf使修改生效
-u (reload pg_hba.conf and postgresql.conf files only)
This option reloads the pg_hba.conf files of the master and segments and the runtime parameters of the postgresql.conf files but does not shutdown the Greenplum Database array. Use this option to make new configuration settings active after editing postgresql.conf or pg_hba.conf. Note that this only applies to configuration parameters that are designated as runtime parameters. |
[gpadmin@master gpseg-1]$ gpstop -u 20150324:22:44:04:008787 gpstop:master:gpadmin-[INFO]:-Starting gpstop with args: -u 20150324:22:44:04:008787 gpstop:master:gpadmin-[INFO]:-Gathering information and validating the environment... 20150324:22:44:04:008787 gpstop:master:gpadmin-[INFO |