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

标签 elasticsearch kubernetes kibana metricbeat

我已经在本地集群中设置了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/

    相关文章:

    elasticsearch - 适用于英国邮政编码的Elasticsearch映射,能够处理间距和大小写

    c# - 带有Kibana的ElasticSearch云上的Serilog接收器未收到消息

    kubernetes - RabbitMQ 管理 - 加载队列或交换时出现 404

    ssl - 可以在 nginx 入口 Controller 中使用动态路由吗?

    elasticsearch - 尽管kibana.service正常启动,但Kibana停止工作,现在服务器未准备就绪

    elasticsearch - 使用filebeat、logstash和elasticsearch向kibana发送json格式日志?

    apache-spark - Spark 流传输期间无法将数据帧保存到Elasticsearch

    java - 在搜索中找不到术语,但存在于 Elasticsearch 中的术语 vector 中

    docker - 可以通过kubernetes的探测告诉基础设施该服务肯定失败了吗?

    kibana - 我想在 kibana 仪表板中添加图像