Ladder99 / ladder99

Ladder99 - connects factory devices to database and visualizations using MTConnect, an open standard.
https://mriiot.com
Apache License 2.0
27 stars 10 forks source link

pgAdmin cannot connect to db #235

Closed robot-ranger closed 11 months ago

robot-ranger commented 11 months ago

im trying to use pgadmin, but i cant seem to connect to the db.

i can see the docker service running:

CONTAINER ID   IMAGE                                    COMMAND                  CREATED             STATUS             PORTS                                                           NAMES
f7cd0e3bea64   timescale/timescaledb:2.7.0-pg13         "docker-entrypoint.s…"   About an hour ago   Up About an hour   127.0.0.1:5432->5432/tcp                                        postgres

but i cant seem to connect from the pgadmin dashboard at [my_ip]:5050. I also cannot connect from dBeaver on a windows machine.

there is data in grafana, so i assume the db is working....

Should the ports for postgres container show 127.0.0.1? from my experience, i have better luck using 0.0.0.0 to expose ports in docker containers, but i will admit i dont know enough about container networking to know why or if that is just a symptomatic treatment as opposed to the root cause

ETA: i am getting connection refused; so im thinking this is a networking issue

ottobolyos commented 11 months ago

127.0.0.1 here means you can access it locally (on the server) only. You should use postgres hostname and 5432 as port, as both pgadmin and postgres/db containers are in the same network. This is Docker thing and you could change it in the Docker Compose file.

robot-ranger commented 11 months ago

ty ty. works w/ postgres as hostname

it was one of those feelings where i knew my knowledge was not complete.

ottobolyos commented 11 months ago

I suggest reading the docs, in this case this.

robot-ranger commented 11 months ago

I suggest reading the docs, in this case this.

I appreciate that - but in this case, ladder99 has black-boxed a little bit of this. the docker-compose.yml is VERY thin and its not readily apparent where all of the services are getting their configs from

ottobolyos commented 11 months ago

Indeed. There three Docker Compose files basically and two config files.