美文网首页
Elasticsearch 6.5集群升级6.8

Elasticsearch 6.5集群升级6.8

作者: 小兽S | 来源:发表于2020-06-08 10:29 被阅读0次

当前版本为6.5,升级到7需要先升级到6.8

1.滚动升级步骤

选取一个节点开始操作

1).禁用分片分配

PUT _cluster/settings
{
  "persistent": {
    "cluster.routing.allocation.enable": "primaries"
  }
}

2).停止不必要的索引创建和使用异步刷新

POST _flush/synced

3).停止机器学习相关,实际调用发现报错,只能暂时先不管

POST _ml/set_upgrade_mode?enabled=true

4).停止该节点

停止Elasticsearch进程,kill

5).升级该节点

新版本解压,相关插件升级同步

6).启动新升级的节点

启动之后通过GET _cat/nodes查看是否已经在集群中:http://192.168.182.231:9200/_cat/nodes

7).重新开启分片分配

PUT _cluster/settings
{
  "persistent": {
    "cluster.routing.allocation.enable": null
  }
}

或者

curl -X PUT -u 'elastic:******' "http://192.168.182.230:9200/_cluster/settings" -H 'Content-Type: application/json' -d'
{
  "persistent": {
    "cluster.routing.allocation.enable": null
  }
}
'

等待节点数据同步,查看情况通过

GET _cat/health?v

8).恢复同步刷新

GET _cat/recovery

其他节点重复上面操作

继续机器学习,升级到6.8后该请求可用了

POST _ml/set_upgrade_mode?enabled=false

相关文章

网友评论

      本文标题:Elasticsearch 6.5集群升级6.8

      本文链接:https://www.haomeiwen.com/subject/luwxphtx.html