【发布时间】:2016-12-06 21:37:03
【问题描述】:
我的 Window 系统上有 PGADMIN 3。我无法连接到 Virtualbox-Centos 机器下的 Greenplum-Postgresql。在 Virtualbox 中,我可以使用 psql 创建数据库,但不能使用 windows 机器上的 pgadmin。
请建议我现在应该做什么。
【问题讨论】:
标签: postgresql greenplum
我的 Window 系统上有 PGADMIN 3。我无法连接到 Virtualbox-Centos 机器下的 Greenplum-Postgresql。在 Virtualbox 中,我可以使用 psql 创建数据库,但不能使用 windows 机器上的 pgadmin。
请建议我现在应该做什么。
【问题讨论】:
标签: postgresql greenplum
您也可能没有 gpadmin 数据库。从这个开始:
psql template1 -c "select * from pg_database where datname = 'gpadmin'"
如果数据库不存在,请执行以下操作:
psql template1 -c "create database gpadmin"
接下来,执行此操作以允许使用加密密码进行身份验证的外部连接:
echo "host all all 0.0.0.0/0 md5" >> $MASTER_DATA_DIRECTORY/pg_hba.conf
psql -c "alter user gpadmin password 'password'"
gpstop -u
返回 pgAdmin,以用户 gpadmin、密码“password”和端口 5432 连接到您的虚拟机(使用 ifconfig 获取 IP 地址)。
【讨论】:
GPDB/Postgresql 默认拒绝远程访问。您需要将 ACL 添加到 $MASTER_DATA_DIRECTORY 中的 pg_hba.conf,即 /data/master/gpseg-1/pg_hba.conf。 参考 https://www.postgresql.org/docs/8.2/static/auth-pg-hba-conf.html 或者 http://gpdb.docs.pivotal.io/43100/admin_guide/client_auth.html 了解详情
【讨论】:
如果您粘贴确切的错误会很好。
确保iptables 和ip6tables 没有运行。运行以下命令进行检查
service iptables statusservice ip6tables status【讨论】: