Closed parallaxview closed 4 months ago
Check your customPostgres.conf file (the only one you didnt post) as the postgres logs show that it's only listening internally on the container.
127.0.0.1\", port 5432
You currently need to make sure that your listen addresses exists in that file.
# Listen beyond localhost
listen_addresses = '*'
Yup - it is set:
# - Connection Settings -
listen_addresses = '*'
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
EDIT- I was looking at the postgresql.conf not custom... didn't know it needed to be added there...
Added at the end but same issue persists.
customPostgresql.conf:
# DB Version: 15
# OS Type: linux
# DB Type: web
# Total Memory (RAM): 1 GB
# CPUs num: 1
# Connections num: 200
# Data Storage: ssd
max_connections = 200
shared_buffers = 256MB
effective_cache_size = 768MB
maintenance_work_mem = 64MB
checkpoint_completion_target = 0.9
wal_buffers = 7864kB
default_statistics_target = 100
random_page_cost = 1.1
effective_io_concurrency = 200
work_mem = 655kB
min_wal_size = 1GB
max_wal_size = 4GB
listen_addresses = '*'
What does your docker-compose.yml file look like?
volumes:
- ./volumes/postgres:/var/lib/postgresql/data:Z
- ./customPostgresql.conf:/etc/postgresql.conf
command: 'postgres -c config_file=/etc/postgresql.conf'
Also, did you docker compose down postgres && docker compose up -d postgres
after updating customPostgresql.conf?
docker-compose.yml:
postgres:
image: docker.io/postgres:15-alpine
hostname: postgres
environment:
{% if postgres_env_vars is defined and postgres_env_vars|length > 0 %}
{% for item in postgres_env_vars %}
{% for key, value in item.items() %}
- {{ key }}={{ value }}
{% endfor %}
{% endfor %}
{% endif %}
volumes:
- ./volumes/postgres:/var/lib/postgresql/data:Z
- ./customPostgresql.conf:/etc/postgresql.conf
restart: always
command: postgres -c config_file=/etc/postgresql.conf
shm_size: 1g
logging: *default-logging
I re-deployed via the ansible commands.
Yep that looks all fine.
I re-deployed via the ansible commands
Unfortunately that does not mean postgres re-read the configuration. What does your postgres logs show now? When setup correctly, it should show:
LOG: listening on IPv4 address "0.0.0.0", port 5432
Well that seems to be the problem:
LOG: listening on IPv4 address "127.0.0.1", port 5432
I blew away the container and then re-deployed which fixed it! Thanks much for the help!
Using the 1.4.0 version of the ansible script on a debian servcer, the created postgres docker container looks like it is working but is not allowing incoming connections. I can psql from inside the container with no issue, and I have listen_addresses = '*' set in my postgresql.conf file. I am stuck as to ideas on this one...
Lemmy Log:
Postgres log:
netstat -tulnp:
config.hjson:
vars.yml: