# How to move from 3 node cluster to single node

**URL:** <https://discuss.elastic.co/t/how-to-move-from-3-node-cluster-to-single-node/351132>\
**Category:** Elasticsearch\
**Tags:** snapshot-and-restore\
**Created:** [January 16, 2024, 8:29am UTC](https://discuss.elastic.co/t/how-to-move-from-3-node-cluster-to-single-node/351132 "2024-01-16T08:29:08Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [January 16, 2024, 12:24pm UTC](https://discuss.elastic.co/t/how-to-move-from-3-node-cluster-to-single-node/351132/4 "2024-01-16T12:24:34Z")

</div>

> [@Mohammed\_Ahmed](#):
>
> i want to know how can we shift from this to single node without breaking any flow or loss of data

This is not something simple to do because all your nodes are master eligible, and if you remove two nodes from your cluster it will not work anymore

Also, you can not do that without stopping the nodes, this is not possible, you will need to stop it to change some configurations.

First thing would be to exclude the 2 nodes you want to remove from allocation following the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-cluster.html#cluster-shard-allocation-filtering).

Just run the following request on Kibana dev tools:

```auto
PUT _cluster/settings
{
  "persistent" : {
    "cluster.routing.allocation.exclude._ip" : "NODE-IP, ANOTHER-NODE-IP"
  }
}

```

This will make the shards move from these 2 nodes to the remaining nodes, this can take time and you need to make sure that the remaining node has enough space to have all your data or else this will not work.

Also, Before doing that you will need to set the number of replicas to zero in all your indices:

Something like this:

```auto
PUT /*/_settings
{
    "index" : {
        "number_of_replicas" : 0
    }
}

```

After all the shards are moved out from the 2 nodes that will be excluded you will to stop all the nodes and change the configuration of the remaining node before starting it again.

Basically you will need this config, assuming that the remaining node is the `es-autosuggest-1`.

```auto
cluster.name: hotels-autosuggest
node.name: "es-autosuggest-1"
path.logs: /var/log/elasticsearch
path.data: /data/elasticsearch/data
bootstrap.memory_lock: true
network.host: 0.0.0.0
discovery.seed_hosts: ["es-autosuggest-1.com"]
discovery.type: "single-node"
http.port: 9200
xpack.security.enabled: false

```

I did not test this, so you will need to test to see if this work, I recommend to have a snapshot of your data to avoid any issue.

---

_[View the full topic](https://discuss.elastic.co/t/how-to-move-from-3-node-cluster-to-single-node/351132)._
