Default config should be more persistent
Current Docker config does not have persistent storage configured, and may lose data unexpectedly. This issue is being opened to suggest adding default volumes with a docker-config like this:
services:
master:
container_name: "${COMPOSE_PROJECT_NAME:-citus}_master"
image: 'citusdata/citus:7.5.1'
ports: ["${MASTER_EXTERNAL_PORT:-5432}:5432"]
labels: ['com.citusdata.role=Master']
volumes:
- pgdata_master:/var/lib/postgresql/data
worker:
image: 'citusdata/citus:7.5.1'
labels: ['com.citusdata.role=Worker']
depends_on: { manager: { condition: service_healthy } }
volumes:
- pgdata_worker:/var/lib/postgresql/data
manager:
container_name: "${COMPOSE_PROJECT_NAME:-citus}_manager"
image: 'membership_manager_test'
volumes: ['/var/run/docker.sock:/var/run/docker.sock']
depends_on: { master: { condition: service_healthy } }
volumes:
pgdata_master:
pgdata_worker:
Will above work fine if there are more than one worker nodes? (Using docker-compose -p citus scale worker=2)
@chrismark : This solution should work with an arbitrary number of worker nodes
There seems to be an issue when I started it with --scale worker=2, successfully create distributed table, then do a docker-compose down, then when I re-started it up with --scale worker=2 again and run select * from distributed_table it errors out with relation "foo_XXXX" does not exist. Both workers have the same shards.
I'll investigate this, but maybe this is just a documentation issue; these images and configuration are not production-ready; they're for getting a taste of Citus and/or maybe building a local development environment. If there's a bug that would make sense to fix, but if there's some missing functionality that's mostly just a need for robustness/restartability, etc., the urgency would be less.
Hi @jasonmp85 Just wanted to check if this issue is resolved on citus docker. We wanted to use citus for a small production use case, however we have uncovered that citus running on Kubernetes is not able to persist the data even after PVC is attached to it. We loose the data as soon as the k8 pod restarts. Could you please confirm if this a known bug in citus docker and there is no fix for this. I am not sure if I am missing out on something as this seems to be a too big a issue to be true with a Database
Hi @abhi7788, this is not prioritized at the moment. The Docker image is intended for development/testing purposes only and has not been prepared for production use.