1
我想更改postgres配置的以下參數,tcp_keepalives_count
,tcp_keepalives_idle
,tcp_keepalives_interval
。在postgres docker容器中更改tcp_keepalives設置的正確方法
什麼是推薦的方法來改變它們?
以下是我docker-compose.yml
postgres:
restart: always
image: postgres:latest
volumes:
- /data:/var/lib/postgresql
ports:
- "5432:5432"
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
UPDATE
最後我修改我docker-compose file
postgres:
restart: always
image: postgres:latest
container_name: postgres
volumes:
- /data:/var/lib/postgresql
ports:
- "5432:5432"
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
command: postgres -c tcp_keepalives_idle=60 -c tcp_keepalives_interval=60 -c tcp_keepalives_count=60
謝謝,@Elton,儘管我最終用'command'參數更改了我的docker-compose文件。我相信它會有同樣的效果,對吧? – kampta
是的,同樣的事情。 –