# Where is data stored in ES

**URL:** https://discuss.elastic.co/t/where-is-data-stored-in-es/145315
**Category:** Elasticsearch
**Created:** [August 21, 2018, 7:28am UTC](https://discuss.elastic.co/t/where-is-data-stored-in-es/145315 "2018-08-21T07:28:22Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![amnon\_d](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@amnon\_d](https://discuss.elastic.co/u/amnon_d)
#### Post date: [August 21, 2018, 7:28am UTC](https://discuss.elastic.co/t/where-is-data-stored-in-es/145315/1 "2018-08-21T07:28:22Z")

</div>

Hi there,  
Appologies if this question will sound stupid....  
I am testing some high availability concepts and I am puzzled about one thing.  
For my test I am running an ES cluster with one master, two data nodes and one client.  
I send data to data node A, and I can view it with Grafana running on any of the 4 nodes - no problem.  
I am still able to view the data even when I stop ES on Data node A.  
Well, I thought that maybe the Master decided to store the data on Data Node B...  
So, I restarted ES on Node A and stopped it on Node B.  
I was still able to view the data (must say to my satisfaction cause I wanted High Availability of my data)  
My question is, does the Master directs all data nodes to store all data or am I missing something here.  
Thanks.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [August 21, 2018, 7:43am UTC](https://discuss.elastic.co/t/where-is-data-stored-in-es/145315/2 "2018-08-21T07:43:37Z")

</div>

By default, Elasticsearch will create a replica of each index. And because you have multiple nodes, it can put the shards across these multiple nodes, providing redundancy.

The master nodes does handle where all the shards are allocated.

---

<div class="post-metadata">

### Author: ![Bernt\_Rostad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bernt\_Rostad](https://discuss.elastic.co/u/Bernt_Rostad)
#### Post date: [August 21, 2018, 7:55am UTC](https://discuss.elastic.co/t/where-is-data-stored-in-es/145315/3 "2018-08-21T07:55:50Z")

</div>

> [@amnon\_d](#):
>
> does the Master directs all data nodes to store all data

When you use the default index settings, new indices are created with 1 replica for each primary shard. Since a replica shard will always live on a **different** node than the primary shard, you automatically get redundancy since each of your two nodes will then have a full copy of the data. The master knew this so when you queried the cluster, after taking down one of the data nodes, it still found the relevant data on the other node.

However, if you had deleted the replica shards or changed the default index settings to not create replicas you would not have had a full copy of the data and thus no redundancy. So, keeping the 1 replica setting is a good choice in most situations.

---

<div class="post-metadata">

### Author: ![amnon\_d](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@amnon\_d](https://discuss.elastic.co/u/amnon_d)
#### Post date: [August 21, 2018, 7:58am UTC](https://discuss.elastic.co/t/where-is-data-stored-in-es/145315/4 "2018-08-21T07:58:02Z")

</div>

Thank you. I was hoping this is the case but I wasn't sure.

---

<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: [August 21, 2018, 8:00am UTC](https://discuss.elastic.co/t/where-is-data-stored-in-es/145315/5 "2018-08-21T08:00:57Z")

</div>

If you are looking for high availability, you should ensure you have at least 3 master-eligible nodes and [set minimum\_master\_nodes correctly](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/modules-node.html#split-brain).

---

<div class="post-metadata">

### Author: ![amnon\_d](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@amnon\_d](https://discuss.elastic.co/u/amnon_d)
#### Post date: [August 21, 2018, 8:04am UTC](https://discuss.elastic.co/t/where-is-data-stored-in-es/145315/6 "2018-08-21T08:04:06Z")

</div>

Thank you. So by default I get 1 replica for each primary shard, can I have more than 1 replica providing I have enough Data Nodes?

---

<div class="post-metadata">

### Author: ![Bernt\_Rostad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bernt\_Rostad](https://discuss.elastic.co/u/Bernt_Rostad)
#### Post date: [August 21, 2018, 8:11am UTC](https://discuss.elastic.co/t/where-is-data-stored-in-es/145315/7 "2018-08-21T08:11:41Z")

</div>

> [@amnon\_d](#):
>
> can I have more than 1 replica

Yes, there is no limitation on the number of replica shards you can have for an index. And its a dynamic setting, so you can change it for existing indices when the need arises. See the [Update Indices Settings](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html).

Adding more replicas is a nice way to scale a system for more searches since more copies of the data means you can add more data nodes that can be queried in parallel (since they all have a copy of the same data).

---

<div class="post-metadata">

### Author: ![amnon\_d](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@amnon\_d](https://discuss.elastic.co/u/amnon_d)
#### Post date: [August 21, 2018, 8:13am UTC](https://discuss.elastic.co/t/where-is-data-stored-in-es/145315/8 "2018-08-21T08:13:29Z")

</div>

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 18, 2018, 8:13am UTC](https://discuss.elastic.co/t/where-is-data-stored-in-es/145315/9 "2018-09-18T08:13:34Z")

</div>

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