# Cluster configuration and time based index

**URL:** <https://discuss.elastic.co/t/cluster-configuration-and-time-based-index/58816>\
**Category:** Elasticsearch\
**Created:** [August 24, 2016, 12:07pm UTC](https://discuss.elastic.co/t/cluster-configuration-and-time-based-index/58816 "2016-08-24T12:07:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajkumar3v](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@rajkumar3v](https://discuss.elastic.co/u/rajkumar3v)\
**Post date:** [August 24, 2016, 12:07pm UTC](https://discuss.elastic.co/t/cluster-configuration-and-time-based-index/58816/1 "2016-08-24T12:07:45Z")

</div>

Hi guys i have 2 querys,

I am implementing Elastic cluster which will have 3 data node, 1 primary master node & 1 node for both client & secondary master.  
while pushing the data to cluster whether i have to specify data nodes or client node?  
from my point am using nginx for proxy,security & load balance purpose so in nginx i ll specify 3 data nodes so that nginx will manage the HA of data nodes.

also i want to disable direct http access of data nodes, so user can access client node and admin will manage through master. is it sense better? pls suggest.

Second one,

I want to create 1 primary index & 1 secondary index. the primary index will keep last 30 days data. Documents which are present more than 30 days in primary index should be moved to secondary index based on time stamp, then the secondary index will keep last 6 month documents

How to configure this in Elasticsearch end? because my client servers are pushing the data directly to elastic using Curl cmd through nginx proxy, my custom time stamp format is 2016-08-24:17:21:54.

---

<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 25, 2016, 2:08am UTC](https://discuss.elastic.co/t/cluster-configuration-and-time-based-index/58816/2 "2016-08-25T02:08:31Z")

</div>

Having two masters is bad, see [Important Configuration Changes | Elasticsearch: The Definitive Guide [2.x] | Elastic](https://www.elastic.co/guide/en/elasticsearch/guide/current/important-configuration-changes.html#_minimum_master_nodes)  
However if you have dedicated master nodes, don't send requests to them.

> [@rajkumar3v](#):
>
> I want to create 1 primary index & 1 secondary index. the primary index will keep last 30 days data. Documents which are present more than 30 days in primary index should be moved to secondary index based on time stamp, then the secondary index will keep last 6 month document

Don't do that.  
Create an index per month and use that.

---

<div class="post-metadata">

**Author:** ![rajkumar3v](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@rajkumar3v](https://discuss.elastic.co/u/rajkumar3v)\
**Post date:** [August 25, 2016, 8:23am UTC](https://discuss.elastic.co/t/cluster-configuration-and-time-based-index/58816/3 "2016-08-25T08:23:16Z")

</div>

Thank u Mark Walkom,

The 3d master will be any one of data node which will take master role also.

Could you please explain, why should I avoid primary and secondary index with time based concept..  
so I can understand from your perspective. bez its isnecessary for my requirement.

Also can I configure elasticsearch to create an index every three month or one month? i can do this using logstash but here am not using logstash.

Thanks in advance.

---

<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 25, 2016, 11:20am UTC](https://discuss.elastic.co/t/cluster-configuration-and-time-based-index/58816/4 "2016-08-25T11:20:34Z")

</div>

> [@rajkumar3v](#):
>
> Could you please explain, why should I avoid primary and secondary index with time based concept..so I can understand from your perspective. bez its isnecessary for my requirement.

How are you going to move the data between indices?  
How is that simpler than having this month and last month?

> [@rajkumar3v](#):
>
> Also can I configure elasticsearch to create an index every three month or one month?

ES will create whatever the client asks for.

---

<div class="post-metadata">

**Author:** ![rajkumar3v](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@rajkumar3v](https://discuss.elastic.co/u/rajkumar3v)\
**Post date:** [August 25, 2016, 12:15pm UTC](https://discuss.elastic.co/t/cluster-configuration-and-time-based-index/58816/5 "2016-08-25T12:15:06Z")

</div>

Is it possible to do such configuration so elastic will move the 30 days expired docs to secondary index by considering timestamp of docs.

else,

The most priority things am testing as per your suggestion,

Using logstash am able to create month wise index but how to configure it in elasticsearch side ?

Thanks in advance.

---

<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 25, 2016, 8:58pm UTC](https://discuss.elastic.co/t/cluster-configuration-and-time-based-index/58816/6 "2016-08-25T20:58:59Z")

</div>

> [@rajkumar3v](#):
>
> Right now i dint have any idea how to do it. Is it possible to do such configuration so elastic will move the 30 days expired docs to secondary index by considering timestamp of docs

No, there is not. You would need to build it yourself.

> [@rajkumar3v](#):
>
> Using logstash am able to create month wise index but how to configure it in elasticsearch side ?

You don't, LS asks ES to create the index based on the timestamp and the pattern you use in the output.

---

<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, 10:25pm UTC](https://discuss.elastic.co/t/cluster-configuration-and-time-based-index/58816/7 "2017-07-05T22:25:07Z")

</div>


