# Elasticsearch docker container not writing to local disk

**URL:** <https://discuss.elastic.co/t/elasticsearch-docker-container-not-writing-to-local-disk/193859>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [August 5, 2019, 5:42pm UTC](https://discuss.elastic.co/t/elasticsearch-docker-container-not-writing-to-local-disk/193859 "2019-08-05T17:42:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![carson](https://avatars.discourse-cdn.com/v4/letter/c/e9bcb4/32.png) [@carson](https://discuss.elastic.co/u/carson)\
**Post date:** [August 5, 2019, 5:42pm UTC](https://discuss.elastic.co/t/elasticsearch-docker-container-not-writing-to-local-disk/193859/1 "2019-08-05T17:42:44Z")

</div>

I have a docker container with a volume mount for `/var/log/elasticsearch/` and `/var/lib/elasticsearch/` so that Elasticsearch will write to disk, as the container seems to be running out of space after several hours of uptime.

I check the local volume-mounted directories, and no data has been written to them. I've tried changing the ownership to `1000:1000`. Should I be mounting a different directory? Do I need to enable anything in the config file?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [August 5, 2019, 6:10pm UTC](https://discuss.elastic.co/t/elasticsearch-docker-container-not-writing-to-local-disk/193859/2 "2019-08-05T18:10:42Z")

</div>

> [@carson](#):
>
> Do I need to enable anything in the config file?

Yes, you will likely need to set `path.data` to point to the path of the volume mounts as seen from inside the container.

---

<div class="post-metadata">

**Author:** ![carson](https://avatars.discourse-cdn.com/v4/letter/c/e9bcb4/32.png) [@carson](https://discuss.elastic.co/u/carson)\
**Post date:** [August 5, 2019, 7:45pm UTC](https://discuss.elastic.co/t/elasticsearch-docker-container-not-writing-to-local-disk/193859/3 "2019-08-05T19:45:17Z")

</div>

Right, I volume mount my directories to /var/log/elasticsearch/ and /var/lib/elasticsearch/, which are the defaults and these are what elasticsearch should be writing to inside the container.

Are these not the defaults?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [August 5, 2019, 8:29pm UTC](https://discuss.elastic.co/t/elasticsearch-docker-container-not-writing-to-local-disk/193859/4 "2019-08-05T20:29:03Z")

</div>

I don't think those are the defaults, no, but it does depend on exactly how you're starting Elasticsearch (what image you're using, etc.). It's going to be simplest to set `path.data` explicitly.

---

<div class="post-metadata">

**Author:** ![carson](https://avatars.discourse-cdn.com/v4/letter/c/e9bcb4/32.png) [@carson](https://discuss.elastic.co/u/carson)\
**Post date:** [August 6, 2019, 2:30pm UTC](https://discuss.elastic.co/t/elasticsearch-docker-container-not-writing-to-local-disk/193859/5 "2019-08-06T14:30:20Z")

</div>

So this worked for `path.data` but setting `path.logs` doesn't work, as inside the container the `gc.log` is being written to, but it's not reflected in the volume mounted directory on my local host. Is it possible to write logs to disk from docker?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [August 6, 2019, 2:34pm UTC](https://discuss.elastic.co/t/elasticsearch-docker-container-not-writing-to-local-disk/193859/6 "2019-08-06T14:34:15Z")

</div>

Yes, the location of the `gc.log` file can be changed in the `jvm.options` file.

---

<div class="post-metadata">

**Author:** ![carson](https://avatars.discourse-cdn.com/v4/letter/c/e9bcb4/32.png) [@carson](https://discuss.elastic.co/u/carson)\
**Post date:** [August 6, 2019, 5:27pm UTC](https://discuss.elastic.co/t/elasticsearch-docker-container-not-writing-to-local-disk/193859/7 "2019-08-06T17:27:25Z")

</div>

Sorry that wasn't my question. I think this is a Docker issue though, with volume mounted log files. Thank you

---

<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:** [September 3, 2019, 5:27pm UTC](https://discuss.elastic.co/t/elasticsearch-docker-container-not-writing-to-local-disk/193859/8 "2019-09-03T17:27:28Z")

</div>

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