ES-head plugin does not work through browser

I am trying to run the elasticSearch-head plugin on my server, but I can just access it through the server terminal. If I try to access it through a browser, it will try to connect until the message “This page is unavailable” appears.

If I type "curl -v http://localhost:9200/_plugin/head/" in the terminal, I get

 * Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 9200 (#0) > GET /_plugin/head/ HTTP/1.1 > User-Agent: curl/7.36.0 > Host: localhost:9200 > Accept: */* > < HTTP/1.1 200 OK < Content-Type: text/html < Content-Length: 1077 < <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>elasticsearch-head</title> <link rel="stylesheet" href="dist/base/reset.css"> <link rel="stylesheet" href="dist/vendor.css"> <link rel="stylesheet" href="dist/app.css"> <script src="dist/i18n.js" data-baseDir="dist/lang" data-langs="en,fr,pt"></script> <script src="dist/vendor.js"></script> <script src="dist/app.js"></script> <script> window.onload = function() { if(location.href.contains("/_plugin/")) { var base_uri = location.href.replace(/_plugin\/.*/, ''); } var args = location.search.substring(1).split("&").reduce(function(r, p) { r[decodeURIComponent(p.split("=")[0])] = decodeURIComponent(p.split("=")[1]); return r; }, {}); new app.App("body", { id: "es", base_uri: args["base_uri"] || base_uri, auth_user : args["auth_user"] || "", auth_password : args["auth_password"], dashboard: args["dashboard"] }); }; </script> <link rel="icon" href="dist/base/favicon.png" type="image/png"> </head> <body></body> </html> * Connection #0 to host localhost left intact 

But if I go to the browser and I type: XXXX: 9200 / _plugin / head / it just doesn't show anything.

What is missing here? Any guess?

Thanks in advance.

+5
source share
5 answers

I encountered the same problem after I found for several hours that you need to restart your elasticsearch lots, but before you do this, make sure you complete elasticsearch search by running

 curl -XPOST localhost:9200/_shutdown 

Then run your elastics search with

 sudo ./elasticsearch 
+1
source

I found that (at least with versions 2.x, I cannot speak earlier) you do not need to give up elasticsearch after installing the plugin. The problem for me was that for some reason I could not connect through localhost:9200 , but I could through my network IP address. The way I was able to figure this out was through netstat -na | grep 9200 netstat -na | grep 9200 .

Again, why he decided to do this, I can’t confirm - I have mapped my /etc/hosts to my desktop, and the desktop has no problems connecting via localhost .

Another thing I had to do was change the transport address from localhost to my network IP, or I got a NoSuchNodeException at startup.

+1
source

I ran into the same problem. I used chrome. Chrome developer tools pointed me to this error

XMLHttpRequest cannot load http: // localhost: 9200 / _cluster / health . The requested resource does not have an Access-Control-Allow-Origin header. Therefore, the original "null" is not allowed.

One of the suggested answers in stackoverflow for the above error was to use the bottom chrome extension to enable and disable CORS as needed. When this extension was included, the elastic head began to work in chrome.

https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi/related?hl=en-US

+1
source

It looks like you need to create a tunnel to access it on your local computer - you can do this with putty.

http://howto.ccs.neu.edu/howto/windows/ssh-port-tunneling-with-putty/

0
source

Check the proxy settings for the browser. You probably don't want to go through a proxy server for local requests. Also check the firewall settings on the server and connecting clients. You did not indicate which browser and platform you are using, so it is difficult to provide additional assistance.

0
source

Source: https://habr.com/ru/post/1201879/


All Articles