zoukankan      html  css  js  c++  java
  • 索引yellow 分片 UNASSIGNED 解决方案1

    • 环境 ElasticSearch5.x

    产生unassigned shards的原因

    只有一台机器,跑了es,但是你却在index中的settings中设置了replica为1,显然这个replica shard就会成为unassigned shards
    而且你在查看原因的时候,其会显示
    the shard cannot be allocated to the same node on which a copy of the shard already exists
    即分片不能分配到已经存在分片副本的同一节点

    如何解决

    1. GET /_cat/shards/dbaudit-2020.08.19?v&format=json&pretty
    [
      {
        "index": "dbaudit-2020.08.19",
        "shard": "1",
        "prirep": "p",
        "state": "STARTED",
        "docs": "690",
        "store": "170.8kb",
        "ip": "10.47.211.100",
        "node": "node-1"
      },
      {
        "index": "dbaudit-2020.08.19",
        "shard": "1",
        "prirep": "r",
        "state": "UNASSIGNED",
        "docs": null,
        "store": null,
        "ip": null,
        "node": null
      },
      {
        "index": "dbaudit-2020.08.19",
        "shard": "2",
        "prirep": "p",
        "state": "STARTED",
        "docs": "729",
        "store": "169.7kb",
        "ip": "10.47.211.100",
        "node": "node-1"
      },
      {
        "index": "dbaudit-2020.08.19",
        "shard": "2",
        "prirep": "r",
        "state": "UNASSIGNED",
        "docs": null,
        "store": null,
        "ip": null,
        "node": null
      },
      {
        "index": "dbaudit-2020.08.19",
        "shard": "0",
        "prirep": "p",
        "state": "STARTED",
        "docs": "668",
        "store": "160.5kb",
        "ip": "10.47.211.100",
        "node": "node-1"
      },
      {
        "index": "dbaudit-2020.08.19",
        "shard": "0",
        "prirep": "r",
        "state": "UNASSIGNED",
        "docs": null,
        "store": null,
        "ip": null,
        "node": null
      }
    ]
    
    1. 把副本分片设置为0
    PUT /dbaudit-2020.07.19/_settings
    {
      "number_of_replicas": 0
    }
    

    参考

    如何处理elastic search中的unassigned shards?
    How to resolve unassigned shards in Elasticsearch

  • 相关阅读:
    Hive UDF 用户自定义函数 编程及使用
    Hive 常用命令和语句
    Hive 配置显示表头和数据库信息
    Hive 安装配置
    Hadoop完全分布式集群环境搭建
    Java 文件切割工具类
    MongoDB 安装配置
    NodeJS 安装配置
    Java 截屏工具类
    Maven 配置本地依赖jar
  • 原文地址:https://www.cnblogs.com/zendwang/p/how_to_resolve_unassigned_shards_in_es.html
Copyright © 2011-2022 走看看