ElasticSearch系列(5) 集群不间断服务的节点版本升级步骤
2017-03-03 13:47
459 查看
适用于elasticsearch的小版本升级,原文见:
https://www.elastic.co/guide/en/elasticsearch/reference/current/rolling-upgrades.html
升级步骤(rolling upgrade):
Disable shard allocation
When you shut down a node, the allocation process will wait for one minute before starting to replicate the shards that were on that node to other nodes in the cluster, causing a lot of wasted I/O. This can be avoided by disabling allocation
before shutting down a node:
Stop non-essential indexing and perform a synced flush (Optional)
You may happily continue indexing during the upgrade. However, shard recovery will be much faster if you temporarily stop non-essential indexing and issue a
synced-flush request:
A synced flush request is a “best effort” operation. It will fail if there are any pending indexing operations, but it is safe to reissue the request multiple times if necessary.
Stop and upgrade a single node
Shut down one of the nodes in the cluster
before starting the upgrade.
When using the zip or tarball packages, the
It is a good idea to place these directories in a different location so that there is no chance of deleting them when upgrading Elasticsearch. These custom paths can be
configured with the
The
Debian and
RPM packages place these directories in the appropriate place for each operating system.
To upgrade using a
Debian or
RPM package:
Use
To upgrade using a zip or compressed tarball:
Extract the zip or tarball to a new directory, to be sure that you don’t overwrite the
Either copy the files in the
Either copy the files in the
Upgrade any plugins
Elasticsearch plugins must be upgraded when upgrading a node. Use the
Start the upgraded node
Start the now upgraded node and confirm that it joins the cluster by checking the log file or by checking the output of this request:
Reenable shard allocation
Once the node has joined the cluster, reenable shard allocation to start using the node:
Wait for the node to recover
You should wait for the cluster to finish shard allocation before upgrading the next node. You can check on progress with the
Wait for the
During a rolling upgrade, primary shards assigned to a node with the higher version will never have their replicas assigned to a node with the lower version, because the newer version may have a different data format which is not understood by the older
version.
If it is not possible to assign the replica shards to another node with the higher version — e.g. if there is only one node with the higher version in the cluster — then the replica shards will remain unassigned and the cluster health will remain status
In this case, check that there are no initializing or relocating shards (the
As soon as another node is upgraded, the replicas should be assigned and the cluster health will reach status
Shards that have not been
sync-flushed may take some time to recover. The recovery status of individual shards can be monitored with the
If you stopped indexing, then it is safe to resume indexing as soon as recovery has completed.
Repeat
When the cluster is stable and the node has recovered, repeat the above steps for all remaining nodes.
https://www.elastic.co/guide/en/elasticsearch/reference/current/rolling-upgrades.html
升级步骤(rolling upgrade):
Disable shard allocation
When you shut down a node, the allocation process will wait for one minute before starting to replicate the shards that were on that node to other nodes in the cluster, causing a lot of wasted I/O. This can be avoided by disabling allocation
before shutting down a node:
PUT _cluster/settings { "transient": { "cluster.routing.allocation.enable": "none" } }
Stop non-essential indexing and perform a synced flush (Optional)
You may happily continue indexing during the upgrade. However, shard recovery will be much faster if you temporarily stop non-essential indexing and issue a
synced-flush request:
POST _flush/synced
A synced flush request is a “best effort” operation. It will fail if there are any pending indexing operations, but it is safe to reissue the request multiple times if necessary.
Stop and upgrade a single node
Shut down one of the nodes in the cluster
before starting the upgrade.
When using the zip or tarball packages, the
config,
data,
logsand
pluginsdirectories are placed within the Elasticsearch home directory by default.
It is a good idea to place these directories in a different location so that there is no chance of deleting them when upgrading Elasticsearch. These custom paths can be
configured with the
path.conf,
path.logs, and
path.datasettings, and using
ES_JVM_OPTIONSto specify the location of the
jvm.optionsfile.
The
Debian and
RPM packages place these directories in the appropriate place for each operating system.
To upgrade using a
Debian or
RPM package:
Use
rpmor
dpkgto install the new package. All files should be placed in their proper locations, and config files should not be overwritten.
To upgrade using a zip or compressed tarball:
Extract the zip or tarball to a new directory, to be sure that you don’t overwrite the
configor
datadirectories.
Either copy the files in the
configdirectory from your old installation to your new installation, or set the environment variable
ES_JVM_OPTIONSto the location of the
jvm.optionsfile and use the
-E path.conf=option on the command line to point to an external config directory.
Either copy the files in the
datadirectory from your old installation to your new installation, or configure the location of the data directory in the
config/elasticsearch.ymlfile, with the
path.datasetting.
Upgrade any plugins
Elasticsearch plugins must be upgraded when upgrading a node. Use the
elasticsearch-pluginscript to install the correct version of any plugins that you need.
Start the upgraded node
Start the now upgraded node and confirm that it joins the cluster by checking the log file or by checking the output of this request:
GET _cat/nodes
Reenable shard allocation
Once the node has joined the cluster, reenable shard allocation to start using the node:
PUT _cluster/settings { "transient": { "cluster.routing.allocation.enable": "all" } }
Wait for the node to recover
You should wait for the cluster to finish shard allocation before upgrading the next node. You can check on progress with the
_cat/healthrequest:
GET _cat/health
Wait for the
statuscolumn to move from
yellowto
green. Status
greenmeans that all primary and replica shards have been allocated.
During a rolling upgrade, primary shards assigned to a node with the higher version will never have their replicas assigned to a node with the lower version, because the newer version may have a different data format which is not understood by the older
version.
If it is not possible to assign the replica shards to another node with the higher version — e.g. if there is only one node with the higher version in the cluster — then the replica shards will remain unassigned and the cluster health will remain status
yellow.
In this case, check that there are no initializing or relocating shards (the
initand
relocolumns) before proceding.
As soon as another node is upgraded, the replicas should be assigned and the cluster health will reach status
green.
Shards that have not been
sync-flushed may take some time to recover. The recovery status of individual shards can be monitored with the
_cat/recoveryrequest:
GET _cat/recovery
If you stopped indexing, then it is safe to resume indexing as soon as recovery has completed.
Repeat
When the cluster is stable and the node has recovered, repeat the above steps for all remaining nodes.
相关文章推荐
- Elasticsearch 集群版本升级步骤及注意事项
- Elasticsearch 集群版本升级步骤及注意事项
- Oozie的详细启动步骤(CDH版本的3节点集群)
- ES跨版本升级?——难道升级集群发生shard allocation是因为要分配replica节点???
- (升级修改版1.1)集群配置(Torque安装配置+Maui安装配置+SSH免验证设置+节点共享目录(NFS服务)设置+NIS服务设置+用户硬盘空间限制和核心使用限制设置)异常详细版
- elasticSearch深度剖析之集群升级规范操作步骤
- WAS集群系列(9):集群搭建:步骤7:添加节点
- ElasticSearch系列(6) 集群快速安装及升级技巧
- 集群版本升级——rolling upgrade在ES 单节点从 restart 到加入集群,大概要 100s 左右的时间。也就是说,这 100s 内,该节点上的所有分片都是 unassigned 状态
- 集群节点Elasticsearch升级
- Cloudera Manager安装之利用parcels方式(在线或离线)安装单节点集群(包含最新稳定版本或指定版本的安装)(添加服务)(Ubuntu14.04)(四)
- ElasticSearch集群未连接 无法发现节点(windows环境)以及windows环境下设置服务 不能自动启动的问题
- WAS集群系列(6):集群搭建:步骤4:安装WAS升级软件
- WAS集群系列(6):集群搭建:步骤4:安装WAS升级软件
- ElasticSearch优化系列一:集群节点规划
- nginx版本平滑升级步骤
- nginx的平滑升级,不间断服务
- Ubuntu 升级系统版本为最新的官方步骤
- 云服务系列:Windows Azure SDK for .NET(2012 年 6 月发布的版本)的最新消息