ES跨版本升级?——难道升级集群发生shard allocation是因为要分配replica节点???
2017-08-28 15:31
489 查看
Full cluster restart upgrade
Elasticsearch requires a full cluster restart when upgrading across major versions. Rolling upgrades are not supported across major versions. Consult this table to verify that a full cluster restart is required.The process to perform an upgrade with a full cluster restart is as follows:
Disable shard allocation——防止分片大量复制数据
When you shut down a node, the allocation process will immediately try 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 { "persistent": { "cluster.routing.allocation.enable": "none" } }
COPY AS CURLVIEW IN CONSOLE
Perform a synced flush
Shard recovery will be much faster if you stop indexing and issue a synced-flush request:
POST _flush/synced
COPY AS CURLVIEW IN CONSOLE
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.
Shutdown and upgrade all nodes
Stop all Elasticsearch services on all nodes in the cluster. Each node can be upgraded following the same procedure described in [upgrade-node].
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 cluster——先启动主节点,然后再是数据节点
If you have dedicated master nodes — nodes with
node.masterset to
true(the default) and
node.dataset to
false— then it is a good idea to start them first. Wait for them to form a cluster and to elect a master before proceeding with the data nodes. You can check progress by looking at the logs.
As soon as the minimum number of master-eligible nodes have discovered each other, they will form a cluster and elect a master. From that point on, the
_cat/healthand
_cat/nodesAPIs can be used to monitor nodes joining the cluster:
GET _cat/health GET _cat/nodes
COPY AS CURLVIEW IN CONSOLE
Use these APIs to check that all nodes have successfully joined the cluster.
Wait for yellow
As soon as each node has joined the cluster, it will start to recover any primary shards that are stored locally. Initially, the
_cat/healthrequest will report a
statusof
red, meaning that not all primary shards have been allocated.
Once each node has recovered its local shards, the
statuswill become
yellow, meaning all primary shards have been recovered, but not all replica shards are allocated. This is to be expected because allocation is still disabled.
Reenable allocation
Delaying the allocation of replicas until all nodes have joined the cluster allows the master to allocate replicas to nodes which already have local shard copies. At this point, with all the nodes in the cluster, it is safe to reenable shard allocation:
PUT _cluster/settings { "persistent": { "cluster.routing.allocation.enable": "all" } }
COPY AS CURLVIEW IN CONSOLE
The cluster will now start allocating replica shards to all data nodes(难道升级集群发生shard allocation是因为要分配replica节点???). At this point it is safe to resume indexing and searching, but your cluster will recover more quickly if you can delay indexing and searching until all shards have recovered.
You can monitor progress with the
_cat/healthand
_cat/recoveryAPIs:
GET _cat/health GET _cat/recovery
COPY AS CURLVIEW IN CONSOLE
Once the
statuscolumn in the
_cat/healthoutput has reached
green, all primary and replica shards have been successfully allocated.
相关文章推荐
- 集群版本升级——rolling upgrade在ES 单节点从 restart 到加入集群,大概要 100s 左右的时间。也就是说,这 100s 内,该节点上的所有分片都是 unassigned 状态
- Elasticsearch之重要核心概念(cluster(集群)、shards(分配)、replicas(索引副本)、recovery(据恢复或叫数据重新分布)、gateway(es索引的持久化存储方式)、discovery.zen(es的自动发现节点机制机制)、Transport(内部节点或集群与客户端的交互方式)、settings(修改索引库默认配置)和mappings)
- ElasticSearch系列(5) 集群不间断服务的节点版本升级步骤
- Cloudera Manager安装之利用parcels方式(在线或离线)安装单节点集群(包含最新稳定版本或指定版本的安装)(添加服务)(Ubuntu14.04)(四)
- es集群:禁止分片和副本分配
- Redis主从复制和集群配置系列之六(redis集群节点新增、删除、重新分配slot实战)
- SpringBoot获取Redis集群实例有缺少的问题->为Redis集群新增节点分配slot
- 在线HA集群HANA版本从122.01升级到122.05版本问题记录
- es集群master节点配置组合
- 区块链(3):在以太坊私有链建立节点集群并发生交易
- hadoop2.0集群版本在线升级方法
- 区块链入门(3):在以太坊私有网络中建立节点集群,并发生交易
- ES 集群调整、升级 最佳实践
- Eleastisearch6.0.0由单节点升级到多节点集群cluster时候出现的分片同步错误问题解决
- mongodb-erlang driver Replica Set Secondary节点分配不均衡的问题
- ES 内存使用和GC指标——主节点每30秒会去检查其他节点的状态,如果任何节点的垃圾回收时间超过30秒(Garbage collection duration),则会导致主节点任务该节点脱离集群。
- Hadoop2.2.0版本多节点集群安装及测试
- jewel版本vstart脚本单节点启动多个集群
- 在以太坊私有网络中建立节点集群,并发生交易
- (升级修改版1.1)集群配置(Torque安装配置+Maui安装配置+SSH免验证设置+节点共享目录(NFS服务)设置+NIS服务设置+用户硬盘空间限制和核心使用限制设置)异常详细版