簡體   English   中英

Graylog無法連接到Kubernetes集群中的Elasticsearch

[英]Graylog cannot connect to Elasticsearch in Kubernetes cluster

我在Kubernetes集群上部署了Graylog,並且一切正常,直到我決定添加環境變量並更新Graylog部署。

現在,有些事情停止了。 我可以看到所有輸入都在運行,並且它們正在接受消息:

在此處輸入圖片說明

但是,如果嘗試查看收到的消息,則會返回500錯誤並顯示以下消息:

一種

該文檔說,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 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日志說它正在嘗試連接到本地主機:

在此處輸入圖片說明

再次,直到今天一切都在工作。 為什么要嘗試連接到本地主機,而不是彈性搜索服務?

看來這是版本問題。 我將Graylog容器降級到以前的穩定版本:2.2.3-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中,然后使用它進行構建。

實際上,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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM