【问题标题】:Deploy ELK on single node docker swarm failed在单节点 docker swarm 上部署 ELK 失败
【发布时间】:2019-07-09 15:40:41
【问题描述】:

我正在尝试在我的小型服务器 2 Core / 2G RAM 上部署 ELK。但是ELK堆栈服务器只是不断重启并且无法工作。

打印在这些容器上的日志没有显示任何错误,只是关于不推荐使用的方法的几个警告。

Logstash log:
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.headius.backport9.modules.Modules (file:/usr/share/logstash/logstash-core/lib/jars/jruby-complete-9.2.7.0.jar) to field java.io.FileDescriptor.fd
WARNING: Please consider reporting this to the maintainers of com.headius.backport9.modules.Modules
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

在 Kibana 和 elasticsearch 容器中没有错误打印

这里是 docker stack composer 文件:https://github.com/deviantony/docker-elk/blob/master/docker-stack.yml。除了减小堆大小之外,我没有更改任何内容。

但如果我在 swarm 模式下使用 docker-compose 而不是 docker stack deploy,一切都会顺利进行。

此外,当我启动服务时,我的 CPU 会跃升至 100%,而内存使用率只有 60%。

我该如何调试这个问题?提前致谢。

【问题讨论】:

    标签: elasticsearch kibana docker-swarm docker-stack elk


    【解决方案1】:

    我认为您的问题仍然是由于内存不足引起的。我将测试您在上面显示的撰写堆栈。检查docker stats。内存使用在1.8G上下波动。

    您提到您将compose file: 中的堆大小从ES_JAVA_OPTS: "-Xmx512m -Xms512m" 调低。 但仍然不建议将堆大小减少到256m 以下。低于此值将导致一些错误,例如:

    [circuit_breaking_exception] [parent] Data too large, data for [<http_request>] would be xxx, which is larger than the limit of xxx
    

    任何更复杂的查询或其他操作都会引发更多错误。

    此外,请注意您只有一个主机,但您仍然使用 swarm 作为主节点和工作节点。任何其他冗余服务或应用程序都会将您的主机推到崩溃的边缘。 对于大多数常见用途,2G RAM 服务器不足以托管整个 ELK 堆栈。如果您坚持,请尝试在您的撰写文件中添加mem_limit(您实际上不需要使用v3,v2对于单节点服务就足够了)以限制您的容器内存使用量。

    【讨论】:

      猜你喜欢
      • 2019-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多