# Dgraph Zero Docker volume

**URL:** <https://discuss.dgraph.io/t/dgraph-zero-docker-volume/2152>\
**Category:** Users\
**Created:** [January 23, 2018, 9:20am UTC](https://discuss.dgraph.io/t/dgraph-zero-docker-volume/2152 "2018-01-23T09:20:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nbnh](https://avatars.discourse-cdn.com/v4/letter/n/43a26b/32.png) [@nbnh](https://discuss.dgraph.io/u/nbnh)\
**Post date:** [January 23, 2018, 9:20am UTC](https://discuss.dgraph.io/t/dgraph-zero-docker-volume/2152/1 "2018-01-23T09:20:45Z")

</div>

I have some questions about running dgraph zero in docker swarm. Swarm config example ([https://docs.dgraph.io/deploy/#cluster-setup-using-docker-swarm](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).

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [January 23, 2018, 2:29pm UTC](https://discuss.dgraph.io/t/dgraph-zero-docker-volume/2152/2 "2018-01-23T14:29:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pawan](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/pawan/32/1946_2.png) [@pawan](https://discuss.dgraph.io/u/pawan)\
**Post date:** [January 23, 2018, 11:23pm UTC](https://discuss.dgraph.io/t/dgraph-zero-docker-volume/2152/3 "2018-01-23T23:23:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nbnh](https://avatars.discourse-cdn.com/v4/letter/n/43a26b/32.png) [@nbnh](https://discuss.dgraph.io/u/nbnh)\
**Post date:** [January 24, 2018, 7:31am UTC](https://discuss.dgraph.io/t/dgraph-zero-docker-volume/2152/4 "2018-01-24T07:31:34Z")

</div>

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?).

```auto
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

```

---

<div class="post-metadata">

**Author:** ![pawan](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/pawan/32/1946_2.png) [@pawan](https://discuss.dgraph.io/u/pawan)\
**Post date:** [January 24, 2018, 10:35pm UTC](https://discuss.dgraph.io/t/dgraph-zero-docker-volume/2152/5 "2018-01-24T22:35:56Z")

</div>

`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](https://docs.dgraph.io/deploy/#live-loader).

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/2/2b38fdece2abe5814f2e51bee69d1e67fc304b0a.png) [@system](https://discuss.dgraph.io/u/system)\
**Post date:** [February 23, 2018, 10:36pm UTC](https://discuss.dgraph.io/t/dgraph-zero-docker-volume/2152/6 "2018-02-23T22:36:08Z")

</div>

Closed on February 23, 2018, 10:36pm UTC

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