cluster-notices

  1. 节点闪退
  2. 主分片不分配

节点闪退

调整分片自动分配及关闭负载均衡,详情如下

PUT _cluster/settings
{
  "persistent": {
   "cluster": {
      "routing": {
        "rebalance": {
          "enable": "none"
        },
        "allocation": {
          "node_concurrent_recoveries": "1",//默认是2,1个节点只允许一个出(恢复在其他节点)一个进
          "enable": "new_primaries"  //kibana每天都会生成新的索引
        }
      }
    }
  }
}
//恢复副本
PUT _cluster/settings
{
  "persistent": {
   "cluster": {
      "routing": {
        "allocation": {
          "enable": null
        }
      }
    }
  }
}
//在分片开始恢复时关掉---即监控的Overview界面出现副本恢复的进度时
PUT _cluster/settings
{
  "persistent": {
   "cluster": {
      "routing": {
        "allocation": {
          "enable": "new_primaries"  //kibana每天都会生成新的索引
        }
      }
    }
  }
}

主分片不分配

需要找到主分片在未脱离集群时所在节点后执行以下命令
详情参见这里

POST _cluster/reroute
{
    "commands": [
        {
            "allocate_stale_primary": {
                "index": "s2-********201908", 
                "shard": 0, 
                "node": "es3", 
                "accept_data_loss": true
            }
        }
    ]
}

转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 fulndon@qq.com

💰

×

Help us with donation