This technique allows merging two separate Elasticsearch clusters or rename renaming an Elasticsearch cluster, which . This is done performed by retiring an Elasticsearch node "into" a new Elasticsearch cluster.
Join one or more existing nodes to the new cluster by changing
theirthe
cluster.name
value to the new cluster’s name.Verify the join.
To migrate shards off of the old nodes, decommission Decommission a node by telling the cluster to exclude it from allocation to migrate shards off of the old nodes.
Code Block language bash curl -XPUT localhost:9200/_cluster/settings -d '{ "transient" :{ "cluster.routing.allocation.exclude._ip" : "10.0.0.1" } }';echo
This causes Elasticsearch to allocate the shards on that node to the remaining nodes, which is done performed without the state of the cluster changing to yellow or red (even replication 0).
When Shut down the node when all shards are reallocated, shut down .
Include the node .To for allocation to restore the node to service, include the node for allocation, which causes Elasticsearch to rebalance the shards again.
See the Elasticsearch documentation.