【问题标题】:helm chart stable/logstash - doesnt see elasticsearch in same nshelm chart stable/logstash - 在同一个 ns 中看不到 elasticsearch
【发布时间】:2020-01-29 07:50:01
【问题描述】:

我已经安装了用于本地测试的 elasticsearch 和 logstash,它们似乎看不到本地 es - 知道如何在 cluster/ns 中看到 es 吗?

helm repo add elastic https://helm.elastic.co
helm install elastic/elasticsearch --name elasticsearch
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm install stable/logstash --name logstash -f logstash.yaml

这是错误信息:

[2020-01-29T07:40:43,368][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"http://elasticsearch.cluster.local:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://elasticsearch.cluster.local:9200/][Manticore::ResolutionFailure] elasticsearch.cluster.local: Name or service not known"}

logstash.yaml 是 - (完整配置可以通过 helm inspect values stable/logstash 检查)我修剪了所有内容并留下了我认为重要的内容。

elasticsearch:
  host: elasticsearch.cluster.local
  port: 9200

编辑: 当我放置 elasticsearch master pod 的 IP 时,一切正常 - 问题是有 3 个 pod,我宁愿点击它的 dns/fqdn 而不是特定实例 - 知道它在集群中是如何可见的吗?

【问题讨论】:

    标签: elasticsearch kubernetes logstash google-kubernetes-engine kubernetes-helm


    【解决方案1】:

    好的,我发现了 dns 的工作原理

    首先找出服务名称:

    $ kubectl get services
    NAME                            TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)             AGE
    elasticsearch-master            ClusterIP   10.140.10.26   <none>        9200/TCP,9300/TCP   108m
    elasticsearch-master-headless   ClusterIP   None           <none>        9200/TCP,9300/TCP   108m
    kibana-kibana                   ClusterIP   10.140.10.55   <none>        5601/TCP            108m
    

    看看它是什么命名空间

    $ kubectl get ns
    NAME               STATUS        AGE
    default            Active        1d
    kube-public        Active        1d
    kube-system        Active        1d
    monitoring         Active        1d
    

    并且它将通过

    从其他 pod 中可见
    elasticsearch-master.monitoring.svc.cluster.local
    

    【讨论】:

    • 对不起,因为我也有同样的问题,请您详细说明一下吗?
    猜你喜欢
    • 1970-01-01
    • 2020-11-30
    • 2020-05-13
    • 1970-01-01
    • 1970-01-01
    • 2023-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多