# Elasticsearch cluster replication

**URL:** <https://discuss.elastic.co/t/elasticsearch-cluster-replication/333752>\
**Category:** Elasticsearch\
**Created:** [May 18, 2023, 9:22am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-replication/333752 "2023-05-18T09:22:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmed.emad](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@ahmed.emad](https://discuss.elastic.co/u/ahmed.emad)\
**Post date:** [May 18, 2023, 9:22am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-replication/333752/1 "2023-05-18T09:22:56Z")

</div>

hello,

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

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 18, 2023, 9:34am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-replication/333752/2 "2023-05-18T09:34:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ahmed.emad](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@ahmed.emad](https://discuss.elastic.co/u/ahmed.emad)\
**Post date:** [May 20, 2023, 5:37pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-replication/333752/3 "2023-05-20T17:37:35Z")

</div>

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

> [@Christian\_Dahlqvist](#):
>
> Update index settings and index templates in case you want to have a replica shard for increased resiliency.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 21, 2023, 7:08am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-replication/333752/4 "2023-05-21T07:08:19Z")

</div>

Have a look at the following links:

> **[Update index settings API | Elasticsearch Guide \[8.7\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.7/indices-update-settings.html)**

> **[Index templates | Elasticsearch Guide \[8.7\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.7/index-templates.html)**

---

<div class="post-metadata">

**Author:** ![ahmed.emad](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@ahmed.emad](https://discuss.elastic.co/u/ahmed.emad)\
**Post date:** [May 21, 2023, 10:56am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-replication/333752/5 "2023-05-21T10:56:59Z")

</div>

thanks a alot

---

<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:** [June 18, 2023, 10:57am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-replication/333752/6 "2023-06-18T10:57:24Z")

</div>

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