# Unable to connect remothly to elasticsearch 5.1.1

**URL:** <https://discuss.elastic.co/t/unable-to-connect-remothly-to-elasticsearch-5-1-1/71108>\
**Category:** Elasticsearch\
**Created:** [January 10, 2017, 3:47pm UTC](https://discuss.elastic.co/t/unable-to-connect-remothly-to-elasticsearch-5-1-1/71108 "2017-01-10T15:47:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoavb](https://avatars.discourse-cdn.com/v4/letter/y/839c29/32.png) [@yoavb](https://discuss.elastic.co/u/yoavb)\
**Post date:** [January 10, 2017, 3:47pm UTC](https://discuss.elastic.co/t/unable-to-connect-remothly-to-elasticsearch-5-1-1/71108/1 "2017-01-10T15:47:57Z")

</div>

Hello,  
I have successfully installed ELK version 5.1.1  
The Elastic , kibana and logstash are up and running

```
#service elasticsearch start
Starting elasticsearch: [OK]

# curl -XGET 'localhost:9200/?pretty'
{
  "name" : "5gvYWYb",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "54tznb7hTfCWCfVP00SREA",
  "version" : {
    "number" : "5.1.1",
    "build_hash" : "5395e21",
    "build_date" : "2016-12-06T12:36:15.409Z",
    "build_snapshot" : false,
    "lucene_version" : "6.3.0"
  },
  "tagline" : "You Know, for Search"
}

```

So far so good.

The problem start when i am trying to connect to the linux machine REMOTHLY .  
Or even when i am trying to telnet the machine locally to port 9200 :

```
# netstat -ntlup|grep 9200
tcp 0 0 ::ffff:127.0.0.1:9200 :::* LISTEN 8950/java           
tcp 0 0 ::1:9200 :::* LISTEN 8950/java    

```

As you can see above it listenen to localhost on port 9200

```
# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.22.xxx.x xxxx xxxx.xxx.xxx <<<----My public ip adress 

# /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:56:A7:2C:38  
          inet addr:172.22.xxx.x Bcast:172.22.xxx.xxx Mask:255.xxx.xxx.0
          ....
lo Link encap:Local Loopback  
          inet addr:127.0.0.1 Mask:255.0.0.0

```

Also telnet to localhost is ofcorse working :  
# telnet localhost 9200  
Trying ::1...  
Connected to localhost.  
Escape character is '^]'.

But when i am trying to telnet port 9200 by the public ip address i get an error :

```
# telnet 172.22.xxx.x 9200
Trying 172.22.xxx.x...
telnet: connect to address 172.22.xxx.x: Connection refused

```

I found here : [http://stackoverflow.com/questions/34449342/installed-elastic-search-on-server-but-cannot-connect-to-it-if-from-another-mach](http://stackoverflow.com/questions/34449342/installed-elastic-search-on-server-but-cannot-connect-to-it-if-from-another-mach)  
that i should set network.bind\_host: 0.0.0.0 in the elasticsearch.yml

The entry : network.bind\_host does not exists in the elasticsearch.yml file  
Adding this entry to the yml file cause the elasticsearch to crash upon startup.

I also tried to set :  
network.host: 0.0.0.0 in elasticsearch.yml file and restart the elastsearch , but the elasticsearch failed to restart :

```
# service elasticsearch stop
Stopping elasticsearch: [OK]
# service elasticsearch start
Starting elasticsearch: [OK]

# curl -XGET 'localhost:9200/?pretty'
curl: (7) couldn't connect to host

```

Same thing happened when i have tried to set the PUBLIC IP Address :  
network.host: 172.22.xxx.x

Please advise how i can enable a remote connection to the elasticsearch version 5.1.1

Regards

---

<div class="post-metadata">

**Author:** ![yoavb](https://avatars.discourse-cdn.com/v4/letter/y/839c29/32.png) [@yoavb](https://discuss.elastic.co/u/yoavb)\
**Post date:** [January 10, 2017, 4:23pm UTC](https://discuss.elastic.co/t/unable-to-connect-remothly-to-elasticsearch-5-1-1/71108/2 "2017-01-10T16:23:34Z")

</div>

Problem solved 🙂

Enabling : network.host: 0.0.0.0 at the elasticsearc.yml file togther with  
adding the following entries to /etc/security/limits.conf

# End of file

elasticsearch soft memlock 65536  
elasticsearch hard memlock 65536  
elasticsearch nofile 65536  
elasticsearch soft nproc 65536

Thanks

---

<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 7, 2017, 4:23pm UTC](https://discuss.elastic.co/t/unable-to-connect-remothly-to-elasticsearch-5-1-1/71108/3 "2017-02-07T16:23:45Z")

</div>

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