Hi,
We have 3 node elastic search cluster and for certain reason we have to get rid of those VMs, now i need to migrate the data from the existing cluster to new one without a down time.
I thought of adding 3 new nodes to the existing cluster and then shut down the existing nodes one by one. is this a good idea at all?
or
please suggest a best method.
Hi,
Yes, it's the easy way.
1°/ Add new nodes in your cluster, with master eligible and data flags enable.
2°/ Exclude old nodes on by one from the cluster, this will move shards to new nodes:
curl -XPUT 'http://ip-new-node:9200/_cluster/settings?pretty' -H "Content-Type: application/json" -d '
{
"transient" : {
"cluster.routing.allocation.exclude._name" : "name-of-an-old-node"
}
}'
When the old node doesn't have data anymore, you can stop the service and stop the machine !
Repeat 3x for your 3 old nodes.
bye,
Xavier
Thanks a lot, @xavierfacq
One quick question. should i stop logstash from feeding the old ES node? before I do the second step. I am bit confused at that.?
regards
Parvat
Not certain, but it's quite possible that Logstash will see new nodes even if you stop the old. But, I think that you shoud restart your Logstash with new nodes IPS before stopping old nodes.
bye,
Xavier