# Cannot connect to elasticsearch server instance on port 9200

**URL:** https://discuss.elastic.co/t/cannot-connect-to-elasticsearch-server-instance-on-port-9200/257728
**Category:** Elasticsearch
**Created:** [December 5, 2020, 10:17am UTC](https://discuss.elastic.co/t/cannot-connect-to-elasticsearch-server-instance-on-port-9200/257728 "2020-12-05T10:17:31Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![freshlinx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/freshlinx/32/80313_2.png) [@freshlinx](https://discuss.elastic.co/u/freshlinx)
#### Post date: [December 5, 2020, 10:17am UTC](https://discuss.elastic.co/t/cannot-connect-to-elasticsearch-server-instance-on-port-9200/257728/1 "2020-12-05T10:17:31Z")

</div>

I have installed Elasticsearch and when I run a `curl localhost:9200` request on the machine it returns the expected response showing that Elasticsearch is running.

I have a Wordpress site on another server and I want to connect the Elasticpress plugin to my VPS Elasticsearch instance on port 9200 but the connection is refused. I have also tried connecting to the Elasticsearch server from my Mac Terminal using `curl 185.143.45.163:9200` and this also returns the error: `curl: (7) Failed to connect to 185.143.45.163 port 9200: Connection refused`. I have tried this both with the server's ufw firewall disabled and also with the firewall enabled with port 9200 open. Still no joy connecting.

Could you please advise me what I have done wrong with the configuration?

elasticsearch.yml:

```auto
#
# 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: 185.143.45.163
#
# 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 this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#
# For more information, consult the discovery and cluster formation 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

```

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [December 5, 2020, 1:36pm UTC](https://discuss.elastic.co/t/cannot-connect-to-elasticsearch-server-instance-on-port-9200/257728/2 "2020-12-05T13:36:17Z")

</div>

Welcome!

Could you please share the full logs?

---

<div class="post-metadata">

### Author: ![freshlinx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/freshlinx/32/80313_2.png) [@freshlinx](https://discuss.elastic.co/u/freshlinx)
#### Post date: [December 5, 2020, 2:16pm UTC](https://discuss.elastic.co/t/cannot-connect-to-elasticsearch-server-instance-on-port-9200/257728/3 "2020-12-05T14:16:26Z")

</div>

Hi

Sorry for my ignorance but there seems to be a lot of log files in /var/log/elasticsearch:

```auto
root@server:/var/log/elasticsearch# ll
total 504
drwxr-s--- 2 elasticsearch elasticsearch 4096 Dec 5 09:43 ./
drwxrwxr-x 9 root syslog 4096 Dec 4 21:51 ../
-rw-r--r-- 1 elasticsearch elasticsearch 105582 Dec 5 14:04 gc.log
-rw-r--r-- 1 elasticsearch elasticsearch 2040 Dec 4 21:54 gc.log.00
-rw-r--r-- 1 elasticsearch elasticsearch 53056 Dec 4 21:54 gc.log.01
-rw-r--r-- 1 elasticsearch elasticsearch 2040 Dec 4 21:55 gc.log.02
-rw-r--r-- 1 elasticsearch elasticsearch 114825 Dec 5 09:27 gc.log.03
-rw-r--r-- 1 elasticsearch elasticsearch 2040 Dec 5 09:27 gc.log.04
-rw-r--r-- 1 elasticsearch elasticsearch 43561 Dec 5 09:27 gc.log.05
-rw-r--r-- 1 elasticsearch elasticsearch 2040 Dec 5 09:28 gc.log.06
-rw-r--r-- 1 elasticsearch elasticsearch 47946 Dec 5 09:29 gc.log.07
-rw-r--r-- 1 elasticsearch elasticsearch 2040 Dec 5 09:30 gc.log.08
-rw-r--r-- 1 elasticsearch elasticsearch 4716 Dec 5 01:30 melloo-2020-12-04-1.json.gz
-rw-r--r-- 1 elasticsearch elasticsearch 4448 Dec 5 01:30 melloo-2020-12-04-1.log.gz
-rw-r--r-- 1 elasticsearch elasticsearch 32645 Dec 5 09:30 melloo.log
-rw-r--r-- 1 elasticsearch elasticsearch 0 Dec 4 21:54 melloo_audit.json
-rw-r--r-- 1 elasticsearch elasticsearch 0 Dec 4 21:54 melloo_deprecation.json
-rw-r--r-- 1 elasticsearch elasticsearch 0 Dec 4 21:54 melloo_deprecation.log
-rw-r--r-- 1 elasticsearch elasticsearch 0 Dec 4 21:54 melloo_index_indexing_slowlog.json
-rw-r--r-- 1 elasticsearch elasticsearch 0 Dec 4 21:54 melloo_index_indexing_slowlog.log
-rw-r--r-- 1 elasticsearch elasticsearch 0 Dec 4 21:54 melloo_index_search_slowlog.json
-rw-r--r-- 1 elasticsearch elasticsearch 0 Dec 4 21:54 melloo_index_search_slowlog.log
-rw-r--r-- 1 elasticsearch elasticsearch 60681 Dec 5 09:30 melloo_server.json

```

Which file should I check?

Many thanks for your help.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [December 8, 2020, 9:54pm UTC](https://discuss.elastic.co/t/cannot-connect-to-elasticsearch-server-instance-on-port-9200/257728/4 "2020-12-08T21:54:12Z")

</div>

`melloo.log` looks like the relevant one.

---

<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: [January 5, 2021, 9:54pm UTC](https://discuss.elastic.co/t/cannot-connect-to-elasticsearch-server-instance-on-port-9200/257728/5 "2021-01-05T21:54:32Z")

</div>

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