简体   繁体   中英

PostgreSQL Can't connect to remote server running under root

I have a postgresql server up and running under root. It's in a docker container and the exposed port is 5434. My API docker container is able to connect to this server, but I can't access it from my local machine, the connection is getting timed out.

Here's the output of the command ps -elf|grep root

4 S root     15264  5623  0  80   0 -  2128 -      Jan25 ?        00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 5434 -container-ip 172.18.0.5 -container-port 5432

现在Postgres在Docker容器中运行,您的IP不再是本地的,因此您需要更新服务器的pg_hba.conf ,以允许来自您访问Postgres的网络的连接。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM