美文网首页
elastic search 把状态由yellow改为green

elastic search 把状态由yellow改为green

作者: 我的小鱼干去哪儿了 | 来源:发表于2017-10-28 12:31 被阅读0次

问题

  1. 使用logstash 同步mysql 到 es后,发现 同步新建的index 状态为yellow

  2. 查询分片状态,发现所有副本分区都是UNASSIGNED状态
    curl -XGET http://localhost:9200/_cat/shards | grep UNASSIGNED

or 使用elastic-head 查看集群状态可以看到

  1. 查看日志:
    [2017-10-28 12:21:06,828][INFO ][cluster.routing.allocation.decider] [node-1] low disk watermark [85%] exceeded on [Uoy7PyXERAGZXOTjNEDGwg][node-1][/Users/baidu/IdeaProjects/git/elasticsearch2-node1/data/my-application/nodes/0] free: 12.4gb[11.1%], replicas will not be assigned to this node

  2. 从日志可以看出是磁盘空间不够导致的, 调整磁盘最低限制解决
    curl -XPUT localhost:9200/_cluster/settings -d '
    {
    "transient" : {
    "cluster.routing.allocation.disk.threshold_enabled" : true
    }
    }'

curl -XPUT localhost:9200/_cluster/settings -d '
{
"transient" : {
"cluster.routing.allocation.disk.watermark.low" : 0.95
}
}'

相关文章

网友评论

      本文标题:elastic search 把状态由yellow改为green

      本文链接:https://www.haomeiwen.com/subject/bczjpxtx.html