Docker Swarm data not persisting in Local

Hi Team,

I am posting here as a last resort after I was unable to figure out, how to persist whatever data I put into Dgraph.

For the last 3 days, I have been re-inserting data into the Dgraph after reinitializing the Docker Swarm cluster.

I have tried searching, but always end up with results like Gluster, Ceph, MinIO.

What am I doing wrong?

P.S. I use a slightly modified Docker Compose file from Dgraph GitHub repo.

Hi @abhijit-kar Can you show us your modified docker-compose file.

docker-compose.yaml (780 Bytes)

I just removed high availability constraints from it!

Referenced it from: dgraph/contrib/config/docker/docker-compose-ha.yml at master Ā· dgraph-io/dgraph Ā· GitHub

Hi @abhijit-kar

You need to put a volume mount at the /dgraph location within the docker container. Add a volume for alpha and a separate volume for zero, and mount them both at /dgraph in the respective container.

I see a /honeycomb, but I’m not sure what that is used for. If this is the data directory, you have to ensure that you pass options to dgraph to start with that data directory.

I was learning Docker Swarm, and just assumed I could change volume mount to any name.

In this case, from /dgraph to /honeycomb.

Thank you for clearing that up.

1 Like