Bom dia mestre, surgiu uma duvida referente a aula 3 de "tuning de banco" onde vc inicia a aula dentro do servidor postgres, porem como montei um laboratório docker e suvi ima imagem postgres igual está na aula, após eu fazer o comando "pg_clt stop" ele derruba a imagem do postgres na docker, como seria possível acessar o servidor como vc esta acessando na aula se dar restart através da docker?
Conf do arquivo "postgresql.conf"
postgres@ba781188b3d3:~/data$ cat postgresql.conf | grep -v '#' | grep -ve '^$'
listen_addresses = '*'
max_wal_size = 1GB
min_wal_size = 80MB
log_connections = on
log_timezone = 'Etc/UTC'
datestyle = 'iso, mdy'
timezone = 'Etc/UTC'
default_text_search_config = 'pg_catalog.english'
log_destination=stderr
Comandos executados:
root@ba781188b3d3:/# su postgres
postgres@ba781188b3d3:/$ pg_ctl status -D /var/lib/postgresql/data/
pg_ctl: server is running (PID: 1)
/usr/lib/postgresql/16/bin/postgres
postgres@ba781188b3d3:/$ pg_ctl start -D /var/lib/postgresql/data/ -l /tmp/pg.log
pg_ctl: another server might be running; trying to start server anyway
waiting for server to start.... stopped waiting
pg_ctl: could not start server
Examine the log output.
postgres@ba781188b3d3:/$ pg_ctl stop -D /var/lib/postgresql/data/
waiting for server to shut down....cmopr@CMSU16:~$
postgres@ba781188b3d3:~/data$ tail -f /tmp/pg.log
2024-03-07 12:27:08.147 UTC [45] FATAL: lock file "postmaster.pid" already exists
2024-03-07 12:27:08.147 UTC [45] HINT: Is another postmaster (PID 1) running in data directory "/var/lib/postgresql/data"?
postgres@ba781188b3d3:/$ cat /tmp/pg.log
2024-03-07 12:27:08.147 UTC [45] FATAL: lock file "postmaster.pid" already exists
2024-03-07 12:27:08.147 UTC [45] HINT: Is another postmaster (PID 1) running in data directory "/var/lib/postgresql/data"?
2024-03-07 12:42:35.168 UTC [90] FATAL: lock file "postmaster.pid" already exists
2024-03-07 12:42:35.168 UTC [90] HINT: Is another postmaster (PID 1) running in data directory "/var/lib/postgresql/data"?
2024-03-07 12:49:17.598 UTC [115] FATAL: lock file "postmaster.pid" already exists
2024-03-07 12:49:17.598 UTC [115] HINT: Is another postmaster (PID 1) running in data directory "/var/lib/postgresql/data"?
2024-03-07 12:58:39.116 UTC [48] FATAL: lock file "postmaster.pid" already exists
2024-03-07 12:58:39.116 UTC [48] HINT: Is another postmaster (PID 1) running in data directory "/var/lib/postgresql/data"?
postgres@ba781188b3d3:/$ tail -f /tmp/pg.log
2024-03-07 12:27:08.147 UTC [45] FATAL: lock file "postmaster.pid" already exists
2024-03-07 12:27:08.147 UTC [45] HINT: Is another postmaster (PID 1) running in data directory "/var/lib/postgresql/data"?
2024-03-07 12:42:35.168 UTC [90] FATAL: lock file "postmaster.pid" already exists
2024-03-07 12:42:35.168 UTC [90] HINT: Is another postmaster (PID 1) running in data directory "/var/lib/postgresql/data"?
2024-03-07 12:49:17.598 UTC [115] FATAL: lock file "postmaster.pid" already exists
2024-03-07 12:49:17.598 UTC [115] HINT: Is another postmaster (PID 1) running in data directory "/var/lib/postgresql/data"?
2024-03-07 12:58:39.116 UTC [48] FATAL: lock file "postmaster.pid" already exists
2024-03-07 12:58:39.116 UTC [48] HINT: Is another postmaster (PID 1) running in data directory "/var/lib/postgresql/data"?
Obs: Um detalhe que esqueci de mencionar, estou me conectando com o servidor via browser, não sei se isso faz diferença, seguem mais detalhes detalhes do que tenho rodando na docker
cmopr@CMSU16:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8a815eb1b569 dpage/pgadmin4 "/entrypoint.sh" 3 weeks ago Up 19 hours 443/tcp, 0.0.0.0:15432->80/tcp, :::15432->80/tcp meu-pgadmin
ba781188b3d3 postgres "docker-entrypoint.s…" 3 weeks ago Up About a minute 0.0.0.0:5433->5432/tcp, :::5433->5432/tcp my_post4