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:
#
# 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