# Merging ES Clusters

**URL:** <https://discuss.elastic.co/t/merging-es-clusters/306419>\
**Category:** Elasticsearch\
**Created:** [June 6, 2022, 4:56am UTC](https://discuss.elastic.co/t/merging-es-clusters/306419 "2022-06-06T04:56:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moe\_Hmaidan](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@Moe\_Hmaidan](https://discuss.elastic.co/u/Moe_Hmaidan)\
**Post date:** [June 6, 2022, 4:56am UTC](https://discuss.elastic.co/t/merging-es-clusters/306419/1 "2022-06-06T04:56:24Z")

</div>

Hi All,

**We have two clusters:-**

- Cluster A we have 5 new nodes running ES v7.17 (All data nodes out of which two are master)

- Cluster A Contains no data what so ever it was meant to be a backup cluster but now they want it to be active

- Cluster B 10 active nodes Running ES v7.9.3(All data nodes, 2 master).

- Cluster B Contains data that can be backed up using snapshot repository.

Can someone suggest how to merge these two cluster because we were asked to.

**Need to meet below two conditions:**

- No data loss.
- Minimal downtime.

**My idea was to go about it by doing the following**

1. backup cluster B using snapshot
2. redirect all data sources to cluster A
3. update all cluster B ES to 7.17
4. Vote out nodes one by one from Cluster B
5. Generate a new UUID on said node or delete the /data directory which contains the current UUID
6. setup ES conf on node to join cluster A
7. After all nodes are moved backup the snapshot to the new cluster

**I did not proceed with my takeaway because of l:**

1. I just don't know if this will work and how to proceed with step number 5 to get rid of the old UUID
2. can i backup the snapshot to the new cluster to retrieve old data

_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:** [June 6, 2022, 5:17am UTC](https://discuss.elastic.co/t/merging-es-clusters/306419/2 "2022-06-06T05:17:42Z")

</div>

I would recommend instead doing the following:

1. Make another node in cluster A a master node. [You should always have at least 3 master eligible nodes in any cluster](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/high-availability-cluster-design.html). Having just 2 nodes does not allow one of the master eligible noides to go down without making the cluster unavailable.
2. Perform a [rolling upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/rolling-upgrades.html) of cluster A to Elasticsearch 7.17. Take a snapshot prior to the upgrade.
3. Shut down all nodes in cluster B, clear the data path, change the config and restart them so they can join cluster A as data nodes.

---

<div class="post-metadata">

**Author:** ![Moe\_Hmaidan](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@Moe\_Hmaidan](https://discuss.elastic.co/u/Moe_Hmaidan)\
**Post date:** [June 6, 2022, 5:25am UTC](https://discuss.elastic.co/t/merging-es-clusters/306419/3 "2022-06-06T05:25:08Z")

</div>

I apologize cluster A is actually configured to have 3 master-eligible nodes I learned from my mistakes.

I'll try to do as you said but just to be make it clear by clearing the data you mean all of the Elasticsearch.conf directive " **path.data**" content and folder am i right?

---

<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:** [June 6, 2022, 5:27am UTC](https://discuss.elastic.co/t/merging-es-clusters/306419/4 "2022-06-06T05:27:09Z")

</div>

> [@Moe\_Hmaidan](#):
>
> I'll try to do as you said but just to be make it clear by clearing the data you mean all of the Elasticsearch.conf directive " **path.data**" content and folder am i right?

Yes, the nodes in cluster B need to join as completely new data nodes that have no knowledge of being part of any prior cluster.

---

<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:** [July 4, 2022, 5:27am UTC](https://discuss.elastic.co/t/merging-es-clusters/306419/5 "2022-07-04T05:27:21Z")

</div>

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