elastic search 把状态由yellow改为green 的一次记录

问题

  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
}
}'

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容