Elasticsearch集群运行状况:黄色(262个中的131个)未分配的分片

Dre*_*rew 2 elasticsearch kibana kibana-4

我是Elasticsearch的新手,并尝试用它来分析Suricata IPS的数据.头插件告诉我这个:yellow (131 of 262) unassigned shards 也得到这个:

$ curl -XGET http://127.0.0.1:9200/_cluster/health?pretty
{
  "cluster_name" : "elasticsearch_brew",
  "status" : "yellow",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 131,
  "active_shards" : 131,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 131,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0
}
Run Code Online (Sandbox Code Playgroud)

如何摆脱那些未分配的碎片?还有Kibana不时地告诉我这个:

Error: Bad Gateway
    at respond (https://www.server.kibana/index.js?_b=:85279:15)
    at checkRespForFailure (https://www.server.kibana/index.js?_b=:85247:7)
    at https://www.server.kibana/index.js?_b=:83885:7
    at wrappedErrback (https://www.server.kibana/index.js?_b=:20902:78)
    at wrappedErrback (https://www.server.kibana/index.js?_b=:20902:78)
    at wrappedErrback (https://www.server.kibana/index.js?_b=:20902:78)
    at https://www.server.kibana/index.js?_b=:21035:76
    at Scope.$eval (https://www.server.kibana/index.js?_b=:22022:28)
    at Scope.$digest (https://www.server.kibana/index.js?_b=:21834:31)
    at Scope.$apply (https://www.server.kibana/index.js?_b=:22126:24)
Run Code Online (Sandbox Code Playgroud)

我不知道这些问题是否相互关联......请任何人帮助我让它工作.非常感谢你!

And*_*fan 8

只有一个节点和具有一个副本的索引的集群将始终yellow.

yellow这不是一件坏事,集群工作得很好.缺点是它没有活动的分片副本.

green如果将副本数设置为0,或者将第二个节点添加到群集,则可以拥有群集.

但是,正如我所说,如果你有一个yellow集群,没有问题.

将副本数设置为0,群集范围(所有索引):

curl -XPUT "http://localhost:9200/_settings" -d'
{
  "number_of_replicas" : 0
}'
Run Code Online (Sandbox Code Playgroud)