Last-modified: 2020-04-14 (火) 22:11:17
Moloch/キャプチャしなくなった(ディスクフル)

現象

molochでパケットがキャプチャ出来なくなりました。
 
Web画面は表示され、過去検索もでき、molochcaptureのステータスも正常でした。
molochのログを見ると、elasticsearchがread onlyになっているようです。
elasticsearchのログを見ると、空きディスク容量が閾値(5%)を下回り、read only modeになったようです。

Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
  6
  7
  8
  9
-
|
!
 
 
 
-
|
!
# molochログ
# /data/moloch/logs/capture.log
http.c:390 moloch_http_curlm_check_multi_info(): 1/3 ASYNC 403 http://localhost:9200/dstats/dstat/・・・ 813/164 0ms 50ms
http.c:411 moloch_http_curlm_check_multi_info(): Response length=259 :>
{"error":{"root_cause":[{"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"}],"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"},"status":403}
 
# elasticsearchログ
# /var/log/elasticsearch/moloch.log
[WARN ][o.e.c.r.a.DiskThresholdMonitor] [・・・] flood stage disk watermark [95%] exceeded on [・・・][・・・][/mnt/usb/elasticsearch/nodes/0] free: 90.5gb[4.9%], all indices on this node will be marked read-only

原因

対策

方法

  1. vi /data/moloch/etc/config.ini
    Everything is expanded.Everything is shortened.
      1
    
     
    
    freeSpaceG = 10%
  2. 再起動
    Everything is expanded.Everything is shortened.
      1
      2
    
     
     
    
    systemctl restart molochcapture
    systemctl restart molochviewer
  3. elasticsearchのread only modeを解除
    Everything is expanded.Everything is shortened.
      1
    
     
    
    curl -X PUT "localhost:9200/_settings" -H 'Content-Type: application/json' -d'{"index.blocks.read_only_allow_delete": null}'

検証時の環境

参考