集群报红问题

来源:21-1 -项目介绍

qq_无妄_3

2018-06-27

集群第一天所有操作没事;第二天创建新的索引报红;重启后问题解决;但是第三天创建新的索引又会报红http://img.mukewang.com/szimg/5b32f6e10001faec15960907.jpg

写回答

6回答

rockybean

2018-06-27

这个问题是 shard allocation 失败的问题,那么可以使用以下接口看下失败的原因(注意是在出问题的时候看)

GET _cluster/allocation/explain


https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html


另外再关注下 es 日志里面有无有价值的信息

1
3
qq_无妄_3
回复
rockybean
定位到了呢;老师
2018-06-28
共3条回复

qq_无妄_3

提问者

2018-06-28

回复 rockybean:定位到了那个命令出来后是这个样子
GET _cluster/allocation/explain

{
  "index": "apachelog-2015.05.17",
  "shard": 2,
  "primary": true,
  "current_state": "unassigned",
  "unassigned_info": {
    "reason": "INDEX_CREATED",
    "at": "2018-06-28T02:51:05.736Z",
    "last_allocation_status": "no"
  },
  "can_allocate": "no",
  "allocate_explanation": "cannot allocate because allocation is not permitted to any of the nodes",
  "node_allocation_decisions": [
    {
      "node_id": "zMOX1zjIRqe-AxSbvWxf2A",
      "node_name": "ctgegh03",
      "transport_address": "134.96.252.88:9300",
      "node_decision": "no",
      "weight_ranking": 1,
      "deciders": [
        {
          "decider": "enable",
          "decision": "NO",
          "explanation": "no allocations are allowed due to cluster setting [cluster.routing.allocation.enable=none]"
        }
      ]
    },
    {
      "node_id": "oaperWCYRY2djW_9lYIkFA",
      "node_name": "ctgexh01",
      "transport_address": "134.96.252.90:9300",
      "node_decision": "no",
      "weight_ranking": 2,
      "deciders": [
        {
          "decider": "enable",
          "decision": "NO",
          "explanation": "no allocations are allowed due to cluster setting [cluster.routing.allocation.enable=none]"
        }
      ]
    },
    {
      "node_id": "NDwlNyXlSLO3GI25_iQx6A",
      "node_name": "ctgegh04",
      "transport_address": "134.96.252.89:9300",
      "node_decision": "no",
      "weight_ranking": 3,
      "deciders": [
        {
          "decider": "enable",
          "decision": "NO",
          "explanation": "no allocations are allowed due to cluster setting [cluster.routing.allocation.enable=none]"
        }
      ]
    }
  ]
}
日志是
[2018-06-28T10:52:42,362][DEBUG][o.e.a.a.c.a.TransportClusterAllocationExplainAction] [ctgegh04] explaining the allocation for [ClusterAllocationExplainRequest[useAnyUnassignedShard=true,includeYesDecisions?=false], found shard [[apachelog-2015.05.17][2], node[null], [P], recovery_source[new shard recovery], s[UNASSIGNED], unassigned_info[[reason=INDEX_CREATED], at[2018-06-28T02:51:05.736Z], delayed=false, allocation_status[deciders_no]]]

我开启cluster.routing.allocation.enable=none 为all就恢复了正常

0
1
rockybean
好的,这个 api 很强大,活学活用
2018-06-28
共1条回复

qq_无妄_3

提问者

2018-06-27

cluster settings

//img.mukewang.com/szimg/5b332abb0001b3cb19201080.jpg


0
0

qq_无妄_3

提问者

2018-06-27

GET _cluster/settings

{
  "persistent": {},
  "transient": {}
}

0
0

rockybean

2018-06-27

你的集群配置发一下

GET _cluster/settings


0
1
qq_无妄_3
老师;您看;啥都没啊 GET _cluster/settings { "persistent": {}, "transient": {} }
2018-06-27
共1条回复

qq_无妄_3

提问者

2018-06-27

版本为6.1.3

0
0

Elastic Stack从入门到实践,动手搭建数据分析系统

有了Elastic Stack,不用写一行代码,你也可以玩转大数据分析!

1361 学习 · 397 问题

查看课程