ES 2 nodes Master Master Cluster Configuration

ES Config:

Node 1:

cluster.name: mycluster
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: mycluster
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 ?

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

@warkolm
in my above configuration i added index.number_of_replicas: 1

new configuration something like this

Node 1:
cluster.name: mycluster
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: mycluster
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

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 :

Xavier

@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?

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
  }
  }'

@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.

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'

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