1

我已经在本地集群中设置了 elastic + kibana + metricbeat。但 metricbeat 无法连接到弹性:

ERROR   pipeline/output.go:100  Failed to connect to 
backoff(elasticsearch(http://elasticsearch:9200)): Get http://elasticsearch:9200: lookup 
elasticsearch on 10.96.0.10:53: no such host
2019-10-15T14:14:32.553Z    INFO    pipeline/output.go:93   Attempting to reconnect to 
backoff(elasticsearch(http://elasticsearch:9200)) with 10 reconnect attempt(s)
2019-10-15T14:14:32.553Z    INFO    [publisher] pipeline/retry.go:189   retryer: send unwait-signal to consumer
2019-10-15T14:14:32.553Z    INFO    [publisher] pipeline/retry.go:191     done
2019-10-15T14:14:32.553Z    INFO    [publisher] pipeline/retry.go:166   retryer: send wait signal to consumer
2019-10-15T14:14:32.553Z    INFO    [publisher] pipeline/retry.go:168     done
2019-10-15T14:14:32.592Z    WARN    transport/tcp.go:53 DNS lookup failure "elasticsearch": lookup elasticsearch on 10.96.0.10:53: no such host

在我的集群中,我使用 metalldb 和 ingress。我已经设置了入口规则,但它没有帮助我。

另外我注意到 elk 和 metricbeat 在文档中有不同的命名空间。我试过在任何地方都使用相同的命名空间,但没有成功。

下面我附上了我的yamls。elastic/kibana 和 metricbeat 的文件我没有附上,因为它们有很多行,我只在它们上面写了 ref:

  1. 弹性/kibana - https://download.elastic.co/downloads/eck/1.0.0-beta1/all-in-one.yaml

  2. metricbeat - https://raw.githubusercontent.com/elastic/beats/7.4/deploy/kubernetes/metricbeat-kubernetes.yaml

也许有人知道为什么会这样?

 **elastic config** -
 apiVersion: elasticsearch.k8s.elastic.co/v1beta1
 kind: Elasticsearch
 metadata:
 name: quickstart
 spec:
 version: 7.4.0
 nodeSets:
 - name: default
 count: 1
 config:
  node.master: true
  node.data: true
  node.ingest: true
  node.store.allow_mmap: false
 volumeClaimTemplates:
 - metadata:
    name: elasticsearch-data # note: elasticsearch-data must be the name of the Elasticsearch volume
  spec:
    accessModes:
    - ReadWriteOnce
    resources:
      requests:
        storage: 20Gi
    storageClassName: standard
http:
service:
  spec:
    type: LoadBalancer

**kibana config** -
apiVersion: kibana.k8s.elastic.co/v1beta1
kind: Kibana
metadata:
name: quickstart
spec:
version: 7.4.0
count: 1
elasticsearchRef:
name: quickstart
http:
service:
  spec:
    type: LoadBalancer
tls:
  selfSignedCertificate:
    disabled: true

**ingress rules** -
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress
annotations:
spec:
rules:
- http:
  paths:
  - path: /
    backend:
      serviceName: undemo-service
      servicePort: 80
  - path: /
    backend:
      serviceName: quickstart-kb-http
      servicePort: 80
  - path: /
    backend:
      serviceName: quickstart-es-http
      servicePort: 80
4

1 回答 1

1

只是要意识到。Filebeat、metricbeats... 在 kube-system 命名空间下运行。

如果您在默认命名空间上运行 elastic,您应该将elasticsearch.default 其用作主机以正确解析您的服务。

于 2020-06-11T23:57:44.443 回答