从5.2.2升级到6.4.2(yum安装VS yum更新)

时间:2018-10-16 10:05:49

标签: elasticsearch

需要在3节点ES群集上执行升级并编写测试脚本,然后再将其放入Playbook。任何人都使用yum update而不是安装(OS AWS RHEL 7.2)更新了ES

这是安装脚本,感谢您的评论:

#Installing from the RPM repository
#Create a file called elasticsearch.repo in the /etc/yum.repos.d/ directory for RedHat based distributions, 

#DO UPGRADE
#In the terms of ordering, update first the master nodes, then data nodes, then load-balancing/client nodes.

#Disable Shard reallocation
curl -XPUT localhost:9200/_cluster/settings -d '{ "transient" : { "cluster.routing.allocation.enable" : "none" } }'

#Shutdown the instance:
curl -XPOST 'http://localhost:9200/_cluster/nodes/_local/_shutdown'

sudo systemctl stop elasticsearch
sudo yum update elasticsearch
sudo systemctl start elasticsearch

#Enable shard re-allocation:
curl -XPUT localhost:9200/_cluster/settings -d '{ "transient" : { "cluster.routing.allocation.enable" : "all" } }'

#Watch cluster go from yellow state to green with:
curl -X GET http://localhost:9200/_cat/health?v // monitors the overal cluster state
curl -X GET http://localhost:9200/_cat/nodes?v // verify that the new node joined the cluster
curl -X GET http://localhost:9200/_cat/shards?v // see shards being started, initialized and relocated

#Repeat for the next node.

亲切的问候,

1 个答案:

答案 0 :(得分:0)

答案是肯定的。 YUM UPDATE将ES升级为最新版本。

确保您拥有:

1)将/etc/yum.repos.d/elasticsearch.repo更新为最新的6.x版本

2)所有索引的创建版本都高于5.x(如果没有,则必须重新索引)

curl -X GET http://host_ip:9200/index_name/_settings?pretty\&human

亲切的问候,