# Not able to connect elastic search from logstash

**URL:** <https://discuss.elastic.co/t/not-able-to-connect-elastic-search-from-logstash/262309>\
**Category:** Logstash\
**Created:** [January 27, 2021, 5:04am UTC](https://discuss.elastic.co/t/not-able-to-connect-elastic-search-from-logstash/262309 "2021-01-27T05:04:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Madhu05281](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@Madhu05281](https://discuss.elastic.co/u/Madhu05281)\
**Post date:** [January 27, 2021, 5:04am UTC](https://discuss.elastic.co/t/not-able-to-connect-elastic-search-from-logstash/262309/1 "2021-01-27T05:04:09Z")

</div>

````auto
kind: ConfigMap
metadata:
  name: logstash-config
  namespace: ns-erp
data:
  logstash.conf: |-
    input {
      beats {
          port => "9600"
      }
    }
 
    output {
      # You can uncomment this line to investigate the generated events by the logstash. 10.160.89.16
      stdout {codec => rubydebug}
         elasticsearch {
          hosts => "http://10.160.89.16:9200"
          index => "trapeze-logs"
          username => "xxxx"
          password => "xxxx"
      }
    }
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: logstash
namespace: ns-erp
spec:
selector:
    matchLabels:
      app: logstash
  template:
    metadata:
      labels:
        app: logstash
    spec:
      hostname: logstash
      containers:
        - name: logstash
          ports:
            - containerPort: 9600
              name: logstash
          image: docker.elastic.co/logstash/logstash:7.5.0
          volumeMounts:
            - name: logstash-conf
              mountPath: /usr/share/logstash/pipeline
          command:
            - logstash
      volumes:
        # Previously defined ConfigMap object.
        - name: logstash-conf
          configMap:
            name: logstash-config
            items:
              - key: logstash.conf
                path: logstash.conf
---
kind: Service
apiVersion: v1
metadata:
  name: logstash
  namespace: ns-erp
spec:
  type: NodePort
  selector:
    app: logstash
  ports:
    - protocol: TCP
      port: 9600
      targetPort: 9600
      name: logstash
---```

------------------------------------------------------------
Getting error like
sion.pipelineregisterhook] xpack.monitoring.enabled has not been defined, but found elasticsearch configuration. Please explicitly set `xpack.monitoring.enabled: true` in logstash.yml
licensereader] Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[http://elasticsearch:9200/]}}
licensereader] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"http://elasticsearch:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch: Name or service not known"}
licensereader] Marking url as dead. Last error: [LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError] Elasticsearch Unreachable: [http://elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch {:url=>http://elasticsearch:9200/, :error_message=>"Elasticsearch Unreachable: [http://elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch", :error_class=>"LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError"}
licensereader] Unable to retrieve license information from license server {:message=>"Elasticsearch Unreachable: [http://elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch"}
````

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 27, 2021, 6:11am UTC](https://discuss.elastic.co/t/not-able-to-connect-elastic-search-from-logstash/262309/2 "2021-01-27T06:11:33Z")

</div>

Welcome to our community! 😃

It's not clear what the issue is here sorry, all I can see is some config?

---

<div class="post-metadata">

**Author:** ![Madhu05281](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@Madhu05281](https://discuss.elastic.co/u/Madhu05281)\
**Post date:** [January 27, 2021, 6:20am UTC](https://discuss.elastic.co/t/not-able-to-connect-elastic-search-from-logstash/262309/3 "2021-01-27T06:20:50Z")

</div>

> [@Madhu05281](#):
>
> ```auto
> sion.pipelineregisterhook] xpack.monitoring.enabled has not been defined, but found elasticsearch configuration. Please explicitly set `xpack.monitoring.enabled: true` in logstash.yml
> licensereader] Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[http://elasticsearch:9200/]}}
> licensereader] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"http://elasticsearch:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch: Name or service not known"}
> licensereader] Marking url as dead. Last error: [LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError] Elasticsearch Unreachable: [http://elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch {:url=>http://elasticsearch:9200/, :error_message=>"Elasticsearch Unreachable: [http://elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch", :error_class=>"LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError"}
> licensereader] Unable to retrieve license information from license server {:message=>"Elasticsearch Unreachable: [http://elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch"}
> 
> ```

Dear Mark,

We are getting error like **Unable to retrieve license information from license server**  
and This is likely due to failure to reach a live Elasticsearch cluster.

I had attached our lagstash.yml file for your reference.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 24, 2021, 6:20am UTC](https://discuss.elastic.co/t/not-able-to-connect-elastic-search-from-logstash/262309/4 "2021-02-24T06:20:50Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
