本文介绍了连接到Google计算引擎上的Postgres服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我到处都搜索过此内容,但是经过一个半小时的搜索后,我没有发现任何相关内容。
I have searched for this everywhere but after an hour and a half of searching I've not found anything relevant.
如何连接到我的数据库谷歌计算引擎?即我想使用笔记本电脑中的pgadmin3连接到在Google计算引擎上运行的Postgres服务器。
How do I connect to a database on my google compute engine? i.e I want to connect to the postgres server running on my google compute engine using pgadmin3 from my laptop.
这甚至有可能吗?如果是这样,我该怎么办?
Is this even possible? If so how do I go about it?
谢谢!
推荐答案
您需要:
- 确保Postgres正在侦听TCP流量(您可以通过连接到实例并运行
netstat -ntpl 进行检查。 code>)。通常,Postgres将在端口5432上进行监听。
- 确保没有本地防火墙阻止实例上Postgres端口的通信(您可以运行
iptables -L
) - 确保没有GCE防火墙阻止从IP到Postgres端口的实例通信。您应该阅读,尤其是防火墙部分
- Ensure Postgres is listening for TCP traffic (you can check that by connecting to your instance and running
netstat -ntpl
). Usually, Postgres will be listening on port 5432. - Ensure there is no local firewall blocking traffic to Postgres' port on the instance (you can run
iptables -L
) - Ensure there is no GCE firewall blocking traffic to your instance on Postgres' port from your IP. You should read this documentation page, and specifically the "firewalls" section
这篇关于连接到Google计算引擎上的Postgres服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!