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

时间:2018-02-22 14:13:01

标签: elasticsearch go dns kubernetes metricbeat

我尝试在GCP kubernetes集群上运行官方metricbeat docker镜像(https://www.elastic.co/guide/en/beats/metricbeat/current/running-on-kubernetes.html)作为deamonset并更改设置,以便将流量路由到现有的弹性搜索窗格,但我一直在错误:

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

主机名很好,因为其他pod正在成功地将数据推送到弹性。现在,经过一些研究后,这变成了Golang DNS解析器的问题(而不是metricbeat本身)。 遇到此问题的其他人?有人解决方案吗?

1 个答案:

答案 0 :(得分:1)

我们遇到了同样的问题,并且在解决该问题时又添加了

hostNetwork: true  
dnsPolicy: ClusterFirstWithHostNet  

在DaemonSet yaml中与容器标签处于同一级别