gpt4 book ai didi

elasticsearch - 不能连接到Kubernetes(裸机(Bare Metal))中的Elasticsearch

转载 作者:行者123 更新时间:2023-12-02 12:31:31 27 4
gpt4 key购买 nike

我已经在本地集群中设置了Elastic + Kibana + metricbeat。但是metricbeat无法连接到Elastic:

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在文档中具有不同的 namespace 。我试过在所有地方都使用相同的 namespace ,但是没有成功。

下面附上我的Yaml。我没有附加用于elastic / kibana和metricbeat的文件,因为它们有很多行,我只在它们上写了ref:
  • elastic / kibana-
    https://download.elastic.co/downloads/eck/1.0.0-beta1/all-in-one.yaml
  • 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

    最佳答案

    只是要注意。 Filebeat,metricbeats ...在kube系统 namespace 下运行。

    如果在默认 namespace 上运行 flex ,则应使用elasticsearch.default作为主机,以便正确解析服务。

    关于elasticsearch - 不能连接到Kubernetes(裸机(Bare Metal))中的Elasticsearch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58397278/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com