# Unable to connect to Elasticsearch at http://localhost:9200 on Kubernetes

**URL:** <https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-at-http-localhost-9200-on-kubernetes/92573>\
**Category:** Elasticsearch\
**Created:** [July 11, 2017, 5:36am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-at-http-localhost-9200-on-kubernetes/92573 "2017-07-11T05:36:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dilliplkumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dilliplkumar/32/43512_2.png) [@dilliplkumar](https://discuss.elastic.co/u/dilliplkumar)\
**Post date:** [July 11, 2017, 5:36am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-at-http-localhost-9200-on-kubernetes/92573/1 "2017-07-11T05:36:42Z")

</div>

I have deployed elasticsearch cluster with 3 master nodes, 3 data nodes and 2 client nodes inside kubernetes using elasticsearch:5.5.0 and kibana:2.1.0, I could able to check the cluster health which looks good.

{  
"cluster\_name" : "elk-poc",  
"status" : "green",  
"timed\_out" : false,  
"number\_of\_nodes" : 8,  
"number\_of\_data\_nodes" : 3,  
"active\_primary\_shards" : 0,  
"active\_shards" : 0,  
"relocating\_shards" : 0,  
"initializing\_shards" : 0,  
"unassigned\_shards" : 0,  
"delayed\_unassigned\_shards" : 0,  
"number\_of\_pending\_tasks" : 0,  
"number\_of\_in\_flight\_fetch" : 0,  
"task\_max\_waiting\_in\_queue\_millis" : 0,  
"active\_shards\_percent\_as\_number" : 100.0  
}

From one of the kubernetes instance I could able to curl following:  
curl [http://elasticsearch.default.svc.cluster.local:9200](http://elasticsearch.default.svc.cluster.local:9200)  
{  
"name" : "es-client-296809788-l1zhg",  
"cluster\_name" : "elk-poc",  
"cluster\_uuid" : "ddILZMGaTTGtk8Oe1m5EjQ",  
"version" : {  
"number" : "5.5.0",  
"build\_hash" : "260387d",  
"build\_date" : "2017-06-30T23:16:05.735Z",  
"build\_snapshot" : false,  
"lucene\_version" : "6.6.0"  
},  
"tagline" : "You Know, for Search"  
}

But on Kibana page I could see unable to connect elasticsearch at [http://localhost:9200](http://localhost:9200)

Though I tried curl to [http://localhost:9200](http://localhost:9200), which show connection refused.

curl: (7) Failed to connect to 127.0.0.1 port 9200: Connection refused

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 11, 2017, 5:47am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-at-http-localhost-9200-on-kubernetes/92573/2 "2017-07-11T05:47:34Z")

</div>

Kibana 2.1.0 sounds wrong. make sure your are using Kibana 5.5.0 as it needs to [align with the Elasticsearch version](https://www.elastic.co/support/matrix#show_compatibility). Is Kibana running together with the client node?

---

<div class="post-metadata">

**Author:** ![dilliplkumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dilliplkumar/32/43512_2.png) [@dilliplkumar](https://discuss.elastic.co/u/dilliplkumar)\
**Post date:** [July 11, 2017, 11:37am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-at-http-localhost-9200-on-kubernetes/92573/3 "2017-07-11T11:37:50Z")

</div>

Thanks for the your response, I have migrated to use ELK 5.5.0 versions.. Now things are looking good.. but my logstash container is crashing with following error:

camogts0002 [6:57] [edibehe/ERIKUBE/ELK\_POC\_550] -\> kubectl logs logstash-2079140465-jx2st  
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.  
Sending Logstash's logs to /usr/share/logstash/logs which is now configured via log4j2.properties  
10:57:17.528 [main] INFO logstash.setting.writabledirectory - Creating directory {:setting=\>"path.queue", :path=\>"/usr/share/logstash/data/queue"}  
10:57:17.534 [main] INFO logstash.setting.writabledirectory - Creating directory {:setting=\>"path.dead\_letter\_queue", :path=\>"/usr/share/logstash/data/dead\_letter\_queue"}  
10:57:17.559 [LogStash::Runner] INFO logstash.agent - No persistent UUID file found. Generating new UUID {:uuid=\>"8f12d382-e32c-4fec-8145-130e3a1b8b1a", :path=\>"/usr/share/logstash/data/uuid"}  
10:57:17.765 [[main]-pipeline-manager] INFO logstash.pipeline - Starting pipeline {"id"=\>"main", "pipeline.workers"=\>4, "pipeline.batch.size"=\>125, "pipeline.batch.delay"=\>5, "pipeline.max\_inflight"=\>500}  
10:57:17.790 [[main]-pipeline-manager] INFO logstash.pipeline - Pipeline main started  
10:57:17.857 [Api Webserver] INFO logstash.agent - Successfully started Logstash API endpoint {:port=\>9600}  
10:57:20.821 [LogStash::Runner] WARN logstash.agent - stopping pipeline {:id=\>"main"}

- I think I have to delete client-node when running logstash and kibana nodes..

---

<div class="post-metadata">

**Author:** ![dilliplkumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dilliplkumar/32/43512_2.png) [@dilliplkumar](https://discuss.elastic.co/u/dilliplkumar)\
**Post date:** [July 11, 2017, 3:03pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-at-http-localhost-9200-on-kubernetes/92573/4 "2017-07-11T15:03:29Z")

</div>

I had a problem with my logstash.conf file, fixed now and working - need to know about the client-node and logstash kibana pods running together consequences

---

<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:** [August 8, 2017, 3:03pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-at-http-localhost-9200-on-kubernetes/92573/5 "2017-08-08T15:03:46Z")

</div>

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