connect to postgres server on google compute engine

前端 未结 2 1295
没有蜡笔的小新
没有蜡笔的小新 2021-01-20 19:07

I have searched for this everywhere but after an hour and a half of searching I\'ve not found anything relevant.

How do I connect to a database on my google compute

2条回答
  •  梦谈多话
    2021-01-20 19:11

    You need to:

    • 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

提交回复
热议问题