Alpha Data Management

I Want to Do

I have deployed multiple dgraph clusters through docker, and I want to replace the data in one cluster to the new cluster for testing.The data of different clusters have been hung out through docker.
I would like to verify these questions:
Q1:How to replace the data of different clusters without data import.
Q2:I am verifying ACL related functions, and deploying ACL service in a new cluster, how to import data, or how to enable ACL service for a cluster that has stored a large amount of data.

All of the above operations are performed through docker.

What I Did

I try to directly replace the P, W, ZW files in the data directory.This seems to be related to the path where docker starts the dgraph cluster service,in this way, I can only get the predicate, the data is empty

Dgraph Metadata

dgraph version V20.03.3

how are the volumes in your docker mounted? @joaquin could you help with this?

Also relevant (generic advice, YMMV):

(all these have the points of contention about mounting volumes in Docker, which is a pain point)

@chewxy. That’s a very excellent question.

TL;DR Short answer: by default volumes come from: /var/lib/docker/volumes

Long Anwser: There are three types of mounts for persistence on Linux for Docker, one of them being the volume resource, another is bind mount (mounting a directory on the host system into the container), and tmpfs (mounting memory with tmpfs in the container).

For the volume resource, such as dgraph_data:, these will be mounted from the host file system found in /var/lib/docker/volumes using the volume driver called local.

types-of-mounts
(graphic source from Manage data in Docker | Docker Docs)

A little known secret, the local volume driver can also mount NFS, which may be useful for backups.

Resources

I wrote a docker-compose.yml example in dgraph/contrib/config/backups/nfs at master · dgraph-io/dgraph · GitHub to illustrate how to use NFS with Docker or Kubernetes.