首页 文章

Graylog无法连接到Kubernetes集群中的Elasticsearch

提问于
浏览
0

我在Kubernetes集群上部署了Graylog,一切正常,直到我决定添加一个环境变量并更新graylog部署 .

现在,有些东西停止了工作 . 我可以看到所有输入都在运行,他们正在接受消息:

enter image description here

但是,如果我尝试查看收到的消息,则会返回500错误,并显示以下消息:

a

The docs说Graylog容器需要一个名为 elasticsearch 的服务

docker run --link some-mongo:mongo --link some-elasticsearch:elasticsearch -p 9000:9000 -e GRAYLOG_WEB_ENDPOINT_URI="http://127.0.0.1:9000/api" -d graylog2/server

如果我附加到graylog pod并卷曲 elasticsearch:9200 ,我看到一个成功的结果:

{
  "name" : "Vixen",
  "cluster_name" : "graylog",
  "cluster_uuid" : "TkZtckzGTnSu3JjERQNf4g",
  "version" : {
    "number" : "2.4.4",
    "build_hash" : "fcbb46dfd45562a9cf00c604b30849a6dec6b017",
    "build_timestamp" : "2017-01-03T11:33:16Z",
    "build_snapshot" : false,
    "lucene_version" : "5.5.2"
  },
  "tagline" : "You Know, for Search"
}

但是如果graylog日志说它正在尝试连接到localhost:

enter image description here

再一次,一切都在努力到今天 . 为什么它试图连接到localhost,而不是弹性搜索服务?

3 回答

  • 0

    看起来这是一个版本问题 . 我将graylog容器降级到之前的稳定版本:2.2.3-1,它又开始工作了 .

    我的猜测是,当我今天更新图像时,它会删除最新版本,这会破坏某些内容

  • 1

    您可能想尝试将elastichost添加到graylog.conf

    https://github.com/Graylog2/graylog2-server/blob/master/misc/graylog.conf

    在第172行

    # List of Elasticsearch hosts Graylog should connect to.
    # Need to be specified as a comma-separated list of valid URIs for the http ports of your elasticsearch nodes.
    # If one or more of your elasticsearch hosts require authentication, include the    credentials in each node URI that
    # requires authentication.
    #
    # Default: http://127.0.0.1:9200
    #elasticsearch_hosts = http://node1:9200,http://user:password@node2:19200
    

    您可以创建自己的graylog.conf并将其添加到dockerfile,然后使用它进行构建 .

  • 0

    实际上,Graylog已经转移到了Graylog 2.3中的HTTP API . 因此,连接到Elasticsearch集群的方法已更改 . 您现在可以只提供ES节点的IP地址而不是zen_ping_unicast_hosts . 这是改变此设置的提交 - https://github.com/Graylog2/graylog2-server/commit/4213a2257429b6a0803ab1b52c39a6a35fbde889 .

    这也使我们能够连接AWS ES服务,这是以前无法实现的 . 请参阅此讨论主题以获得更多见解 - https://github.com/Graylog2/graylog2-server/issues/1473

相关问题