# Curl: (7) Failed connect to 193.81.62.189:9200; Connection refused

**URL:** <https://discuss.elastic.co/t/curl-7-failed-connect-to-193-81-62-189-9200-connection-refused/85285>\
**Category:** Elasticsearch\
**Created:** [May 10, 2017, 4:43pm UTC](https://discuss.elastic.co/t/curl-7-failed-connect-to-193-81-62-189-9200-connection-refused/85285 "2017-05-10T16:43:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![shyamalaponnada](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shyamalaponnada](https://discuss.elastic.co/u/shyamalaponnada)\
**Post date:** [May 10, 2017, 4:43pm UTC](https://discuss.elastic.co/t/curl-7-failed-connect-to-193-81-62-189-9200-connection-refused/85285/1 "2017-05-10T16:43:31Z")

</div>

Hi,  
I installed ES 5.0. on my server(centos 7). I want to work on server not localhost. So I changed my elasticsearch.yml file with my ip number:193.81.62.189:

network.host: 193.81.62.189

After restart ES and I tried to connection.

However It didn't work true.

# curl [http://193.81.62.189:9200](http://193.81.62.189:9200)

my error:  
curl: (7) Failed connect to 193.81.62.189:9200; Connection refused

What is the problem????

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [May 12, 2017, 6:30am UTC](https://discuss.elastic.co/t/curl-7-failed-connect-to-193-81-62-189-9200-connection-refused/85285/2 "2017-05-12T06:30:04Z")

</div>

> [@shyamalaponnada](#):
>
> I installed ES 5.0.

5.0 is quite an old version. If this is a new install, you would be better of installing a newer version such as [5.4.0](https://www.elastic.co/downloads/past-releases/elasticsearch-5-4-0) or [5.3.2](https://www.elastic.co/downloads/past-releases/elasticsearch-5-3-2).

> [@](#):
>
> curl: (7) Failed connect to 193.81.62.189:9200; Connection refused

Are you sure that elasticsearch started correctly?

Check the `elasticsearch.log` file and see what it says.  
It is quite possible that you have triggered some [bootstrap checks](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/bootstrap-checks.html) that are applied automatically when you set the network host to an external interface.

---

<div class="post-metadata">

**Author:** ![shyamalaponnada](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shyamalaponnada](https://discuss.elastic.co/u/shyamalaponnada)\
**Post date:** [May 16, 2017, 6:10pm UTC](https://discuss.elastic.co/t/curl-7-failed-connect-to-193-81-62-189-9200-connection-refused/85285/3 "2017-05-16T18:10:00Z")

</div>

Hi Tim

Thanks for reply!!!!

I am attaching my log file here

```auto
-sh-4.2$ tail -f /var/log/elasticsearch/elasticsearch.log
[2017-05-12 14:47:23,826][INFO][node] [h6gY7iy] starting ...
[2017-05-12 14:47:24,042][INFO][transport] [h6gY7iy] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}
[2017-05-12 14:47:24,048][WARN][bootstrap] [h6gY7iy] initial heap size [268435456] not equal to maximum heap size [2147483648]; this can cause resize pauses and prevents mlockall from locking the entire heap
[2017-05-12 14:47:24,048][WARN][bootstrap] [h6gY7iy] please set [discovery.zen.minimum_master_nodes] to a majority of the number of master eligible nodes in your cluster
[2017-05-12 14:47:24,048][WARN][bootstrap] [h6gY7iy] max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
[2017-05-12 14:47:27,170][INFO][cluster.service] [h6gY7iy] new_master {h6gY7iy}{h6gY7iyeSw2bXA6HoMCSvA}{n3Jeyl5VQ_2enaPXQY8WbQ}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)
[2017-05-12 14:47:27,184][INFO][http] [h6gY7iy] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
[2017-05-12 14:47:27,184][INFO][node] [h6gY7iy] started
[2017-05-12 14:47:27,426][INFO][gateway] [h6gY7iy] recovered [1] indices into cluster_state
[2017-05-12 14:47:27,701][INFO][cluster.routing.allocation] [h6gY7iy] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[twitter][4]] ...]).
-------------------------------------------------------------------------------------------------

```

this is my elasticsearch.yml file

```auto
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
# cluster.name:my.application

#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
#

# node.name: qa-data

#
# Add custom attributes to the node:
#
# node.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
# path.data: /var/data/elasticsearch

# Path to log files:
#
# path.logs: /var/logs/elasticsearch

# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
# bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#

# network.host:193.81.62.189

# Set a custom port for HTTP:
#
# http.port: 9200
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
# discovery.zen.ping.unicast.hosts: ["193.81.62.189:9200"]

# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
  discovery.zen.minimum_master_nodes: 3

# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html>
#

 ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
# gateway.recover_after_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html>
#
# ---------------------------------- Various -----------------------------------
#
# Disable starting multiple nodes on a single system:
#
# node.max_local_storage_nodes: 1
#
# Require explicit names when deleting indices:
#
# action.destructive_requires_name: true

```

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [May 19, 2017, 6:01am UTC](https://discuss.elastic.co/t/curl-7-failed-connect-to-193-81-62-189-9200-connection-refused/85285/4 "2017-05-19T06:01:15Z")

</div>

```auto
# network.host:193.81.62.189

```

That is a YAML comment.  
In order to actually set the host that you are binding to, you need to remove the leading `#`.

---

<div class="post-metadata">

**Author:** ![shyamalaponnada](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shyamalaponnada](https://discuss.elastic.co/u/shyamalaponnada)\
**Post date:** [May 19, 2017, 5:22pm UTC](https://discuss.elastic.co/t/curl-7-failed-connect-to-193-81-62-189-9200-connection-refused/85285/5 "2017-05-19T17:22:55Z")

</div>

I have tried by removing # also but still getting the same error

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [May 19, 2017, 8:36pm UTC](https://discuss.elastic.co/t/curl-7-failed-connect-to-193-81-62-189-9200-connection-refused/85285/6 "2017-05-19T20:36:46Z")

</div>

You need to check your logs again, you are now probably failing these bootstrap checks:

```auto
[2017-05-12 14:47:24,048][WARN][bootstrap] [h6gY7iy] please set [discovery.zen.minimum_master_nodes] to a majority of the number of master eligible nodes in your cluster
[2017-05-12 14:47:24,048][WARN][bootstrap] [h6gY7iy] max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]

```

Are you sure that you're on 5.0.0 though and not an alpha or a beta release of 5.0.0? I'm almost certain that we removed the first check before releasing 5.0.0.

---

<div class="post-metadata">

**Author:** ![shyamalaponnada](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shyamalaponnada](https://discuss.elastic.co/u/shyamalaponnada)\
**Post date:** [May 22, 2017, 7:07pm UTC](https://discuss.elastic.co/t/curl-7-failed-connect-to-193-81-62-189-9200-connection-refused/85285/7 "2017-05-22T19:07:10Z")

</div>

HI Jasontedor

I have installed the ES 5 alpha version...i uninstalled that version and installed 2.2.1 version but the service is not running

---

<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 19, 2017, 7:07pm UTC](https://discuss.elastic.co/t/curl-7-failed-connect-to-193-81-62-189-9200-connection-refused/85285/8 "2017-06-19T19:07:12Z")

</div>

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