# Which volumes of beats should I mount under docker swarm?

**URL:** https://discuss.elastic.co/t/which-volumes-of-beats-should-i-mount-under-docker-swarm/302714
**Category:** Beats
**Tags:** docker, filebeat, metricbeat
**Created:** [April 19, 2022, 12:03pm UTC](https://discuss.elastic.co/t/which-volumes-of-beats-should-i-mount-under-docker-swarm/302714 "2022-04-19T12:03:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![UchihaYuki](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/uchihayuki/32/104442_2.png) [@UchihaYuki](https://discuss.elastic.co/u/UchihaYuki)
#### Post date: [April 19, 2022, 12:03pm UTC](https://discuss.elastic.co/t/which-volumes-of-beats-should-i-mount-under-docker-swarm/302714/1 "2022-04-19T12:03:18Z")

</div>

I have a custom image for filebeat and metricbeat. So every time when they restart, `filebeat setup` and `metricbeat setup` will run before `filebeat` and `metricbeat`.

I wonder which folders I should mount under a named volumn in order to avoid duplicate actions.

I know that data folder for firebeat should be mount or there will be duplicated logs.

Should I mount data for metricbeat as well? Should I mount kibana for both metricbeat and filebeat. There is no doc out there about this, or at least I haven't found them.

Thank you all.

---

<div class="post-metadata">

### Author: ![TiagoQueiroz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tiagoqueiroz/32/107061_2.png) [@TiagoQueiroz](https://discuss.elastic.co/u/TiagoQueiroz)
#### Post date: [April 21, 2022, 5:17pm UTC](https://discuss.elastic.co/t/which-volumes-of-beats-should-i-mount-under-docker-swarm/302714/2 "2022-04-21T17:17:43Z")

</div>

Hi @UchihaYuki

Take a look at the directory layout: [Directory layout | Metricbeat Reference [8.1] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/current/directory-layout.html)

You need to make sure the `data` folder persists container restarts/recreation.

That goes for Filebeat and Metricbeat, they use this folder to persist any state they need.

---

<div class="post-metadata">

### Author: ![UchihaYuki](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/uchihayuki/32/104442_2.png) [@UchihaYuki](https://discuss.elastic.co/u/UchihaYuki)
#### Post date: [April 23, 2022, 2:54pm UTC](https://discuss.elastic.co/t/which-volumes-of-beats-should-i-mount-under-docker-swarm/302714/3 "2022-04-23T14:54:05Z")

</div>

Thank you. Got it.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [May 21, 2022, 4:54pm UTC](https://discuss.elastic.co/t/which-volumes-of-beats-should-i-mount-under-docker-swarm/302714/4 "2022-05-21T16:54:50Z")

</div>

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