简体   繁体   English

无法通过 dockerized pgAdmin 连接到 dockerized Postgres

[英]Cannot connect to dockerized Postgres through dockerized pgAdmin

I have a docker-compose file:我有一个 docker-compose 文件:

version: '3'

services:
  db:
    image: postgres
    ports:
      - "5432:5432"
    environment:
        POSTGRES_DB: ayyy
        POSTGRES_USER: letsgo
        POSTGRES_PASSWORD: pwpwpwpw22
  pgadmin:
    image: dpage/pgadmin4
    environment:
        PGADMIN_DEFAULT_EMAIL: user@example.com
        PGADMIN_DEFAULT_PASSWORD: pwpwpwpw1
    ports:
      - "5433:80"

(I changed the environment variables to not spoof my credentials) (我更改了环境变量以不欺骗我的凭据)

However I am unable to connect to my Postgres server through pgAdmin.但是我无法通过 pgAdmin 连接到我的 Postgres 服务器。 pgAdmin is using reverse proxy from port 5433 to my subdomain pgadmin.domain.com . pgAdmin 正在使用从端口 5433 到我的子域pgadmin.domain.com反向代理。 I am also reverse proxying HTTP from pgAdmin's container into HTTPS.我还将 HTTP 从 pgAdmin 的容器反向代理到 HTTPS。 (I do not know if that could be an issue) (不知道会不会有问题)

This is the error I get:这是我得到的错误:

Unable to connect to server: connection to server at "db" (192.168.32.3), port 5432 failed: timeout expired无法连接到服务器:在“db”(192.168.32.3)处连接到服务器,端口 5432 失败:超时已过期

If I use localhost as a hostname, I get this:如果我使用localhost作为主机名,我会得到:

Unable to connect to server: connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused Is the server running on that host and accepting TCP/IP connections?无法连接到服务器:在“localhost”(127.0.0.1)上连接到服务器,端口 5432 失败:连接被拒绝 服务器是否在该主机上运行并接受 TCP/IP 连接? connection to server at "localhost" (::1), port 5432 failed: Address not available Is the server running on that host and accepting TCP/IP connections?在“localhost”(::1) 上连接到服务器,端口 5432 失败:地址不可用 服务器是否在该主机上运行并接受 TCP/IP 连接?

UPDATE: I am not even able to ping the containers between each other.更新:我什至无法在彼此之间 ping 容器。 The service name is correctly resolved to IP, but I get no response.服务名称已正确解析为 IP,但我没有收到任何响应。

I was even unable to open ports on my server, so I reinstalled it.我什至无法在我的服务器上打开端口,所以我重新安装了它。 Everything works as it should since then.从那时起,一切都按原样运行。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法使用psql连接到dockerized postgres - Cannot connect with psql to dockerized postgres 如何通过 pgadmin docker 容器恢复 postgres 转储(dockerized postgres) - How to restore postgres dump through pgadmin docker container (dockerized postgres) Dockerized Node App 无法连接到 Dockerized Postgres 数据库 - Dockerized Node App unable to connect to Dockerized Postgres Database 如何将dockerized的spring boot应用程序连接到dockerized的postgres - How to connect dockerized spring boot app to dockerized postgres 将dockerized pgadmin作为服务运行 - Running dockerized pgadmin as a service 无法将Dockerized Spring Boot应用程序连接到Dockerized Postgre SQL - Cannot connect dockerized spring boot app to dockerized postgre sql 从 Windows Docker 主机连接到 dockerized postgres - Connect to dockerized postgres from Windows Docker host 我的后端应用程序无法连接到服务器上的 dockerized postgres 数据库,但在我的本地系统中它可以连接 - My backend app cannot connect to the dockerized postgres database on the server but in my local system it can connect 如何使用相同的 DATABASE_HOST 从 dockerized django 和非 dockerized django 将 django 应用程序连接到 dockerized postgres db - How to connect a django app to a dockerized postgres db, both from a dockerized django and non-dockerized django using same DATABASE_HOST dockerized postgres 和 dockerized Spring boot 应用程序 - dockerized postgres and dockerized Spring boot app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM