Dgraph Zero Docker volume

I have some questions about running dgraph zero in docker swarm. Swarm config example (https://docs.dgraph.io/deploy/#cluster-setup-using-docker-swarm) uses same volume (data-volume:/dgraph) for server and zero instances, so the actual data (p directory), server’s write-ahead logs (w) and zero’s write-ahead logs (zw) are in the same volume.
Is this a recommended way of storing zero’s logs? Shouldn’t zero have it’s own volume? I don’t see a reason to keep them in one volume - zero doesn’t access any actual data (and it probably shouldn’t).

But, which are the opposite reasons?

Well, you can do whatever you want. You can create volumes for each folder if you prefer. But in my view there are no reasons in favor or against it.

cheers

Hey @nbnh

You could use different volumes. Since Server and Zero write to different directories (p, w for Server and zw for Zero), I used the same volume. This could be an issue if the overhead to mount a volume increases with the size of the volume.

I see, thanks. By the way, what about the x directory? It looks like the others (ie p, same content) but I haven’t seen any mentions about it in the docs (maybe missed it?).

root@server-1:/dgraph# pwd ; ls -lha
/dgraph
total 13M
drwxr-xr-x. 6 root root  66 Jan 23 15:01 .
drwxr-xr-x. 1 root root 102 Jan 23 14:54 ..
-rw-r--r--. 1 root root 13M Jan 23 15:00 1million.rdf.gz
drwx------. 2 root root  53 Jan 23 14:54 p
drwx------. 2 root root  53 Jan 23 14:54 w
drwx------. 2 root root  53 Jan 23 15:01 x
drwx------. 2 root root  53 Jan 23 14:54 zw

x directory is used by dgraph live. It stores a mapping of xid/blank-node => uid. Its mentioned at https://docs.dgraph.io/deploy/#live-loader.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.