# Newbie question: which index setting will be used in different nodes?

**URL:** <https://discuss.elastic.co/t/newbie-question-which-index-setting-will-be-used-in-different-nodes/55178>\
**Category:** Elasticsearch\
**Created:** [July 11, 2016, 10:46am UTC](https://discuss.elastic.co/t/newbie-question-which-index-setting-will-be-used-in-different-nodes/55178 "2016-07-11T10:46:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![goofansu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/goofansu/32/4755_2.png) [@goofansu](https://discuss.elastic.co/u/goofansu)\
**Post date:** [July 11, 2016, 10:46am UTC](https://discuss.elastic.co/t/newbie-question-which-index-setting-will-be-used-in-different-nodes/55178/1 "2016-07-11T10:46:10Z")

</div>

For example, there are node1 and node2 in cluster.

node1:

```auto
index.number_of_shards: 5
index.number_of_replicas: 1

```

node2:

```auto
index.number_of_shards: 3
index.number_of_replicas: 2

```

Which setting will be used when creating an index? Is there any document to explain this?

Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 11, 2016, 11:04am UTC](https://discuss.elastic.co/t/newbie-question-which-index-setting-will-be-used-in-different-nodes/55178/2 "2016-07-11T11:04:02Z")

</div>

Use index templates.

This setting is removed in 5.0.

---

<div class="post-metadata">

**Author:** ![goofansu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/goofansu/32/4755_2.png) [@goofansu](https://discuss.elastic.co/u/goofansu)\
**Post date:** [July 11, 2016, 11:22am UTC](https://discuss.elastic.co/t/newbie-question-which-index-setting-will-be-used-in-different-nodes/55178/3 "2016-07-11T11:22:33Z")

</div>

This is an example.

I mean if there are same setting keys with different values across the cluster, which setting will take effect in this cluster.

For example:

node1:

```auto
discovery.zen.minimum_master_nodes: 1

```

node2:

```auto
discovery.zen.minimum_master_nodes: 2

```

WIll node1 become a cluster with itself or wait for node2 to come and consist a cluster?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 11, 2016, 8:13pm UTC](https://discuss.elastic.co/t/newbie-question-which-index-setting-will-be-used-in-different-nodes/55178/4 "2016-07-11T20:13:18Z")

</div>

Good question.

I believe that If no cluster exists then the first node which will start will read this value from `elasticsearch.yml`.  
With that the cluster state will be created.

When a new node starts, it uses the values available in the cluster state.

I did not check the code or tested it so I could be wrong though.

But for settings starting with `node.`, those are read by the node when it starts.  
It means that those settings are local to the node.

My 2 cents

---

<div class="post-metadata">

**Author:** ![goofansu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/goofansu/32/4755_2.png) [@goofansu](https://discuss.elastic.co/u/goofansu)\
**Post date:** [July 12, 2016, 6:15pm UTC](https://discuss.elastic.co/t/newbie-question-which-index-setting-will-be-used-in-different-nodes/55178/5 "2016-07-12T18:15:08Z")

</div>

I found following description in the official [document](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html#master-node):

> The master node is responsible for lightweight cluster-wide actions such as creating or deleting an index, tracking which nodes are part of the cluster, and deciding which shards to allocate to which nodes.

I think it's the master to decide the cluster setting.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 12, 2016, 8:23pm UTC](https://discuss.elastic.co/t/newbie-question-which-index-setting-will-be-used-in-different-nodes/55178/6 "2016-07-12T20:23:27Z")

</div>

Sure. The master updates the cluster state.  
With a new cluster, the master is the first node basically.

---

<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:36pm UTC](https://discuss.elastic.co/t/newbie-question-which-index-setting-will-be-used-in-different-nodes/55178/7 "2017-07-05T22:36:14Z")

</div>


