Changing configuration with Docker
When running TimescaleDB via a Docker container, there are two approaches to modifying your PostgreSQL configuration. In the following example, we modify the size of the database instance’s write-ahead-log (WAL) from 1GB to 2GB in a Docker container named timescaledb
.
Modifying postgres.conf inside Docker
- Get into a shell in Docker in order to change the configuration on a running container.
docker start timescaledb
docker exec -i -t timescaledb /bin/bash
- Edit and then save the config file, modifying the setting for the desired configuration parameter (e.g.,
max_wal_size
).
vi /var/lib/postgresql/data/postgresql.conf
- Restart the container so the config gets reloaded.
docker restart timescaledb
- Test to see if the change worked.
docker exec -it timescaledb psql -U postgres
postgres=# show max_wal_size;
max_wal_size
--------------
2GB
Specify configuration parameters as boot options
Alternatively, one or more parameters can be passed in to the docker run
command via a -c
option, as in the following.
docker run -i -t timescale/timescaledb:latest-pg10 postgres -cmax_wal_size=2GB
Additional examples of passing in arguments at boot can be found in our discussion about using WAL-E for incremental backup.
当前内容版权归 TimescaleDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 TimescaleDB .