首页 > 解决方案 > 在 GKE 上部署 Graylog

问题描述

我很难在 Google Kubernetes Engine 上部署 Graylog,我正在使用此配置https://github.com/aliasmee/kubernetes-graylog-cluster并进行了一些小的修改。我的 Graylog 服务器已启动,但在界面中显示此错误:

Error message
    Request has been terminated
    Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.
Original Request
    GET http://ES_IP:12900/system/sessions
Status code
    undefined
Full error message
    Error: Request has been terminated
    Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.

Graylog 日志除此之外没有任何特别的显示:

org.graylog.plugins.threatintel.tools.AdapterDisabledException: Spamhaus service is disabled, not starting (E)DROP adapter. To enable it please go to System / Configurations.
    at org.graylog.plugins.threatintel.adapters.spamhaus.SpamhausEDROPDataAdapter.doStart(SpamhausEDROPDataAdapter.java:68) ~[?:?]
    at org.graylog2.plugin.lookup.LookupDataAdapter.startUp(LookupDataAdapter.java:59) [graylog.jar:?]
    at com.google.common.util.concurrent.AbstractIdleService$DelegateService$1.run(AbstractIdleService.java:62) [graylog.jar:?]
    at com.google.common.util.concurrent.Callables$4.run(Callables.java:119) [graylog.jar:?]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]

但最后:

2019-01-16 13:35:00,255 INFO : org.graylog2.bootstrap.ServerBootstrap - Graylog server up and running.

弹性搜索健康检查是绿色的,在 ES 和 Mongo 日志中没有问题。我怀疑与 Elastic Search 的连接存在问题。

curl http://ip_address:9200/_cluster/health\?pretty
{
  "cluster_name" : "elasticsearch",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 4,
  "active_shards" : 4,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0
}

标签: kubernetesgoogle-kubernetes-enginegraylog2graylog

解决方案


阅读您分享的教程后,我能够确定 kubelet 需要使用参数 --allow-privileged 运行。

“Elasticsearch pod 需要一个 init-container 以特权模式运行,因此它可以设置一些 VM 选项。为此,kubelet 应该使用 args --allow-privileged 运行,否则 init-container 将无法运行。”

无法自定义或修改 kubelet 参数/参数,这里有一个功能请求:https ://issuetracker.google.com/118428580 ,因此可以在将来实现。

此外,如果您直接在节点上修改 kubelet,主节点可能会重置配置,并且不能保证配置将保持不变。


推荐阅读