# Kibana try connect to port 9200 instead the default protocol port (80 or 443)

**URL:** <https://discuss.elastic.co/t/kibana-try-connect-to-port-9200-instead-the-default-protocol-port-80-or-443/132597>\
**Category:** Kibana\
**Created:** [May 20, 2018, 5:12pm UTC](https://discuss.elastic.co/t/kibana-try-connect-to-port-9200-instead-the-default-protocol-port-80-or-443/132597 "2018-05-20T17:12:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcortinas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mcortinas/32/3859_2.png) [@mcortinas](https://discuss.elastic.co/u/mcortinas)\
**Post date:** [May 20, 2018, 5:12pm UTC](https://discuss.elastic.co/t/kibana-try-connect-to-port-9200-instead-the-default-protocol-port-80-or-443/132597/1 "2018-05-20T17:12:03Z")

</div>

Hello,

We're using ES6.2.4 stack over mesos platform.  
We use marathon and marathon-lb ([GitHub - mesosphere/marathon-lb: Marathon-lb is a service discovery & load balancing tool for DC/OS](https://github.com/mesosphere/marathon-lb)) project in order to orchestrate and publish ES624 cross search instances and using official ES docker images.

Elasticsearch Cross Search is registered to Marathon-LB with this settings:

> "labels": {  
> "HAPROXY\_0\_VHOST": "elasticsearch-cross-search.SUFFIXDNS"

Kibana service is launched setting this environment variable:

> ELASTICSEARCH\_URL": "[http://elasticsearch-cross-search.SEFFIXDNS](http://elasticsearch-cross-search.SEFFIXDNS)",

It seems a simple configuration but this is not working fine, in fact, Kibana can not connect to ES.

> {"type":"log","@timestamp":"2018-05-20T06:41:22Z","tags":["status","plugin:elasticsearch@6.2.4","info"],"pid":15,"state":"yellow","message":"Status changed from uninitialized to yellow - Waiting for Elasticsearch","prevState":"uninitialized","prevMsg":"uninitialized"}  
> ....  
> {"type":"log","@timestamp":"2018-05-20T06:41:22Z","tags":["error","elasticsearch","admin"],"pid":15,"message":"Request error, retrying\nHEAD [http://elasticsearch-cross-search.SUFFIXDNS:9200/](http://elasticsearch-cross-search.SUFFIXDNS:9200/) =\> connect ECONNREFUSED 10.B.C.D:9200"}  
> {"type":"log","@timestamp":"2018-05-20T06:41:22Z","tags":["warning","elasticsearch","admin"],"pid":15,"message":"Unable to revive connection: [http://elasticsearch-cross-search.SUFFIXDNS:9200/](http://elasticsearch-cross-search.SUFFIXDNS:9200/)"}  
> {"type":"log","@timestamp":"2018-05-20T06:41:22Z","tags":["warning","elasticsearch","admin"],"pid":15,"message":"No living connections"}  
> ....  
> {"type":"log","@timestamp":"2018-05-20T06:41:22Z","tags":["status","plugin:elasticsearch@6.2.4","error"],"pid":15,"state":"red","message":"Status changed from yellow to red - Unable to connect to Elasticsearch at [http://elasticsearch-cross-search.SUFFIXDNS](http://elasticsearch-cross-search.SUFFIXDNS).","prevState":"yellow","prevMsg":"Waiting for Elasticsearch"}

The first step was modify ELASTICSEARCH\_URL environment using IP and PORT of ES instance and it was working fine.  
This is not working well due to the published port by elasticsearch is 9200 instead 80  
The fix has been specify the port in ELASTICSEARCH\_URL environment variable.

> ELASTICSEARCH\_URL": "[http://elasticsearch-cross-search.SUFFIXDNS:80](http://elasticsearch-cross-search.SUFFIXDNS:80)",

Kibana traces was these

> {"type":"log","@timestamp":"2018-05-20T07:10:02Z","tags":["status","plugin:elasticsearch@6.2.4","info"],"pid":15,"state":"yellow","message":"Status changed from uninitialized to yellow - Waiting for Elasticsearch","prevState":"uninitialized","prevMsg":"uninitialized"}  
> ....  
> {"type":"log","@timestamp":"2018-05-20T07:10:02Z","tags":["status","plugin:elasticsearch@6.2.4","info"],"pid":15,"state":"green","message":"Status changed from yellow to green - Ready","prevState":"yellow","prevMsg":"Waiting for Elasticsearch"}

**I think Kibana should modify the code in order to use the default ports from the protocol instead the port 9200**

---

<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:** [May 20, 2018, 7:34pm UTC](https://discuss.elastic.co/t/kibana-try-connect-to-port-9200-instead-the-default-protocol-port-80-or-443/132597/2 "2018-05-20T19:34:07Z")

</div>

I disagree. Given that Elasticsearch by default binds to port 9200 and can not be run as root (which makes binding ton port 80 difficult), having 9200 as default value makes perfect sense.

---

<div class="post-metadata">

**Author:** ![mcortinas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mcortinas/32/3859_2.png) [@mcortinas](https://discuss.elastic.co/u/mcortinas)\
**Post date:** [May 20, 2018, 7:41pm UTC](https://discuss.elastic.co/t/kibana-try-connect-to-port-9200-instead-the-default-protocol-port-80-or-443/132597/3 "2018-05-20T19:41:53Z")

</div>

I think kibana such as anothers http applications should respect [RFC 1738 - Uniform Resource Locators (URL)](https://tools.ietf.org/html/rfc1738).

> ```
> port
> The port number to connect to. Most schemes designate
> protocols that have a default port number. Another port number
> may optionally be supplied, in decimal, separated from the
> host by a colon. If the port is omitted, the colon is as well.
> 
> ```

If another port number is optional, then the applications should respect the ports designate by schemes.  
This is just one opinion.

---

<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:** [June 17, 2018, 7:41pm UTC](https://discuss.elastic.co/t/kibana-try-connect-to-port-9200-instead-the-default-protocol-port-80-or-443/132597/4 "2018-06-17T19:41:58Z")

</div>

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