citusdata / citusdata/docker

persist data with a citus cluster

Open
#57 13 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dockerfile
Stars
273
Forks
102
Avg merge
5d 20h
Merged PRs (30d)
2

Description

I'm pretty new to Citus so be easy on me ;)

The documentation mentions that the citus_standalone is storing the PGDATA in a mounted volume (,so it persist between restarts of the container)

I am trying to start the citus cluster with data persistency. Do I have to do something for this?

First of all I had to change the docker-compose.yml file a little bit.
I'm running ```docker-compose version 1.17.0, build ac53b73```

```
version: '2.3'

services:

master:
container_name: "${COMPOSE_PROJECT_NAME:-citus}_master"
image: citusdata/citus:7.1.1
ports:
- "5432:5432"
labels:
com.citusdata.role: Master

worker:
container_name: "${COMPOSE_PROJECT_NAME:-citus}_worker"
image: citusdata/citus:7.1.1
labels:
com.citusdata.role: Worker
depends_on: { manager: { condition: service_healthy } }
manager:
container_name: "${COMPOSE_PROJECT_NAME:-citus}_manager"
image: 'citusdata/membership-manager:0.2.0'
volumes: ['/var/run/docker.sock:/var/run/docker.sock']
depends_on: { master: { condition: service_healthy } }
```

I created two directories on my host environment to store the pgdata for the Master and the Worker
The docker-compose files looks now like:
```
version: '2.3'

services:
master:
container_name: "${COMPOSE_PROJECT_NAME:-citus}_master"
image: citusdata/citus:7.1.1
ports:
- "5432:5432"
labels:
com.citusdata.role: Master
volumes:
- /media/marco/DataDisk/citus-master:/var/lib/postgresql/data

worker:
container_name: "${COMPOSE_PROJECT_NAME:-citus}_worker"
image: citusdata/citus:7.1.1
labels:
com.citusdata.role: Worker
volumes:
- /media/marco/DataDisk/citus-worker:/var/lib/postgresql/data
depends_on: { manager: { condition: service_healthy } }
manager:
container_name: "${COMPOSE_PROJECT_NAME:-citus}_manager"
image: 'citusdata/membership-manager:0.2.0'
volumes: ['/var/run/docker.sock:/var/run/docker.sock']
depends_on: { master: { condition: service_healthy } }

```

```docker-compose up``` works fine. And I can create a database etc.

However after a ```docker-compose down```
and then a new start ```docker-compose up``` , it has the tables but it cannot find the shards.

```
ERRO[2017-12-11T04:31:45Z] pq: could not find length of shard 102072 req_id=ZXvdeL1Mh2-1
```

I'm pretty new here. So not sure what is going on?
- Can I define my own volumes?
- Should I do an 'up' and 'down' or only 'start' 'stop'
- Where is the shared information persisted?

Thanks for any help

Marco

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.