# Persistence on ES masters

**URL:** https://discuss.elastic.co/t/persistence-on-es-masters/73175
**Category:** Elasticsearch
**Created:** [January 30, 2017, 9:48am UTC](https://discuss.elastic.co/t/persistence-on-es-masters/73175 "2017-01-30T09:48:53Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Yaron\_Idan](https://avatars.discourse-cdn.com/v4/letter/y/ea5d25/32.png) [@Yaron\_Idan](https://discuss.elastic.co/u/Yaron_Idan)
#### Post date: [January 30, 2017, 9:48am UTC](https://discuss.elastic.co/t/persistence-on-es-masters/73175/1 "2017-01-30T09:48:53Z")

</div>

Hello,  
We are running an ES cluster as docker containers running on top of a kubernetes cluster.  
Recently we needed to restart the master node, and upon doing so lost the template we created for our indices.  
I have launched the data nodes attached to persistent disks in order to allow data to be preserved in case of a crash, but haven't done the same for the ES master node since I was under the impression it is only used for routing requests to the data nodes, and does not require any persistence.

I realize now that my assumption was wrong, and that the masters do hold a certain amount of data that need to be persisted in order to survive a crash of the entire cluster and not lose any data.

My question is -  
What is persisted within the ES masters?  
Is there a way to configure storing all persistence data in the data nodes, allowing masters to crash and resurrect without losing any configuration?

Thanks,  
Yaron.

---

<div class="post-metadata">

### Author: ![JKhondhu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JKhondhu](https://discuss.elastic.co/u/JKhondhu)
#### Post date: [January 30, 2017, 9:51am UTC](https://discuss.elastic.co/t/persistence-on-es-masters/73175/2 "2017-01-30T09:51:59Z")

</div>

Master nodes must have access to the data/ directory (just like data nodes) as this is where the cluster state is persisted between node restarts. Taken from here: [https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html#master-node](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html#master-node)

---

<div class="post-metadata">

### Author: ![Yaron\_Idan](https://avatars.discourse-cdn.com/v4/letter/y/ea5d25/32.png) [@Yaron\_Idan](https://discuss.elastic.co/u/Yaron_Idan)
#### Post date: [January 30, 2017, 10:22am UTC](https://discuss.elastic.co/t/persistence-on-es-masters/73175/3 "2017-01-30T10:22:34Z")

</div>

Thanks for the reference.  
However, I did not think templates are included in the cluster state.  
I expected nodes losing their connectivity when the master is down, since he is the one coordinating the nodes. However - I didn't expect templates to be included in the cluster state and losing them when the master crashes.  
Is there any place where I can read more about what is included in this cluster state?

---

<div class="post-metadata">

### Author: ![JKhondhu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JKhondhu](https://discuss.elastic.co/u/JKhondhu)
#### Post date: [January 30, 2017, 10:25am UTC](https://discuss.elastic.co/t/persistence-on-es-masters/73175/4 "2017-01-30T10:25:43Z")

</div>

I mean, all I'm doing is a google search: [https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html)

---

<div class="post-metadata">

### Author: ![Yaron\_Idan](https://avatars.discourse-cdn.com/v4/letter/y/ea5d25/32.png) [@Yaron\_Idan](https://discuss.elastic.co/u/Yaron_Idan)
#### Post date: [January 30, 2017, 11:25am UTC](https://discuss.elastic.co/t/persistence-on-es-masters/73175/5 "2017-01-30T11:25:35Z")

</div>

Perhaps my question wan't clear.  
I've read both of these references before posting the question.  
What I'm trying to understand is why did I lose my index template between master shutdown and startup, if it is not included in the cluster state.  
Again, thanks for all the help.

---

<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: [January 30, 2017, 11:39am UTC](https://discuss.elastic.co/t/persistence-on-es-masters/73175/6 "2017-01-30T11:39:15Z")

</div>

How many master eligible nodes do you have? It is recommended to have 3, so that the remaining nodes can elect a new master in case the current master fails.

---

<div class="post-metadata">

### Author: ![Yaron\_Idan](https://avatars.discourse-cdn.com/v4/letter/y/ea5d25/32.png) [@Yaron\_Idan](https://discuss.elastic.co/u/Yaron_Idan)
#### Post date: [January 30, 2017, 11:55am UTC](https://discuss.elastic.co/t/persistence-on-es-masters/73175/7 "2017-01-30T11:55:54Z")

</div>

I am aware of that.  
When I experienced the crash I was running a single master node, a problem I've attended to - scaling them up to 3.  
Still - I want to be able to recover even from a crash of all 3 masters, which is a possible scenario, unfortunately.

---

<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: [February 27, 2017, 11:56am UTC](https://discuss.elastic.co/t/persistence-on-es-masters/73175/8 "2017-02-27T11:56:42Z")

</div>

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