# Elastic search is running BUT I GOT curl: (7) Failed to connect to 127.0.0.1 port 9200: Connection refused

**URL:** https://discuss.elastic.co/t/elastic-search-is-running-but-i-got-curl-7-failed-to-connect-to-127-0-0-1-port-9200-connection-refused/158312
**Category:** Elasticsearch
**Created:** [November 27, 2018, 10:06am UTC](https://discuss.elastic.co/t/elastic-search-is-running-but-i-got-curl-7-failed-to-connect-to-127-0-0-1-port-9200-connection-refused/158312 "2018-11-27T10:06:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ceyhun\_yilmaz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ceyhun_yilmaz/32/50468_2.png) [@ceyhun\_yilmaz](https://discuss.elastic.co/u/ceyhun_yilmaz)
#### Post date: [November 27, 2018, 10:06am UTC](https://discuss.elastic.co/t/elastic-search-is-running-but-i-got-curl-7-failed-to-connect-to-127-0-0-1-port-9200-connection-refused/158312/1 "2018-11-27T10:06:31Z")

</div>

[root@ip-XXX-XX-XX-XXX elasticsearch]# sudo /etc/init.d/elasticsearch restart  
Stopping elasticsearch: [FAILED]  
Starting elasticsearch: [OK]  
[root@ip-XXX-XX-XX-XXXelasticsearch]# curl -XGET "127.0.0.1:9200"  
curl: (7) Failed to connect to 127.0.0.1 port 9200: Connection refused

---

<div class="post-metadata">

### Author: ![cy\_lir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cy_lir/32/37373_2.png) [@cy\_lir](https://discuss.elastic.co/u/cy_lir)
#### Post date: [November 27, 2018, 10:52am UTC](https://discuss.elastic.co/t/elastic-search-is-running-but-i-got-curl-7-failed-to-connect-to-127-0-0-1-port-9200-connection-refused/158312/2 "2018-11-27T10:52:05Z")

</div>

Hi,

What's your configuration file ? (/etc/elasticsearch/elasticsearch.yml I believe)  
How long have you waited after trying to curl elasticsearch ? Try to wait ~60sec before curling after starting it (curl 127.1:9200 is a shorter way to proceed btw)  
What's in your log files ?

---

<div class="post-metadata">

### Author: ![ceyhun\_yilmaz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ceyhun_yilmaz/32/50468_2.png) [@ceyhun\_yilmaz](https://discuss.elastic.co/u/ceyhun_yilmaz)
#### Post date: [November 27, 2018, 11:23am UTC](https://discuss.elastic.co/t/elastic-search-is-running-but-i-got-curl-7-failed-to-connect-to-127-0-0-1-port-9200-connection-refused/158312/3 "2018-11-27T11:23:30Z")

</div>

# Path to log files:

# 

path.logs: /var/log/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: 192.168.0.1

# 

# Set a custom port for HTTP:

# 

#http.port: 9200

# 

# For more information, consult the network module documentation.

# 

# --------------------------------- 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: ["host1", "host2"]

# 

# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):

# 

#discovery.zen.minimum\_master\_nodes:

# 

# For more information, consult the zen discovery module documentation.

# 

# ---------------------------------- Gateway -----------------------------------

# 

# Block initial recovery after a full cluster restart until N nodes are started:

# 

#gateway.recover\_after\_nodes: 3

# 

# For more information, consult the gateway module documentation.

# 

# ---------------------------------- Various -----------------------------------

# 

# Require explicit names when deleting indices:

# 

#action.destructive\_requires\_name: true

network.host: 0.0.0.0

http.port: 9200

this is configuration file i know it should be different but i only found this way to check and run for ES  
for log i found some log files but inside is to long should i put here ?

---

<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: [December 25, 2018, 11:23am UTC](https://discuss.elastic.co/t/elastic-search-is-running-but-i-got-curl-7-failed-to-connect-to-127-0-0-1-port-9200-connection-refused/158312/4 "2018-12-25T11:23:30Z")

</div>

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