Convert cluster to single node

Sorry for probably a stupid question, but I am relatively new to elasticsearch.

My Problem is, I have a running cluster on three different machines.
As this machines were never on the limit we want to use (at least) one of the machines for different purposes.
I can find questions like howto change from single-node to cluster, but I cannot find the other way.

So my question is can I just "switch off" the machine?
Is there any way to convert a cluster into a single-node?
Or a way to migrate the "to be switched off" node to one of the remaining machines ?
Can anyone give me a hint to a place where the howto do "this" is described?
thanks a lot

You can try as follow :

  • Make sure all indices are having 0 replicas
  • Stpp node 3 and check shards have been re allocated to node 1 & node 2
  • Stop node 2 and check shards have been re allocated to node 1
  • Update node 1 config (mainly discovery.seed_hosts & cluster.initial_master_nodes)
  • Restart node 1
    ....

Note that in that case if anything goes wrong with your single node, you won't have any replication anywhere and you will need to rebuild the indices from scratch.

1 Like

You must never update cluster.initial_master_nodes. Since this cluster is already running this setting shouldn't even be present any more.

2 Likes

Many thanks for the suggestions.

So I first have to find out point 1:
Make sure all indices are having 0 replicas :wink:

Is it maybe possible to start a second instance on the master node to have 2 nodes on one machine and 1 on another to keep the cluster intact? Or is this not suggested?

This is not recommended and useless IMO. If the machine crashes it crashes.
Just be aware that you are not protected anymore and if it's fine for your use case to have a failure during the time you need to rebuild your index then that's fine.

If your use case can't suffer from such outage, keep the architecture as it was until today.

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