# Failed to connect to server\_name:9200 connection refused

**URL:** <https://discuss.elastic.co/t/failed-to-connect-to-server-name-9200-connection-refused/199211>\
**Category:** Elasticsearch\
**Created:** [September 12, 2019, 9:22am UTC](https://discuss.elastic.co/t/failed-to-connect-to-server-name-9200-connection-refused/199211 "2019-09-12T09:22:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![prakashdev](https://avatars.discourse-cdn.com/v4/letter/p/59ef9b/32.png) [@prakashdev](https://discuss.elastic.co/u/prakashdev)\
**Post date:** [September 12, 2019, 9:22am UTC](https://discuss.elastic.co/t/failed-to-connect-to-server-name-9200-connection-refused/199211/1 "2019-09-12T09:22:28Z")

</div>

Hi,  
I am using elastic search 7.3.1 in windows server 2012. I am able to use all functionalities in the localhost, but I want to access es outside of the server. I am having the IP and port configuration in the elasticsearch.yml. But it still going to the localhost(127.0.0.1) only and also I gave access to the port 9200 in the firewall. So I am not sure why still it is pointing to localhost. Can someone help to fix this issue?

My elasticsearch.yml contains  
transport.host: serverip  
transport.tcp.port: 9300  
http.port: 9200  
network.host: serverip

Thanks

---

<div class="post-metadata">

**Author:** ![Emanuil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emanuil/32/36783_2.png) [@Emanuil](https://discuss.elastic.co/u/Emanuil)\
**Post date:** [September 12, 2019, 3:11pm UTC](https://discuss.elastic.co/t/failed-to-connect-to-server-name-9200-connection-refused/199211/2 "2019-09-12T15:11:48Z")

</div>

One possible reason is that you haven't restarted Elasticsearch after changing the config. Can you confirm you've restarted it?

If it still doesn't work, you can check what port it's really listening on. What does `netstat -an | findstr 9200` return? It should show `serverip:9200` if your config is working rather than 127.0.0.1.

Beyond that there could be a number of network configuration problems preventing you from accessing `serverip:9200` even though ES is actually listening on it.

---

<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:** [October 10, 2019, 3:11pm UTC](https://discuss.elastic.co/t/failed-to-connect-to-server-name-9200-connection-refused/199211/3 "2019-10-10T15:11:52Z")

</div>

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