Replacing node with same name

I have 3 node cluster, all of them are master+data
all rpms/binary are on standard place
all data are on /data01

I would like to replace them with new better hardware but keep same name.

Can I do following?
Shutdown elasticsearch on all three node.
copy all the /data01/* from master1 to new_master1
shutdown master1
rename new_master1 -> master1

and start elasticsearch cluster (all three node)

will it work?

Or will this work?
should I add Node4 as master/data.

shutdown elasticsearch on node1
copy all /data01/* to new node, and rename that new system to node1
and start elasticsearch on it.

I would like to replace them with new better hardware but keep same name.

Does a rolling upgrade work for you? See Rolling upgrade | Elasticsearch Guide [8.11] | Elastic . Ignore the parts where it talks about an Elasticsearch software upgrade - the restart sequence is the same for a hardware replacement. Only do this if you have at least one replica per shard, as you typically will in production.

During the Upgrade step, you can set the hostname of the new node to be the same as the old one.

You can move the data folder if you like, but if it's not very big I would just add the upgraded node empty at step 3, so it simply rebuilds the data from the other nodes.

in sort it is doable. Let me give it a try.
will give it a try to this end of next week. and will update this thread.

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