duankao4489
2018-02-22 14:13
浏览 166

metricbeat kubernetes DNS查找失败:没有这样的主机

I tried running the official metricbeat docker image as described here (https://www.elastic.co/guide/en/beats/metricbeat/current/running-on-kubernetes.html) on a GCP kubernetes cluster as a deamonset and changed the settings so it should route traffic to the existing elastic search pod, but I keep getting the error:

2018-02-22T14:04:54.515Z    WARN    transport/tcp.go:36 DNS lookup failure "elasticsearch-logging.kube-system.svc.cluster.local": lookup elasticsearch-logging.kube-system.svc.cluster.local: no such host
2018-02-22T14:04:55.516Z    ERROR   pipeline/output.go:74   Failed to connect: Get http://elasticsearch-logging.kube-system.svc.cluster.local:9200: lookup elasticsearch-logging.kube-system.svc.cluster.local: no such host
2018-02-22T14:04:55.517Z    WARN    transport/tcp.go:36 DNS lookup failure "elasticsearch-logging.kube-system.svc.cluster.local": lookup elasticsearch-logging.kube-system.svc.cluster.local: no such host
2018-02-22T14:04:57.517Z    ERROR   pipeline/output.go:74   Failed to connect: Get http://elasticsearch-logging.kube-system.svc.cluster.local:9200: lookup elasticsearch-logging.kube-system.svc.cluster.local: no such host
2018-02-22T14:04:57.519Z    WARN    transport/tcp.go:36 DNS lookup failure "elasticsearch-logging.kube-system.svc.cluster.local": lookup elasticsearch-logging.kube-system.svc.cluster.local: no such host
2018-02-22T14:05:01.519Z    ERROR   pipeline/output.go:74   Failed to connect: Get http://elasticsearch-logging.kube-system.svc.cluster.local:9200: lookup elasticsearch-logging.kube-system.svc.cluster.local: no such host
2018-02-22T14:05:01.532Z    WARN    transport/tcp.go:36 DNS lookup failure "elasticsearch-logging.kube-system.svc.cluster.local": lookup elasticsearch-logging.kube-system.svc.cluster.local: no such host

The hostname is fine, because other pods are successfully pushing data to elastic. Now, after some research this turns out to be an issue of the Golang DNS resolver (not metricbeat itself). Anyone else running into this issue? Anyone a solution?

图片转代码服务由CSDN问答提供 功能建议

我尝试运行官方metricbeat docker镜像,如此处所述( https://www.elastic.co/guide/zh-CN/beats/metricbeat/current/running- GCP kubernetes集群上的on-kubernetes.html )作为守护进程并更改了设置,因此它应该将流量路由到现有的弹性搜索引擎,但我不断收到错误消息: < pre> 2018-02-22T14:04:54.515Z WARN transport / tcp.go:36 DNS查找失败“ elasticsearch-logging.kube-system.svc.cluster.local”:查找elasticsearch-logging.kube-system .svc.cluster.local:无此类主机 2018-02-22T14:04:55.516Z错误pipe / output.go:74无法连接:获取http://elasticsearch-logging.kube-system.svc.cluster。 本地:9200:查找elasticsearch-logging.kube-system.svc.cluster.local:没有此类主机 2018-02-22T14:04:55.517Z WARN Transport / tcp.go:36 DNS look 出现故障“ elasticsearch-logging.kube-system.svc.cluster.local”:查找elasticsearch-logging.kube-system.svc.cluster.local:无此类主机 2018-02-22T14:04:57.517Z错误管道/ output.go:74无法连接:获取http://elasticsearch-logging.kube-system.svc.cluster.local:9200:查找elasticsearch-logging.kube-system.svc.cluster.local:无此类主机 2018 -02-22T14:04:57.519Z WARN transport / tcp.go:36 DNS查找失败“ elasticsearch-logging.kube-system.svc.cluster.local”:查找elasticsearch-logging.kube-system.svc.cluster.local :没有这样的主机 2018-02-22T14:05:01.519Z错误pipeline / output.go:74无法连接:获取http://elasticsearch-logging.kube-system.svc.cluster.local:9200:查找elasticsearch -logging.kube-system.svc.cluster.local:没有此类主机 2018-02-22T14:05:01.532Z WARN Transport / tcp.go:36 DNS查找失败“ elasticsearch-logging.kube-system.svc.cluster .local”:查找elasticsearch-logging.kube-system.svc.cluster.local:没有此类主机 < / pre>

主机名很好,因为其他Pod已成功将数据推入弹性。 现在,经过一番研究,事实证明这是Golang DNS解析器的问题(而不是metricbeat本身)。 还有其他人遇到此问题吗? 有人解决方案吗?

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongzhansong5785 2018-08-07 07:13
    已采纳

    We had the same problem and what fixed it was adding this

    hostNetwork: true  
    dnsPolicy: ClusterFirstWithHostNet  
    

    In the DaemonSet yaml on the same level as the containers tag

    打赏 评论

相关推荐 更多相似问题