arpit joshi
arpit joshi

Reputation: 2134

Connection Refused Elasticsearch 2.2

I have my ES 2.2 installed on my digital ocean droplet.My ES config file looks like below

# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
 network.host: "My Droplet Ip address"
 network.bind_host: 127.0.0.1
 http.publish_port: 9200
 http.port: 9200
#
# 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>
#
# http.cors.enabled: true
#http.cors.allow-origin: "*"

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

Now when I try to curl -XGET localhost:9200 it works properly but when I try to access my ES from remote "http://IpAddress:9200 is gives me CONNECTION REFUSED also curl -XGET IPAddress:9200 gives me CONNECTION REFUSED

This was working fine with ES 1.4 but with 2.X it has started to give me connection problems

Upvotes: 0

Views: 746

Answers (1)

Val
Val

Reputation: 217254

You have two solutions:

A. You can change network.bind_host to your public IP address

B. You remove network.bind_host and only keep network.host with your public IP address. The latter will set both network.bind_host and network.publish_host to your public IP address.

Also make sure to remove all spaces at the beginning of your lines.

Upvotes: 1

Related Questions