elasticsearch-kopf icon indicating copy to clipboard operation
elasticsearch-kopf copied to clipboard

Cannot connect to cluster from standalone kopf

Open petmakris opened this issue 9 years ago • 4 comments

Although I run an elastic search instance at localhost:9200, when served through grunt server it does not connect to my es cluster

[2016-03-10 13:25:50] Error executing request:
[2016-03-10 13:25:50] {"method":"GET","transformRequest":[null],"transformResponse":[null],"url":"http://localhost:9200/","data":{},"params":{},"headers":{"Accept":"application/json, text/plain, */*"}}
[2016-03-10 13:25:50] REST API output:

Althogh I can curl to localhost:9200 without problems.

[3] [pmakris:linuxbox] elasticsearch-kopf > curl -XGET http://localhost:9200
{
  "name" : "es10",
  "cluster_name" : "stressed",
  "version" : {
    "number" : "2.2.0",
    "build_hash" : "8ff36d139e16f8720f2947ef62c8167a888992fe",
    "build_timestamp" : "2016-01-27T13:32:39Z",
    "build_snapshot" : false,
    "lucene_version" : "5.4.1"
  },
  "tagline" : "You Know, for Search"
}

I am on branch 2.0

[3] [pmakris:linuxbox] elasticsearch-kopf > git branch -a
* 2.0
  develop
  master
  remotes/origin/0.90
  remotes/origin/1.0
  remotes/origin/2.0
  remotes/origin/HEAD -> origin/master
  remotes/origin/develop
  remotes/origin/gh-pages
  remotes/origin/master

petmakris avatar Mar 10 '16 12:03 petmakris

Same issue here, in Chrome Console I get messages about the CORS-Header not set even if I have enables CORS in Elasticserach and set allow-origin = *. Maybe this is an issue with the browser? I get the problem when serving kopf from y local filesystem, with grunt-server and also when serving it from an nginx vhost.

kerk1v avatar Apr 25 '16 08:04 kerk1v

I saw @petmakris was using grunt server. Are you also loaded in a server @kerk1v ? if so I might have the solution to both of your problems - I had this issue when running apache as a reverse proxy in front, even with the CORS header set in elastic it was not seen by chrome. I had to add the header manually using the Apache "set header" directive, it doesn't make a lot of sense I know, but you may find the equivalent helps.

up-town-down avatar Apr 26 '16 17:04 up-town-down

@petmakris @kerk1v is this still an issue?

@up-town-down thanks for taking care of this :)

lmenezes avatar Oct 08 '16 03:10 lmenezes

It was fine after I changed the reverse proxy to Nginx! Thanks!

kerk1v avatar Oct 08 '16 08:10 kerk1v