我有一个带有logstash和kibana的两节点elasticsearch集群。群集处于绿色状态,直到我启动了logstash,弹性搜索群集变为黄色状态。
正在运行curl -XGET http://localhost:9200/_cat/shards?pretty
将显示以下内容
.kibana 0 p STARTED 2 8.2kb 172.17.0.1 Ereshkigal
.kibana 0 r UNASSIGNED
logstash-2015.10.18 4 r STARTED 69 101.9kb 172.17.0.1 Ereshkigal
logstash-2015.10.18 4 p STARTED 69 101.7kb 172.17.0.2 Hargen the Measurer
logstash-2015.10.18 0 r STARTED 62 65.7kb 172.17.0.1 Ereshkigal
logstash-2015.10.18 0 p STARTED 62 89.4kb 172.17.0.2 Hargen the Measurer
logstash-2015.10.18 3 p STARTED 76 48.1kb 172.17.0.1 Ereshkigal
logstash-2015.10.18 3 r UNASSIGNED
logstash-2015.10.18 1 p STARTED 74 78.8kb 172.17.0.1 Ereshkigal
logstash-2015.10.18 1 r UNASSIGNED
logstash-2015.10.18 2 r STARTED 79 56.8kb 172.17.0.1 Ereshkigal
logstash-2015.10.18 2 p STARTED 79 65.1kb 172.17.0.2 Hargen the Measurer
logstash-2015.10.19 4 p STARTED 7 43.4kb 172.17.0.1 Ereshkigal
logstash-2015.10.19 4 r UNASSIGNED
logstash-2015.10.19 0 r STARTED 7 50.8kb 172.17.0.1 Ereshkigal
logstash-2015.10.19 0 p STARTED 7 58.3kb 172.17.0.2 Hargen the Measurer
logstash-2015.10.19 3 r STARTED 9 67.4kb 172.17.0.1 Ereshkigal
logstash-2015.10.19 3 p STARTED 9 67.3kb 172.17.0.2 Hargen the Measurer
logstash-2015.10.19 1 r STARTED 12 76.4kb 172.17.0.1 Ereshkigal
logstash-2015.10.19 1 p STARTED 12 13.8kb 172.17.0.2 Hargen the Measurer
logstash-2015.10.19 2 p STARTED 13 78kb 172.17.0.1 Ereshkigal
logstash-2015.10.19 2 r UNASSIGNED
如何让群集恢复绿色状态?
答案 0 :(得分:0)
黄色表示您有未分配的分片,如输出所示。
确保您的分片分配已启用:
curl -XPUT localhost:9200/_cluster/settings -d '{
"transient" : {
"cluster.routing.allocation.enable" : "all"
}
}'
您还可以尝试将分片强制转换为节点:
https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html