Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ElasticHQ: Unable to Connect to Server! Received Status Code: 0

i am getting below error when i was trying to connect to Elastic HQ. Local instance of elasticsearch is running. Elastic search version is 2.0.0.

in the elasticsearch.yml, http.cors.enabled: true is set

Received the following error:

ElasticHQ: Unable to Connect to Server! Received Status Code: 0. A status code of 0, could mean the host is unreacheable or nothing is listening on the given port. Did you enable CORS?

am i missing something?

Elasticsearch Configuration

    # ---------------------------------- Network -----------------------------------
    #
    # Set the bind adress to a specific IP (IPv4 or IPv6):
    #
    network.host: 127.0.0.1
    #
    # Set a custom port for HTTP:
    #
    http.port: 9200
    
    http.cors.enabled: true

Browser Console Message

The browser console says 

Inside ErrorMessage
all.min.js:12 http://127.0.0.1:9200
all.min.js:12 Inside ClusterHealth
all.min.js:12 Inside ClusterState
all.min.js:12 Inside IndexStatsModel
all.min.js:12 Inside NodeList
index.html:1 XMLHttpRequest cannot load http://127.0.0.1:9200/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
all.min.js:12 Failed to Connect on Ping!
like image 537
Selvakumar Esra Avatar asked Nov 15 '15 16:11

Selvakumar Esra


1 Answers

It works now!. i have to add another entry in elasticsearch.yml

http.cors.allow-origin: "*"
http.cors.enabled: true 
node.master: true
like image 118
Selvakumar Esra Avatar answered Oct 14 '22 15:10

Selvakumar Esra