docker icon indicating copy to clipboard operation
docker copied to clipboard

Default config should be more persistent

Open colton-citus opened this issue 7 years ago • 6 comments

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:

colton-citus avatar Oct 18 '18 21:10 colton-citus

Will above work fine if there are more than one worker nodes? (Using docker-compose -p citus scale worker=2)

chrismark avatar May 31 '19 09:05 chrismark

@chrismark : This solution should work with an arbitrary number of worker nodes

colton-citus avatar May 31 '19 18:05 colton-citus

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.

chrismark avatar Jun 04 '19 05:06 chrismark

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.

jasonmp85 avatar Jun 13 '19 23:06 jasonmp85

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

abhi7788 avatar Apr 17 '20 18:04 abhi7788

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.

metdos avatar Apr 20 '20 07:04 metdos