0

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 ?

Groovy
  • 57
  • 1
  • 10
  • Do you have set the number of replicas for your index? With 2 nodes, it should be 1. – Ohlsen1980 Jun 30 '17 at 10:02
  • @Ohlsen1980..By Replica you mean data node right? Is it necessary to have data node right? I I'll add one data node say data node-3 then on which nodes data will be replicated? – Groovy Jun 30 '17 at 10:23
  • The index will be replicated to each node, if you have defined the number of replicas. E.g. if the number of replicas is 0, the data will not be copied to another node. If it is 1, it will be copied to one other node and so on... See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html – Ohlsen1980 Jun 30 '17 at 10:27
  • 1
    @Ohlsen1980.. So I should specify index.number_of_replicas: 1 or 2 in elasticsearch.yml acc to my set up? – Groovy Jun 30 '17 at 10:43
  • 2 nodes - 1 replica. – Ohlsen1980 Jun 30 '17 at 11:29
  • @Ohlsen1980.. I have added index.number_of_replicas: 1 in my above configuration. Is there anything I need to add because it is still now working after adding this,getting no_shard_available_action_exception. – Groovy Jul 02 '17 at 07:13
  • Can you post your complete configuration? – Ohlsen1980 Jul 05 '17 at 06:23

0 Answers0