官方文档 Upgrading Elasticsearch

Before upgrading Elasticsearch:
- Consult the breaking changes docs.
- Use the Elasticsearch Migration Plugin to detect potential issues before upgrading.
- Test upgrades in a dev environment before upgrading your production cluster.
- Always back up your data before upgrading. You cannot roll back to an earlier version unless you have a backup of your data.
- If you are using custom plugins, check that a compatible version is available.
Elasticsearch can usually be upgraded using a rolling upgrade process, resulting in no interruption of service. This section details how to perform both rolling upgrades and upgrades with full cluster restarts.
To determine whether a rolling upgrade is supported for your release, please consult this table:
Upgrade From | Upgrade To | Supported Upgrade Type |
---|---|---|
|
|
|
|
|
Rolling upgrade (where |
|
|
|
|
|
|
|
|
Rolling upgrade (where |

Indices created in Elasticsearch 1.x or before
Elasticsearch is able to read indices created in the previous major version only. For instance, Elasticsearch 5.x can use indices created in Elasticsearch 2.x, but not those created in Elasticsearch 1.x or before.
This condition also applies to indices backed up with snapshot and restore. If an index was originally created in 1.x, it cannot be restored into a 5.x cluster even if the snapshot was made by a 2.x cluster.
Elasticsearch 5.x nodes will fail to start in the presence of too old indices.
See Reindex to upgrade for more information about how to upgrade old indices.
!!!回滚升级就是一次升级一个节点!!!!
A rolling upgrade allows the Elasticsearch cluster to be upgraded one node at a time, with no downtime for end users. Running multiple versions of Elasticsearch in the same cluster for any length of time beyond that required for an upgrade is not supported, as shards will not be replicated from the more recent version to the older version.
Elasticsearch is able to use indices created in the previous major version only. For instance, Elasticsearch 5.x can use indices created in Elasticsearch 2.x, but not those created in Elasticsearch 1.x or before.

Elasticsearch 5.x nodes will fail to start in the presence of too old indices.
If you are running an Elasticsearch 2.x cluster which contains indices that were created before 2.x, you will either need to delete those old indices or to reindex them before upgrading to 5.x. See Reindex in place.
If you are running an Elasticsearch 1.x cluster, you have two options:
- First upgrade to Elasticsearch 2.4.x, reindex the old indices, then upgrade to 5.x. See Reindex in place.
- Create a new 5.x cluster and use reindex-from-remote to import indices directly from the 1.x cluster. See Upgrading with reindex-from-remote.
The easiest way to reindex old (1.x) indices in place is to use the Elasticsearch Migration Plugin. You will need to upgrade to Elasticsearch 2.3.x or 2.4.x first.
If you are running a 1.x cluster and would like to migrate directly to 5.x without first migrating to 2.x, you can do so using reindex-from-remote.
转自:https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-upgrade.html#setup-upgrade
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」