【发布时间】:2018-05-17 15:10:45
【问题描述】:
我正在运行一个带有 ElasticSearch、Logstash、Filebeat 和 Kibana 的 docker 设置,灵感来自 Elastic Docker Compose。我需要将 15 GB og 日志文件初始加载到系统中(Filebeat->Logstash->ElasticSearch),但我遇到了一些性能问题。
似乎 Filebeat/Logstash 为 ElasticSearch 输出了太多工作。一段时间后,我开始在 ElasticSearch 中看到一堆这样的错误:
[INFO ][o.e.i.IndexingMemoryController] [f8kc50d] 现在限制分片 [log-2017.06.30] 的索引:段写入跟不上
我找到了这篇关于如何禁用 合并限制 的旧文档文章:https://www.elastic.co/guide/en/elasticsearch/guide/master/indexing-performance.html#segments-and-merging。
PUT /_cluster/settings
{
"transient" : {
"indices.store.throttle.type" : "none"
}
}
但在当前版本(ElasticSearch 6)中,它给了我这个错误:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "transient setting [indices.store.throttle.type], not dynamically updateable"
}
],
"type": "illegal_argument_exception",
"reason": "transient setting [indices.store.throttle.type], not dynamically updateable"
},
"status": 400
}
我该如何解决上述问题?
VM 有 4 个 CPU 内核(Intel Xeon E5-2650),ElasticSearch 分配有 4GB RAM,Logstash 和 Kibana 各有 1GB。使用“swapoff -a”禁用交换。 X-pack 和监控已启用。这个日志服务器我只有一个 ES 节点。这个初始批量导入是否需要多个节点?
EDIT1:
更改 number_of_replicas 和 refresh_interval 似乎使其性能更好。仍在测试中。
PUT /log-*/_settings
{
"index.number_of_replicas" : "0",
"index.refresh_interval" : "-1"
}
【问题讨论】:
-
您的集群统计数据是什么(节点数、分片数、副本数、硬件类型)。您是否有任何其他统计信息,例如 iostat、JVM 统计信息等。您是否更改了任何其他设置?
-
@Egor 感谢您的推荐。我已经用其他信息更新了这个问题。
-
您或许可以减少logstash 中的工作线程数量(启动时的-w 选项)。对于 elasticsearch,我记得你应该提供一半的可用 RAM,其余的留给文件系统(“将 Xmx 设置为不超过物理 RAM 的 50%”来自elastic.co/guide/en/elasticsearch/reference/master/…)。
标签: elasticsearch logstash filebeat