# ES 2 nodes Master Master Cluster Configuration

**URL:** <https://discuss.elastic.co/t/es-2-nodes-master-master-cluster-configuration/91541>\
**Category:** Elasticsearch\
**Created:** [July 2, 2017, 7:08am UTC](https://discuss.elastic.co/t/es-2-nodes-master-master-cluster-configuration/91541 "2017-07-02T07:08:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Priyanka\_Talwaria](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@Priyanka\_Talwaria](https://discuss.elastic.co/u/Priyanka_Talwaria)\
**Post date:** [July 2, 2017, 7:08am UTC](https://discuss.elastic.co/t/es-2-nodes-master-master-cluster-configuration/91541/1 "2017-07-02T07:08:59Z")

</div>

ES Config:

Node 1:

[cluster.name](http://cluster.name): mycluster  
[node.name](http://node.name): "node1"  
node.master: true  
node.data: true  
discovery.zen.ping.unicast.hosts: ["192.168.100.103"] # IP of node2  
Node 2:

[cluster.name](http://cluster.name): mycluster  
[node.name](http://node.name): "node2"  
node.master: true  
node.data: true  
discovery.zen.ping.unicast.hosts: ["192.168.101.103"] #IP of node1  
Before this configuration ES data was present on one my node (Node -1) and no data on Node-2.

Now when I search indexes ,I get result from both and both nodes shows Node-1 is elected as master.

But when I stop my ES on Node-1 ,then on node-2 it is elected as master but my data is not synced here.

Indexes exists on Node-2 but not ES data.

How is data synced on both the nodes ?

---

<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:** [July 2, 2017, 7:11am UTC](https://discuss.elastic.co/t/es-2-nodes-master-master-cluster-configuration/91541/2 "2017-07-02T07:11:35Z")

</div>

Have you got replicas set?  
Are they the same version?

---

<div class="post-metadata">

**Author:** ![Priyanka\_Talwaria](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@Priyanka\_Talwaria](https://discuss.elastic.co/u/Priyanka_Talwaria)\
**Post date:** [July 2, 2017, 7:17am UTC](https://discuss.elastic.co/t/es-2-nodes-master-master-cluster-configuration/91541/3 "2017-07-02T07:17:11Z")

</div>

@warkolm  
in my above configuration i added index.number\_of\_replicas: 1

new configuration something like this

Node 1:  
[cluster.name](http://cluster.name): mycluster  
[node.name](http://node.name): "node1"  
node.master: true  
node.data: true  
discovery.zen.ping.unicast.hosts: ["192.168.100.103"] # IP of node2  
index.number\_of\_replicas: 1

Node 2:  
[cluster.name](http://cluster.name): mycluster  
[node.name](http://node.name): "node2"  
node.master: true  
node.data: true  
discovery.zen.ping.unicast.hosts: ["192.168.101.103"] #IP of node1  
index.number\_of\_replicas: 1

versions are same  
And its still not working.

On stopping Node-1 on Node-2 I get no\_shard\_available\_action\_exception

---

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [July 2, 2017, 1:23pm UTC](https://discuss.elastic.co/t/es-2-nodes-master-master-cluster-configuration/91541/4 "2017-07-02T13:23:02Z")

</div>

Hi,

I 'm not certain that adding index.number\_of\_replicas = 1 and restarting nodes will extends number of replicas for "old" indices. May be you can install the head plugin and look at your cluster to see how shards are replicated :

> **[mobz/elasticsearch-head](https://github.com/mobz/elasticsearch-head)**
>
> elasticsearch-head - A web front end for an elastic search cluster

Xavier

---

<div class="post-metadata">

**Author:** ![Priyanka\_Talwaria](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@Priyanka\_Talwaria](https://discuss.elastic.co/u/Priyanka_Talwaria)\
**Post date:** [July 2, 2017, 4:36pm UTC](https://discuss.elastic.co/t/es-2-nodes-master-master-cluster-configuration/91541/5 "2017-07-02T16:36:44Z")

</div>

@xavierfacq As you mentioned it wont work for old indices,will it work for new indices and in old indices if I create new data ,will it work for that new data?

---

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [July 2, 2017, 5:30pm UTC](https://discuss.elastic.co/t/es-2-nodes-master-master-cluster-configuration/91541/6 "2017-07-02T17:30:38Z")

</div>

> [@Priyanka\_Talwaria](#):
>
> will it work for new indices?

Yes, It'll be the default configuration for new indices (unless you define a replica configuration in a template or at the creation). It should be fine !

If you want to change the configuration for your old indices, you can do:

```
  curl -XPUT 'http://youIP:9200/youIndex/_settings' -d '
  {
  "index" : {
      "number_of_replicas" : 0
  }
  }'

```

---

<div class="post-metadata">

**Author:** ![Priyanka\_Talwaria](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@Priyanka\_Talwaria](https://discuss.elastic.co/u/Priyanka_Talwaria)\
**Post date:** [July 2, 2017, 5:43pm UTC](https://discuss.elastic.co/t/es-2-nodes-master-master-cluster-configuration/91541/7 "2017-07-02T17:43:04Z")

</div>

@xavierfacq with index.number\_of\_relicas: 1 ,data is synced for new indices,but was not getting synced for old indices.  
when i do index.number\_of\_replicas:0 then also old indices not working.  
if somehow i replicate data for old indices,then after cluster set up what I want is data should get synced for new indices as well as new data in old\_indices.

---

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [July 2, 2017, 6:59pm UTC](https://discuss.elastic.co/t/es-2-nodes-master-master-cluster-configuration/91541/8 "2017-07-02T18:59:17Z")

</div>

Be carefull of the command, **there is the index name in** , and it must change the configuration of an old indice named _"your\_index\_name"_:

```
curl -XPUT 'http://youIP:9200/your_index_name/_settings'
```

---

<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 30, 2017, 6:59pm UTC](https://discuss.elastic.co/t/es-2-nodes-master-master-cluster-configuration/91541/9 "2017-07-30T18:59:25Z")

</div>

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