Change ES cluster_uuid

I saw that I have two different cluster with the same cluster_uuid. I don't know how this could happened but I can say that I cloned one node from the first cluster to create the new one.
is there a way to change the cluster_uuid?

That would explain it :slight_smile: It's best not to clone nodes, it can cause all sorts of strange issues.

Yes, the elasticsearch-node unsafe-bootstrap tool will generate a new cluster UUID.

really thanks for your answer. not really easy to find that doc page :frowning:

regarding the clone operation: I was thinking that cloning a node to create a new cluster and deleting the data folder before to start it was a safe procedure.

regarding elasticsearch-node detach-cluster: what will happen to the data contained into detached node? will be erased?

Yes, it's deliberately well-hidden because if you need it then you are doing something a long way from the recommended path, and there's a good chance of losing data or of something equally weird happening.

I'm not sure how "cloning a node and deleting the data folder" differs from just making a new empty node. In any case the cluster UUID is stored in the data folder, so if you have two clusters with the same UUID then you must have not cleared out the data folder properly.

detach-cluster will not itself delete any data but again, if you need it then you're a long way from the recommended path and there's a good chance that subsequent steps will get you deeper into trouble.

1 Like

Yeah, I'm smiling when I read about the "well-hidden" feature. But now I know something new :slight_smile:

Clone a node was a choice made at the beginning of my experience with elasticsearch. Now, for sure, I will not use this technique.

Anyway, why I should need to move a node from a cluster to another one?

You shouldn't. It's a really bad idea.

1 Like

ok, could I consider the option elasticsearch-node detach-cluster as an old feature not helpful?

Yes, it's something that you could do rather easily (even inadvertently) in older versions so it's still supported in the name of compatibility, but in no way is it a good idea to try it :slight_smile:

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