elasticsearch log中显示 low disk watermark [15%],high disk watermark [10%]的缘由node
[2015-10-27 09:38:31,588][INFO ][node ] [Milan] version[1.4.4], pid[33932], build[c88f77f/2015-02-19T13:05:36Z] [2015-10-27 09:38:31,588][INFO ][node ] [Milan] initializing ... [2015-10-27 09:38:31,592][INFO ][plugins ] [Milan] loaded [], sites [] [2015-10-27 09:38:34,665][INFO ][node ] [Milan] initialized [2015-10-27 09:38:34,665][INFO ][node ] [Milan] starting ... [2015-10-27 09:38:34,849][INFO ][transport ] [Milan] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.81.1.108:9300]} [2015-10-27 09:38:35,022][INFO ][discovery ] [Milan] elasticsearch/DZqnmWIZRpapZY_TPkkMBw [2015-10-27 09:38:38,787][INFO ][cluster.service ] [Milan] new_master [Milan][DZqnmWIZRpapZY_TPkkMBw][THINKANDACT1301][inet[/10.81.1.108:9300]], reason: zen-disco-join (elected_as_master) [2015-10-27 09:38:38,908][INFO ][http ] [Milan] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.81.1.108:9200]} [2015-10-27 09:38:38,908][INFO ][node ] [Milan] started [2015-10-27 09:38:39,220][INFO ][gateway ] [Milan] recovered [4] indices into cluster_state [2015-10-27 09:39:08,801][INFO ][cluster.routing.allocation.decider] [Milan] low disk watermark [15%] exceeded on [DZqnmWIZRpapZY_TPkkMBw][Milan] free: 58.6gb[12.6%], replicas will not be assigned to this node [2015-10-27 09:39:38,798][INFO ][cluster.routing.allocation.decider] [Milan] low disk watermark [15%] exceeded on [DZqnmWIZRpapZY_TPkkMBw][Milan] free: 58.6gb[12.6%], replicas will not be assigned to this node [2015-10-27 09:40:08,801][INFO ][cluster.routing.allocation.decider] [Milan] low disk watermark [15%] exceeded on [DZqnmWIZRpapZY_TPkkMBw][Milan] free: 58.6gb[12.6%], replicas will not be assigned to this node
这是ES中的磁盘分配决策策略(disk allocation decider),在ES中的官方文档中描述以下:json
cluster.routing.allocation.disk.threshold_enabled: Defaults to true. Set to false to disable the disk allocation decider. cluster.routing.allocation.disk.watermark.low: Controls the low watermark for disk usage. It defaults to 85%, meaning ES will not allocate new shards to nodes once they have more than 85% disk used. It can also be set to an absolute byte value (like 500mb) to prevent ES from allocating shards if less than the configured amount of space is available. cluster.routing.allocation.disk.watermark.high: Controls the high watermark. It defaults to 90%, meaning ES will attempt to relocate shards to another node if the node disk usage rises above 90%. It can also be set to an absolute byte value (similar to the low watermark) to relocate shards once less than the configured amount of space is available on the node. cluster.info.update.interval How often Elasticsearch should check on disk usage for each node in the cluster. Defaults to 30s.
low disk watermark默认为85%,意味着该节点若是磁盘空间小于85%,那么该节点不会再分配新的分片,只会添加一些零散的文件;less
high disk watermark默认为90%,意味着该节点若是磁盘空间小于90%,那么ES会尝试从新分配分片,将该节点的分片移动到其余节点。elasticsearch
这两个参数均可以经过设置来改变,能够设置为百分比,也能够设置为绝对值:ide
PUT _cluster/settings { "transient": { "cluster.routing.allocation.disk.watermark.low": "80%", "cluster.routing.allocation.disk.watermark.high": "50gb", "cluster.info.update.interval": "1m" } }
另外,"cluster.info.update.interval"表示 ES多久检查一次磁盘空间占比,默认为30 ui