elasticsearch - 添加更多节点(或节点丢失)后未分配主分片
问题描述
一些索引主分片处于未分配状态,它显示一个红色指示器。如果我运行GET _cluster/allocation/explain
,它将提供如下详细信息:
"unassigned_info": {
"reason": "ALLOCATION_FAILED",
"at": "2018-06-19T00:29:17.781Z",
"failed_attempts": 5,
"delayed": false,
"details": "failed to create shard, failure IOException[failed to obtain in-memory shard lock]; nested: ShardLockObtainFailedException[[log_2018_05][10]: obtaining shard lock timed out after 5000ms]; ",
"allocation_status": "deciders_no"
}
这在我们的生产环境中发生了两次。曾经是多个数据节点在一次网络断开时丢失。另一次是我们在环境中添加了另外 2 个数据节点。
这应该如何处理?
解决方案
原因是主分片处于未分配状态。
Elastic 的支持建议使用以下 API 调用,它将重试之前失败的分片分配:
POST _cluster/reroute?retry_failed
这应该会使未分配的主分片重新路由到可用节点,并且集群应该从红色状态变为黄色状态(这意味着所有主分片都正常,副本未准备好)
推荐阅读
- ruby-on-rails - 显示选择收集哈希 ActiveRecord - Ruby on Rails
- python - 如何访问 Pandas DataFrame 中的标称值和不确定性?
- reactjs - 页面中没有加载css background-images,反应
- swift - 实现 UIPageViewController 的问题
- templates - Terraform k8sraw 提供程序错误:产生了一个意外的新值,但在创建模板时现在不存在
- validation - 如何验证相互依赖的文本框并在动态(使用 JS)添加的输入文本框下显示错误消息?
- r - 基于R中不同数据框中的另一列选择列
- python - 使用具有每日平均值的特定字符串列创建新数据集
- kubernetes - 在 Kubernetes 节点中“共享”静态 IP
- php - 如何在PHP中链接文件夹中的图像