Failed to connect to a default elasticsearch instance
zhaoyi0113 opened this issue · 3 comments
I have launched a default elasticsearch instance which is available on my local environment: http://localhost:9200
. Open this url on my browser I get below output:
{
"name" : "97Fvae4",
"cluster_name" : "elasticsearch_joey",
"cluster_uuid" : "NzKnO5UWRNW2AtqEr8CeAg",
"version" : {
"number" : "5.5.1",
"build_hash" : "19c13d0",
"build_date" : "2017-07-18T20:44:24.823Z",
"build_snapshot" : false,
"lucene_version" : "6.6.0"
},
"tagline" : "You Know, for Search"
}
but when I tried to use mirage
to connect to this instance. I get an error dialog saying:
It looks like your app name, username, password combination doesn't match. Check your url and appname and then connect it again.
My instance doesn't have any username and password. I launched it by running elasticsearch
on terminal. Why does it complain about username and password.
Hi @zhaoyi0113, sorry for the late response. If you haven't got it working yet - #13 or #18 should help.
You just need to update your ES config:
http.cors.allow-origin: "*"
http.cors.enabled: true
http.cors.allow-headers : "X-Requested-With, X-Auth-Token, Content-Type, Content-Length, Authorization"
http.cors.allow-methods: "OPTIONS, HEAD, GET, POST, PUT, DELETE"
http.cors.allow-credentials: true
I can confirm that this resolves the connection issue.
A small note: It is better from a security standpoint to only allow allow specific domains to have access to the cluster in the
http.cors.allow-origin
config value.
Yeah a better options is:
http.cors.allow-origin=http://localhost:1358,http://127.0.0.1:1358