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