Merging and Renaming ES Clusters
This technique allows merging two separate Elasticsearch clusters or renaming an Elasticsearch cluster. This is performed by retiring an Elasticsearch node "into" a new Elasticsearch cluster.
Join one or more existing nodes to the new cluster by changing the
cluster.name
value to the new cluster’s name.Verify the join.
Decommission a node by telling the cluster to exclude it from allocation to migrate shards off of the old nodes.
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 performed without the state of the cluster changing to yellow or red (even replication 0).
Shut down the node when all shards are reallocated.
Include the node for allocation to restore the node to service, which causes Elasticsearch to rebalance the shards again.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-cluster.html.
© DataCore Software Corporation. · https://www.datacore.com · All rights reserved.