mac本地啓動es以後發現運行一段時間一分鐘就能打印好幾條info日誌:html
[2018-03-13T10:15:42,497][INFO ][o.e.c.r.a.DiskThresholdMonitor] [Sonofelice] low disk watermark [85%] exceeded on [UTyrLH40Q9uIzHzX-yMFXg][Sonofelice][/Users/baidu/Documents/work/soft/data/nodes/0] free: 15.2gb[13.4%], replicas will not be assigned to this node [2018-03-13T10:16:12,505][INFO ][o.e.c.r.a.DiskThresholdMonitor] [Sonofelice] low disk watermark [85%] exceeded on [UTyrLH40Q9uIzHzX-yMFXg][Sonofelice][/Users/baidu/Documents/work/soft/data/nodes/0] free: 15.2gb[13.4%], replicas will not be assigned to this node
看日誌的意思就是,節點sonofelice上的磁盤空間使用率超過了85%,空閒15.2gb,佔總磁盤空間的13.4%。將不會在該節點上分配副本了。node
雖然不影響es的正常功能使用,可是打印一堆日誌夠煩的,看一下是什麼緣由呢,能不能關掉。elasticsearch
第一種方式,是簡單粗暴的在elasticsearch.yml文件中直接加入下面一行命令:ide
cluster.routing.allocation.disk.threshold_enabled: false
第二種方式,則是本身控制磁盤空間使用率超過多少的時候再也不分配副本。默認是85%,因此纔會有上面的日誌ui
cluster.routing.allocation.disk.threshold_enabled: true cluster.routing.allocation.disk.watermark.low: 30gb cluster.routing.allocation.disk.watermark.high: 20gb
能夠參考官網文檔:https://www.elastic.co/guide/en/elasticsearch/reference/current/disk-allocator.htmlthis