Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to connect to a default elasticsearch instance #46

Closed
zhaoyi0113 opened this issue Aug 30, 2017 · 3 comments
Closed

Failed to connect to a default elasticsearch instance #46

zhaoyi0113 opened this issue Aug 30, 2017 · 3 comments

Comments

@zhaoyi0113
Copy link

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.

@metagrover
Copy link
Contributor

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

@siddharthlatest
Copy link
Member

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.

@mikemaccana
Copy link

Yeah a better options is:
http.cors.allow-origin=http://localhost:1358,http://127.0.0.1:1358

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants