How to setup cluster with 2 Nodes with same index with different data

I have 2 nodes - same index but have different data date wise as. What is the configuration of the nodes so that I can get both data from cluster url

Where Node 1 - contains 2018 year data
node 2 - contains 2019 year data

I tried -

Node 1 - yml

cluster.name: elasticsearch-1
node.name: elasticsearch-1
node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["node1","node2"]

Node 2 - yml

cluster.name: elasticsearch-1
node.name: elasticsearch-2
node.master: false
node.data: true
discovery.zen.ping.unicast.hosts: ["node1","node2"]

But I can see only Node 1 data

I need to see combined node 1 & 2 data

Please help

Thanks

Welcome! :smiley:
What version are you running?

Version - 6.8.8

What do your Elasticsearch logs show then, they should be trying to connect to each other.

Please aso format your code/logs/config using the </> button, or markdown style back ticks. It helps to make things easy to read which helps us help you :slight_smile:

I can see Master's (node 1) data on both the nodes but cant see node 2 data

Node 2 server giving below log specially for the index I am looking for

[2020-05-15T05:06:51,915][WARN ][o.e.g.DanglingIndicesState] [elasticsearch-2] [[tachyonlivelogs/AoEZlDvhSW2AZvUuZKGSVg]] can not be imported as a dangling index, as index with same name already exists in cluster metadata

Ah ok, so you have the exact same index name, that won't work. You should really use a naming structure like tachyonlivelogs-2019 to keep things logically separated.