Elasticsearch cluster replication


if i have 2 nodes standalone elasticsearch working with scenario:

node-1 : have elasticsearch and logstash and logstash send logs let's called it "index-1"

node-2 : have elasticsearch and logstash and logstash sends logs let's called it "index-2"

now i am required to cluster these two nodes with a third new node, so i need to know they will replicate old data to each other or not ? and there will be data loss if i clustered them ?

thanks in advance

You can not join nodes that belong to different clusters, so what you need to do is:

  • Stop Logstash so no indexing takes place
  • Copy all data from node-2 to node-1. You can do this using snapshot and restore or by reindexing from remote.
  • Update the config of node-1 so it can be part of a cluster. This may mean changing network interface etc.
  • Stop node-2
  • Delete all data from the data path of node-2
  • Update configuration of node-2 so it is configured to join the node-1 cluster as a new empty node
  • Restart node-2 and make sure it forms a cluster with node-1.
  • Update index settings and index templates in case you want to have a replica shard for increased resiliency.
  • You can now restart Logstash.
  • Add node-3 as a new empty node to the cluster
1 Like

hello, thanks for your help but I need to know how to do this part in the configuration below.

Have a look at the following links:

1 Like

thanks a alot

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