ES跨版本升级?——难道升级集群发生shard allocation是因为要分配replica节点???

本文涉及的产品
检索分析服务 Elasticsearch 版,2核4GB开发者规格 1个月
简介:

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:

  1. 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"
      }
    }
  2. Perform a synced flush

    Shard recovery will be much faster if you stop 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.

  3. 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].

  4. Upgrade any plugins

    Elasticsearch plugins must be upgraded when upgrading a node. Use the elasticsearch-plugin script to install the correct version of any plugins that you need.

  5. Start the cluster——先启动主节点,然后再是数据节点

    If you have dedicated master nodes — nodes with node.master set to true(the default) and node.data set 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/health and _cat/nodesAPIs can be used to monitor nodes joining the cluster:

    GET _cat/health
    
    GET _cat/nodes

    Use these APIs to check that all nodes have successfully joined the cluster.

  6. 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/health request will report a status of red, meaning that not all primary shards have been allocated.

    Once each node has recovered its local shards, the status will 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.

  7. 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"
      }
    }

    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/health and _cat/recovery APIs:

    GET _cat/health
    
    GET _cat/recovery

    Once the status column in the _cat/health output has reached green, all primary and replica shards have been successfully allocated.





















本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/bonelee/p/7444080.html ,如需转载请自行联系原作者


相关实践学习
使用阿里云Elasticsearch体验信息检索加速
通过创建登录阿里云Elasticsearch集群,使用DataWorks将MySQL数据同步至Elasticsearch,体验多条件检索效果,简单展示数据同步和信息检索加速的过程和操作。
ElasticSearch 入门精讲
ElasticSearch是一个开源的、基于Lucene的、分布式、高扩展、高实时的搜索与数据分析引擎。根据DB-Engines的排名显示,Elasticsearch是最受欢迎的企业搜索引擎,其次是Apache Solr(也是基于Lucene)。 ElasticSearch的实现原理主要分为以下几个步骤: 用户将数据提交到Elastic Search 数据库中 通过分词控制器去将对应的语句分词,将其权重和分词结果一并存入数据 当用户搜索数据时候,再根据权重将结果排名、打分 将返回结果呈现给用户 Elasticsearch可以用于搜索各种文档。它提供可扩展的搜索,具有接近实时的搜索,并支持多租户。
相关文章
|
API 索引
es实战-分片分配失败解决方案
分片无法分配情况的一些解决办法
1826 0
|
4月前
|
Kubernetes Cloud Native 虚拟化
云原生|kubernetes|找回丢失的etcd集群节点---etcd节点重新添加,扩容和重新初始化k8s的master节点
云原生|kubernetes|找回丢失的etcd集群节点---etcd节点重新添加,扩容和重新初始化k8s的master节点
87 0
|
6月前
|
NoSQL Redis 容器
Redis集群报错cluster_state:fail,如何解决并重新恢复集群(IP问题/ slot未完全分配问题)
Redis集群报错cluster_state:fail,如何解决并重新恢复集群(IP问题/ slot未完全分配问题)
102 0
|
6月前
|
NoSQL Redis 容器
Redis集群更换节点IP后如何恢复集群并保留完整集群数据
Redis集群更换节点IP后如何恢复集群并保留完整集群数据
114 0
|
11月前
|
存储 关系型数据库 Java
【Postgres扩展】pg_auto_failover支持高可用性和自动故障转移
【Postgres扩展】pg_auto_failover支持高可用性和自动故障转移
|
12月前
|
存储 NoSQL Redis
集群类型之无状态节点集群
集群类型之无状态节点集群
200 0
|
Kubernetes 调度 Docker
k8s-1.7版本以上-节点资源限制
k8s-1.7版本以上-节点资源限制
325 0
k8s-1.7版本以上-节点资源限制