# How to make nodes forget about the old/previous cluster?

**URL:** <https://discuss.elastic.co/t/how-to-make-nodes-forget-about-the-old-previous-cluster/306315>\
**Category:** Elasticsearch\
**Created:** [June 3, 2022, 9:47am UTC](https://discuss.elastic.co/t/how-to-make-nodes-forget-about-the-old-previous-cluster/306315 "2022-06-03T09:47:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AS11](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/as11/32/106438_2.png) [@AS11](https://discuss.elastic.co/u/AS11)\
**Post date:** [June 3, 2022, 9:47am UTC](https://discuss.elastic.co/t/how-to-make-nodes-forget-about-the-old-previous-cluster/306315/1 "2022-06-03T09:47:42Z")

</div>

I had (and still have) a running 3-node cluster **C1**. C1 has all 3 nodes ( **es0,es1,es2** ) as master nodes. Then, accessible within the same network, I wanted to set up a second cluster **C2** (nodes **es3,es4,es5** ), to which I would stream S3 snapshots, sourced from C1.

On first bootstrap, in `elasticsearch.yml` I mistakenly left `cluster.name` of C2 equal to C1's. But even after changing `cluster.name` of C2 to some other name, and restarting with `service elasticsearch restart`, C2 still cannot form a quorum and insists on waiting for votes from C1's nodes. Here's the relevant log from **es4** , from `/var/log/elasticsearch/<C2_corrected_name>_server.json`:

> {  
> "cluster.name" : "\<C2\_corrected\_name\>",  
> "component" : "o.e.c.c.ClusterFormationFailureHelper",  
> "level" : "WARN",  
> "message" : "master not discovered or elected yet, an election requires at least 2 nodes with ids from  
> [Khkwo1UuSviqddELYnjxSw, YYrzUrOyS4Woe2Q\_red0Fg, gP7n1qgQS5eDqzvvVQhKrw],
> 
> have only discovered non-quorum  
> [{ **es4** }{8zpt-krUQN-SZt2hWl8bwA}{_zS8t6lFTJSII-X3WzANAQ}{10.0.31.204}{10.0.31.204:9300}{cdfhilmrstw}, { **es3** }{0kVuUzneQamppCJtBZz75g}{Fnz4ga-dSuW9p7MSFapxLw}{10.0.9.20}{10.0.9.20:9300}{cdfhilmrstw}, { **es5** }{VfcgGh9FTUK85E1Xf8_-NQ}{x3v3gEDXTla\_WBY9FPCHGw}{10.0.37.24}{10.0.37.24:9300}{cdfhilmrstw}];  
> discovery will continue using [10.0.9.20:9300, 10.0.37.24:9300] from hosts providers and [{ **es4** }{8zpt-krUQN-SZt2hWl8bwA}{\_zS8t6lFTJSII-X3WzANAQ}{10.0.31.204}{10.0.31.204:9300}{cdfhilmrstw}] from last-known cluster state; node term 5, last-accepted version 379 in term 5",  
> "node.name" : " **es4**",  
> "timestamp" : "",  
> "type" : "server"  
> }

All 6 nodes are of version 7.17.4. Ubuntu 18.04.6

How can I make C2's nodes (es3, es4, es5) forget about C1's nodes? Is [elasticsearch-node](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/node-tool.html#node-tool) the right tool?

Thanks.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [June 3, 2022, 10:00am UTC](https://discuss.elastic.co/t/how-to-make-nodes-forget-about-the-old-previous-cluster/306315/2 "2022-06-03T10:00:32Z")

</div>

> [@AS11](#):
>
> How can I make C2's nodes (es3, es4, es5) forget about C1's nodes?

This is (roughly) the situation described in [this section of the docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-bootstrap-cluster.html#modules-discovery-bootstrap-cluster-joining) which also describes the remedy: delete the contents of their data paths.

---

<div class="post-metadata">

**Author:** ![AS11](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/as11/32/106438_2.png) [@AS11](https://discuss.elastic.co/u/AS11)\
**Post date:** [June 3, 2022, 10:29am UTC](https://discuss.elastic.co/t/how-to-make-nodes-forget-about-the-old-previous-cluster/306315/3 "2022-06-03T10:29:51Z")

</div>

Thanks David. Here's what I did to now form a cluster between es3-5 nodes mentioned in OP.

```auto
service elasticsearch stop
rm -rf {path.data}/*
service elasticsearch start

```

I'd appreciate you confirming whether this is the ideal solution.

Also, thanks for [insisting that `elasticsearch-node` should only be used as a last resort](https://discuss.elastic.co/t/fix-broken-cluster-with-elasticsearch-node-detach-cluster-not-working/260070/18). Do I understand correctly that this is the preferred order to approach things:

1. if you have snapshots, then delete data-paths and restore from snapshots
2. if you do _not_ have snapshots, only then risk using `elasticsearch-node` as there's no other, third option anyway

What I'm not clear on is, doesn't option 1. guarantee data loss between 'now' and 'time-of-last-snapshot', as [also pointed out by Thomas in the same thread](https://discuss.elastic.co/t/fix-broken-cluster-with-elasticsearch-node-detach-cluster-not-working/260070/14)?

I initially, probably naively, hoped there'd be some way to surgically excise 'stale' nodes (in my case, es0,es1,es2 above) from `{path.data}/nodes/0/_state/`.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [June 3, 2022, 12:04pm UTC](https://discuss.elastic.co/t/how-to-make-nodes-forget-about-the-old-previous-cluster/306315/4 "2022-06-03T12:04:49Z")

</div>

> [@AS11](#):
>
> What I'm not clear on is, doesn't option 1. guarantee data loss between 'now' and 'time-of-last-snapshot',

It depends. Do they actually hold any data yet? If not, no problem. If they do, you have a few options. For instance you could stop ingestion and take a snapshot so that there is no difference between "now" and "time-of-last-snapshot".

> [@AS11](#):
>
> I initially, probably naively, hoped there'd be some way to surgically excise 'stale' nodes (in my case, es0,es1,es2 above) from `{path.data}/nodes/0/_state/` .

Nope, sorry, there's no user-serviceable parts inside the data directory. See [these docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html#data-path) for instance:

> **WARNING** : Don’t modify anything within the data directory or run processes that might interfere with its contents. If something other than Elasticsearch modifies the contents of the data directory, then Elasticsearch may fail, reporting corruption or other data inconsistencies, or may appear to work correctly having silently lost some of your data.

---

<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 1, 2022, 12:05pm UTC](https://discuss.elastic.co/t/how-to-make-nodes-forget-about-the-old-previous-cluster/306315/5 "2022-07-01T12:05:35Z")

</div>

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