現象 †
molochでパケットがキャプチャ出来なくなりました。
Web画面は表示され、過去検索もでき、molochcaptureのステータスも正常でした。
molochのログを見ると、elasticsearchがread onlyになっているようです。
elasticsearchのログを見ると、空きディスク容量が閾値(5%)を下回り、read only modeになったようです。
1
2
3
4
5
6
7
8
9
| -
|
!
-
|
!
| 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}
[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
|
原因 †
- elasticsearchデータの保存先ディスク空き容量が5%を下回り、read only modeに移行したため。
対策 †
- moloch(pcap)側の空きディスク容量閾値も5%のため、こちらを上げる。
- elasticsearchのread only modeを解除する。
※moloch, elasticsearch同居パターンでも、それぞれ論理ディスクを分けることが本来望ましい
方法 †
- vi /data/moloch/etc/config.ini
- 再起動
1
2
|
| systemctl restart molochcapture
systemctl restart molochviewer
|
- elasticsearchのread only modeを解除
1
|
| curl -X PUT "localhost:9200/_settings" -H 'Content-Type: application/json' -d'{"index.blocks.read_only_allow_delete": null}'
|
検証時の環境 †
- GS105E-200JPS
- LIVA Z-4
- Ubuntu 18.04 LTS
- moloch 2.2.1-1
- elasticsearh 6.8.6
- openjdk-8-jdk 8u222-b10-1ubuntu1~18.04.1
参考 †