请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

集群报红问题

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

正在回答

6回答

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

GET _cluster/allocation/explain


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


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

1 回复 有任何疑惑可以回复我~
  • 提问者 qq_无妄_3 #1
    非常感谢老师!
    回复 有任何疑惑可以回复我~ 2018-06-28 08:48:40
  • rockybean 回复 提问者 qq_无妄_3 #2
    问题定位到了吗?
    回复 有任何疑惑可以回复我~ 2018-06-28 09:29:26
  • 提问者 qq_无妄_3 回复 rockybean #3
    定位到了呢;老师
    回复 有任何疑惑可以回复我~ 2018-06-28 11:01:35
提问者 qq_无妄_3 2018-06-28 11:01:50

回复 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 回复 有任何疑惑可以回复我~
  • 好的,这个 api 很强大,活学活用
    回复 有任何疑惑可以回复我~ 2018-06-28 11:12:07
提问者 qq_无妄_3 2018-06-27 14:13:02

cluster settings

https://img1.sycdn.imooc.com//szimg/5b332abb0001b3cb19201080.jpg


0 回复 有任何疑惑可以回复我~
提问者 qq_无妄_3 2018-06-27 14:07:28

GET _cluster/settings

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

0 回复 有任何疑惑可以回复我~
rockybean 2018-06-27 11:13:26

你的集群配置发一下

GET _cluster/settings


0 回复 有任何疑惑可以回复我~
  • 提问者 qq_无妄_3 #1
    老师;您看;啥都没啊
    GET _cluster/settings
    
    {
      "persistent": {},
      "transient": {}
    }
    回复 有任何疑惑可以回复我~ 2018-06-27 14:11:55
提问者 qq_无妄_3 2018-06-27 10:33:26

版本为6.1.3

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信