空的ElasticSearch集群无法启动并出现错误:“无法将分片分配给已经存在该分片副本的同一节点”

时间:2018-07-24 09:43:37

标签: elasticsearch

使用这些环境变量从Docker启动ElasticSearch时,出现一条错误消息。集群运行状况为黄色,并且有5个未分配的分片。

/usr/local/bin/generate-docker-upstart elasticsearch registry:80/elasticsearch:2.2.18
-e SERVICE_9300_ID=elasticsearch-{{Var:Hostname}}
-e ES_HEAP_SIZE=$(free -t -m | awk '/^Mem:/{ print int($2  * 0.6) "m"}')
-e TOTAL_NR_OF_SERVERS=3
-e cluster.name=docker-cluster
-p 9200:9200
-p 9300:9300
-v /dev/log:/dev/log
-v /var/lib/elasticsearch:/usr/share/elasticsearch/data
--name \$NAME \$IMAGE

当我手动运行docker run -ti Registry / Elasticsearch:latest时,群集运行状况将变为绿色。我是否对可能导致此问题的环境变量之一进行了错误配置?

{
  "index" : "logstash-2018.07.24",
  "shard" : 3,
  "primary" : false,
  "current_state" : "unassigned",
  "unassigned_info" : {
    "reason" : "INDEX_CREATED",
    "at" : "2018-07-24T09:32:03.763Z",
    "last_allocation_status" : "no_attempt"
  },
  "can_allocate" : "no",
  "allocate_explanation" : "cannot allocate because allocation is not permitted to any of the nodes",
  "node_allocation_decisions" : [
    {
      "node_id" : "aJ1rwVjOToaQ3vQe4mTAFQ",
      "node_name" : "aJ1rwVj",
      "transport_address" : "192.168.0.4:9300",
      "node_attributes" : {
        "ml.machine_memory" : "8371724288",
        "xpack.installed" : "true",
        "ml.max_open_jobs" : "20",
        "ml.enabled" : "true"
      },
      "node_decision" : "no",
      "weight_ranking" : 1,
      "deciders" : [
        {
          "decider" : "same_shard",
          "decision" : "NO",
          "explanation" : "the shard cannot be allocated to the same node on which a copy of the shard already exists [[logstash-2018.07.24][3], node[aJ1rwVjOToaQ3vQe4mTAFQ], [P], s[STARTED], a[id=zwJThOk7TRS5NpzNYfVnhw]]"
        }
      ]
    }
  ]
}

0 个答案:

没有答案