# Automatic index template upload on newly created cluster

**URL:** https://discuss.elastic.co/t/automatic-index-template-upload-on-newly-created-cluster/36333
**Category:** Elasticsearch
**Created:** [December 4, 2015, 12:58am UTC](https://discuss.elastic.co/t/automatic-index-template-upload-on-newly-created-cluster/36333 "2015-12-04T00:58:59Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![feigenblatt](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@feigenblatt](https://discuss.elastic.co/u/feigenblatt)
#### Post date: [December 4, 2015, 12:58am UTC](https://discuss.elastic.co/t/automatic-index-template-upload-on-newly-created-cluster/36333/1 "2015-12-04T00:58:59Z")

</div>

I've been using configuration management tools (more recently Saltstack) to automatically deploy ES clusters.  
I used to have an index mapping template in the config directory and when the cluster started and a document was indexed the template was picked up.  
Starting with ES 2.0 file based templates are not supported anymore so I need to wait for the cluster to come up and then upload a template.  
Is there a recommended way to find out when the cluster is ready to receive the template?  
How do I keep the cluster from indexing documents until all changes have been applied?

Thanks,  
Dado Feigenblatt

---

<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: [December 4, 2015, 3:18am UTC](https://discuss.elastic.co/t/automatic-index-template-upload-on-newly-created-cluster/36333/2 "2015-12-04T03:18:11Z")

</div>

Just ping `_cat/health` and wait for it to hit green.

> [@feigenblatt](#):
>
> How do I keep the cluster from indexing documents until all changes have been applied?

How do you do it now

---

<div class="post-metadata">

### Author: ![feigenblatt](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@feigenblatt](https://discuss.elastic.co/u/feigenblatt)
#### Post date: [December 11, 2015, 1:58am UTC](https://discuss.elastic.co/t/automatic-index-template-upload-on-newly-created-cluster/36333/3 "2015-12-11T01:58:16Z")

</div>

Thanks for the reply @warkolm  
I've been using file based templates so when the ES cluster comes up the templates are immediately available for any new index.  
I have tens of thousands of processes which are indexing logs, stats and metadata.  
They do asynchronous posts and fail gracefully if ES is down, but start posting immediately when ES comes up.  
That's why I need the index templates to be available immediately.  
Now I'm leaning towards adding logic to my RESTful application that's fronting the ES cluster.  
When the REST app comes up it will first make sure the indices are configured as needed.  
I wonder how Marvel, Logstash, and other apps handle this.

Thanks

---

<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: [July 5, 2017, 11:31pm UTC](https://discuss.elastic.co/t/automatic-index-template-upload-on-newly-created-cluster/36333/4 "2017-07-05T23:31:57Z")

</div>


