【问题标题】:Impossible connect to elasticsearch in kubernetes(bare metal)无法连接到 kubernetes(裸机)中的弹性搜索
【发布时间】:2019-10-15 14:44:20
【问题描述】:

我已经在本地集群中设置了 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 在文档中具有不同的命名空间。我试过在所有地方都设置相同的命名空间,但没有成功。

下面我附上了我的 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

【问题讨论】:

  • 你能发布你的服务吗?

标签: elasticsearch kubernetes kibana metricbeat


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-23
    • 2022-10-23
    • 2018-11-28
    相关资源
    最近更新 更多