【发布时间】:2016-11-25 12:57:11
【问题描述】:
我正在解析来自 Logstash 的 Apache 访问日志并将其索引到 Elasticsearch 索引中。我还索引了geoip 和agent 字段。索引时我观察到elasticsearch 索引大小6.7x 大于实际文件大小(磁盘空间)。所以我只想了解这是正确的行为还是我在这里做错了什么?我正在使用Elasticsearch 5.0、Logstash 5.0 和Kibana 5.0 版本。我也试过best_compression,但它占用了相同的磁盘大小。这是迄今为止我尝试过的配置文件的完整观察。
我的观察:
用例 1:
Apache Log file Size:211 MBTotal number of lines:1,000,000Index Size:1.5 GBObservation:索引为6.7x,大于文件大小。
用例 2:
我找到了一些压缩elasticsearch索引的解决方案,然后我也尝试了。
- Disable `_all` fields
- Remove unwanted fields that has been created by `geoip` and `agent` parsing.
- Enable `best_compression` [ index.codec": "best_compression"]
Apache Log file Size: 211 MBTotal number of lines: 1,000,000Index Size: 1.3 GBObservation: 索引是6.16x 大于文件大小
日志文件格式:
127.0.0.1 - - [24/Nov/2016:02:03:08 -0800] "GET /wp-admin HTTP/1.0" 200 4916 "http://trujillo-carpenter.com/" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 5.01; Trident/5.1)"
我发现 Logstash + Elasticsearch Storage Experients 他们说他们已将索引大小从 6.23x 减小到 1.57x。但这是相当老的解决方案,这些解决方案在 Elasticsearch 5.0 中不再有效。
我已经尝试过的更多参考:
- Part 2.0: The true story behind Elasticsearch storage requirements
- https://github.com/elastic/elk-index-size-tests
当您的目的只是在 Kibana 上显示可视化时,有没有更好的方法来优化 Elasticseach 索引大小?
【问题讨论】:
标签: elasticsearch logstash kibana