How to upgrading Elasticsearch To A Newer Version
The key is exporting the instance.
Disable shard movement
curl -XPUT http://elk2.domain.com:9200/_cluster/settings -d ' { "transient": { "cluster.routing.allocation.enable": "none" } }'
Migrate to new version (on linux)
export INS=1 alias cp=cp cd /opt /opt/elasticsearch-ins${INS}/bin/start_elastic.sh stop unzip -qq /var/tmp/elasticsearch-2.3.0.zip mv elasticsearch-ins${INS} elasticsearch-ins${INS}-2.2 mv elasticsearch-2.3.0 elasticsearch-ins$INS cd elasticsearch-ins${INS} cp -rp ../elasticsearch-ins${INS}-2.2/current . cp -rp ../elasticsearch-ins${INS}-2.2/config/elasticsearch.yml config/. cp -rp ../elasticsearch-ins${INS}-2.2/bin/start_elastic.sh bin/. chown -R elastic:elastic /opt/elasticsearch-ins${INS} /opt/elasticsearch-ins${INS}/bin/start_elastic.sh start
Migrate to new version (on solaris)
export INS=1 cd /opt svcadm disable -s d${INS}/elasticsearch unzip -qq /var/tmp/elasticsearch-2.3.0.zip mv elasticsearch-d${INS} elasticsearch-d${INS}-2.2 mv elasticsearch-2.3.0 elasticsearch-d$INS cd elasticsearch-d${INS} cp -rp ../elasticsearch-d${INS}-2.2/current . cp -rp ../elasticsearch-d${INS}-2.2/config/elasticsearch.yml config/. chown -R elastic:elastic /opt/elasticsearch-d${INS} svcadm enable -s d${INS}/elasticsearch
Re-enable shared movement, once the cluster is back up
curl -XPUT http://elk2.domain.com:9200/_cluster/settings -d ' { "transient": { "cluster.routing.allocation.enable": "all" } }'