# Modify core storage of Elastic search

**URL:** <https://discuss.elastic.co/t/modify-core-storage-of-elastic-search/168274>\
**Category:** Elasticsearch\
**Created:** [February 13, 2019, 6:28pm UTC](https://discuss.elastic.co/t/modify-core-storage-of-elastic-search/168274 "2019-02-13T18:28:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![akshay\_shetye](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@akshay\_shetye](https://discuss.elastic.co/u/akshay_shetye)\
**Post date:** [February 13, 2019, 6:28pm UTC](https://discuss.elastic.co/t/modify-core-storage-of-elastic-search/168274/1 "2019-02-13T18:28:21Z")

</div>

I am new to ES project and i am trying to understand the code. What am trying to do is instead of ES writing to DISK, i want to write to some other place. Ex amazon S3. I know that this is not ideal, but I have my own reasons for this.

Can someone point me to the code where i can start changing this? Any guidance will he helpful.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [February 13, 2019, 6:49pm UTC](https://discuss.elastic.co/t/modify-core-storage-of-elastic-search/168274/2 "2019-02-13T18:49:47Z")

</div>

Elasticsearch is very I/O intensive, so using something like S3 as backing storage is not a good idea. It may help if you provide some additional details about exactly what you want to do and why.

---

<div class="post-metadata">

**Author:** ![akshay\_shetye](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@akshay\_shetye](https://discuss.elastic.co/u/akshay_shetye)\
**Post date:** [February 13, 2019, 8:47pm UTC](https://discuss.elastic.co/t/modify-core-storage-of-elastic-search/168274/3 "2019-02-13T20:47:17Z")

</div>

I want to encrypt data the Elastic search stores. So basically i want to encrypt using different keys per index. If i use S3 as file system then i can use S3s encryption at rest support.

Coming back to my main question:  
Can you point me out to the code where ES writes to filesystem?

---

<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:** [February 14, 2019, 5:03pm UTC](https://discuss.elastic.co/t/modify-core-storage-of-elastic-search/168274/4 "2019-02-14T17:03:29Z")

</div>

S3 does not offer many of the filesystem features that Elasticsearch needs to operate correctly, such as locks or atomic renames. It's just not possible to do what you ask.

Encryption-at-rest is perfectly possible today, with a proper filesystem on a proper hard disk, using something like `dm-crypt`.

If you are interested in the enormity of the task you suggest, the three major places that Elasticsearch writes to disk are:

- `org.elasticsearch.gateway.MetaDataStateFormat` and its subclasses
- `org.apache.lucene.store.Directory` and its subclasses
- `org.elasticsearch.index.translog.TranslogWriter`

---

<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:** [March 14, 2019, 5:03pm UTC](https://discuss.elastic.co/t/modify-core-storage-of-elastic-search/168274/5 "2019-03-14T17:03:34Z")

</div>

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