'Attempted to resurrect connection to dead ES instance, but got an error {:url=>"http://elasticsearch:9200/}

Hi i tried installing ELK using kubernetes HELM chart. where I encounter an error

[2022-04-25T08:30:13,300][INFO ][logstash.outputs.elasticsearch][main] New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>["http://elasticsearch-master:9200"]}
[2022-04-25T08:30:13,384][INFO ][logstash.outputs.elasticsearch][main] Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[http://elasticsearch-master:9200/]}}
[2022-04-25T08:30:13,589][WARN ][logstash.outputs.elasticsearch][main] Restored connection to ES instance {:url=>"http://elasticsearch-master:9200/"}
[2022-04-25T08:30:38,729][WARN ][logstash.licensechecker.licensereader] Attempted to resurrect connection to dead ES instance, but got an error {:url=>"http://elasticsearch:9200/", :exception=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :message=>"Elasticsearch Unreachable: [http://elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch: Name or service not known"}

My elasticsearch service is deployed as http://elasticsearch-master:9200 but from the error above it shows that it still trying to connect to http://elasticsearch:9200 which is unavailable service in my environment. Supposedly should be connecting to http://elasticsearch-master:9200

This is my current config for logstash.conf in values.yml

    ---
replicas: 1

# Allows you to add any config files in /usr/share/logstash/config/
# such as logstash.yml and log4j2.properties
#
# Note that when overriding logstash.yml, `http.host: 0.0.0.0` should always be included
# to make default probes work.
logstashConfig: {}
#  logstash.yml: |
#    key:
#      nestedkey: value
#  log4j2.properties: |
#    key = value

# Allows you to add any pipeline files in /usr/share/logstash/pipeline/
### ***warn*** there is a hardcoded logstash.conf in the image, override it first
logstashPipeline: 
  logstash.conf: |
    input {
      beats {
        port => 5044
      }
    }
    output { elasticsearch { hosts => ["http://elasticsearch-master:9200"]} }
# Allows you to add any pattern files in your custom pattern dir
logstashPatternDir: "/usr/share/logstash/patterns/"
logstashPattern: {}

not sure where else i could define my config. Please help

NAME                            TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
elasticsearch-master            ClusterIP   10.110.73.238    <none>        9200/TCP,9300/TCP   123m
elasticsearch-master-headless   ClusterIP   None             <none>        9200/TCP,9300/TCP   123m
kibana-kibana                   ClusterIP   10.111.29.250    <none>        5601/TCP            3d
kubernetes                      ClusterIP   10.96.0.1        <none>        443/TCP             19d
logstash-logstash               ClusterIP   10.111.110.200   <none>        5044/TCP,8080/TCP   19m
logstash-logstash-headless      ClusterIP   None             <none>        9600/TCP            19m

above shows my services

App version - 7.17.3



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source