# Possibilities of increasing data security in elasticsearch - power failures \[?\]

**URL:** https://discuss.elastic.co/t/possibilities-of-increasing-data-security-in-elasticsearch-power-failures/231839
**Category:** Elasticsearch
**Created:** [May 9, 2020, 12:24pm UTC](https://discuss.elastic.co/t/possibilities-of-increasing-data-security-in-elasticsearch-power-failures/231839 "2020-05-09T12:24:29Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Rysiu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rysiu/32/61919_2.png) [@Rysiu](https://discuss.elastic.co/u/Rysiu)
#### Post date: [May 9, 2020, 12:24pm UTC](https://discuss.elastic.co/t/possibilities-of-increasing-data-security-in-elasticsearch-power-failures/231839/1 "2020-05-09T12:24:29Z")

</div>

Hi,

Relatively simple question about the configuration of elasticsearch with respect to specific data security.

Are there any possibilities to configure an elasticsearch cluster so that in case of a power failure there are no additional data losses?

What security models when not all nodes have redundant power supply?

Is there anything we can do?

Of course backup is backup. But I'm looking for a quick solution in elasticsearch.

---

<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: [May 9, 2020, 1:04pm UTC](https://discuss.elastic.co/t/possibilities-of-increasing-data-security-in-elasticsearch-power-failures/231839/2 "2020-05-09T13:04:21Z")

</div>

By default Elasticsearch should lose no acknowledged writes when power is lost, assuming your storage system implements `fsync()` correctly. Lucene in particular has seen some [fairly rigorous testing of its safety in the face of power loss](http://blog.mikemccandless.com/2014/04/testing-lucenes-index-durability-after.html).

Be warned that it's relatively common to lose data in a power outage because your storage system does not in fact implement `fsync()` correctly, but there's not much Elasticsearch can do about that. You can [run some tests to try and detect this](https://brad.livejournal.com/2116715.html); as long as your system passes those sorts of tests then Elasticsearch should be fine.

---

<div class="post-metadata">

### Author: ![Rysiu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rysiu/32/61919_2.png) [@Rysiu](https://discuss.elastic.co/u/Rysiu)
#### Post date: [May 9, 2020, 1:31pm UTC](https://discuss.elastic.co/t/possibilities-of-increasing-data-security-in-elasticsearch-power-failures/231839/3 "2020-05-09T13:31:53Z")

</div>

Thanks a lot!

I'll test this software...

I've noticed that if there are problems, it's only in the indexes where the documents are also saved.

Are read-only indexes more robust?  
If I only read in indexes, is elasticsearch not writing any data to disk and it is resistant to such problems (power problems)?

---

<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: [May 9, 2020, 1:46pm UTC](https://discuss.elastic.co/t/possibilities-of-increasing-data-security-in-elasticsearch-power-failures/231839/4 "2020-05-09T13:46:19Z")

</div>

> [@Rysiu](#):
>
> Are read-only indexes more robust?

Probably yes, most broken `fsync()` implementations will still take effect within a few seconds so in practice you only notice the problem on data that was written in the last few seconds before a power outage.

---

<div class="post-metadata">

### Author: ![Rysiu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rysiu/32/61919_2.png) [@Rysiu](https://discuss.elastic.co/u/Rysiu)
#### Post date: [May 9, 2020, 2:53pm UTC](https://discuss.elastic.co/t/possibilities-of-increasing-data-security-in-elasticsearch-power-failures/231839/5 "2020-05-09T14:53:06Z")

</div>

I understand.  
`fsync()` is only implemented at the software level or is it also hardware dependent?  
SSDs have better support than normal HDDs for `fsync()`?

---

<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: [May 9, 2020, 5:36pm UTC](https://discuss.elastic.co/t/possibilities-of-increasing-data-security-in-elasticsearch-power-failures/231839/6 "2020-05-09T17:36:53Z")

</div>

It's software, but that includes the firmware running on your drives and all sorts of system-dependent configuration. I don't know of any general differences between SSDs and spinning disks. I'm pretty sure you can configure any drive to do it properly, it's just not always the default.

---

<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: [June 6, 2020, 5:36pm UTC](https://discuss.elastic.co/t/possibilities-of-increasing-data-security-in-elasticsearch-power-failures/231839/7 "2020-06-06T17:36:55Z")

</div>

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