Elasticsearch 6.5集群升级6.8

当前版本为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
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。