Localhost:9200 - Can’t reach this page

I'm new to Elasticsearch and just installed it on my dev pc. after the installation I tried to open it but get the following error:

Can’t reach this page
•Make sure the web address http://localhost:9200 is correct

I took all the default settings during installation. I even uninstalled and reinstalled it but still get the same results. I googled this but didn't find anything helpful to me. What's the next step in trouble shooting this?

Thank you

Hi,
have you checked this discussion? Unable to connect to Elasticsearch at http://localhost:9200

Please, have a look, and let us know if it turned out useful for your case

Yes I have but my issue is not related to curl or firewall. I don’t have or even know what curl is. The yml file has all the default settings and I compared it with someone else’s yml file and they are identical and the other person is
able to connect. Also, I’m not getting any logs yet. the log folder is empty.

It seems that the service is not starting correctly. Even though its set to start automatically, I have to manually start it. You can see in the screenshot that it says it's running, but you also see in the context menu that I have the options to start but 'stop' and 'restart' are disabled meaning its not actually started.

image

Any other ideas?

Thanks.

Best Regards,

George

Maybe can you tell us more about how you installed and started Elasticsearch? (e.g., docker? .tar package? windows installer? debian package?)

just a basic install by double clicking the msi
elasticsearch-6.6.1.msi

Can you get Elasticsearch to run (in a elevated cmd prompt window?)

  1. make sure you have the set the JAVA_HOME environment variable set to the JAVA install dir (ie: "C:\Program Files\Java\jdk1.8.0_202" or similar)

  2. Make sure you have the PATH to the JAVA\bin dir on you system PATH variable. (ie: "C:\Program Files\Java\jdk1.8.0_202\bin" or similar)

  3. After that reboot system to make sure environment variables are loaded

  4. navigate to the elasticsearch\6.6.1\bin directory by opening a administrator privileged Command window. (it only works for me in a admin cmd window)

  5. run the elasticsearch.bat

  6. leave that cmd window open, if you close it you will shutdown ElasticSearch.

If this does not run and load elasticseach then the service might no run either.
at least this will get ElasticSearch running manually, then the service could be remade/reinstalled.

Hope any of this helps, I'm new at ElasticSearch, just sharing what I can.

Hi Siradude,

I have set the environment variable as shown below.

However, item #5 below, I don’t have a file named “elasticsearch.bat”

Please advise. Thanks.

Best Regards,

George

My mistake
Its the elasticsearch.exe

But if you run it from the windows explorer, select run as asministrator.
Run it from an elevated command window

You will end up with a similar window, keep this open at all times... this is the elasticsearch service up and running manually

Also if im not mistaking
The JAVA_HOME environment variable
Should not include the bin folder

But in the SYSTEM PATH it should include the bin folder

To add the system path, look for PATH in the lower system variables window and click edit.... the add the new line in it

JAVA_HOME

SYSTEM PATH

Here's what I have:
image

but the next path gives me this error:

Now what?

Thanks.

You have too many entries (lines) in your path

The latest way to resolve this is to delete a line you don't need anymore.
I sure there's got to be something there you are not using.

Or for just testing... copy a line before deleting it....
You can always put it back if needed.

Actually there are none that I know of that I can remove. Most are system, for security, and many for SQL Server which I depend on 'every day'.

There must be a way around this.

I saw a line for plantronics which seems to be a headset or headphones?

Anyway here is a work arround

  1. Create a new system variable say 'NEWPATH'
  2. Assign the JAVA bin directory location to a new line in the NEWPATH variable made
  3. Now add %NEWPATH% to a new line in the system PATH variable

In a command windows (DOS PROMPT)
Type PATH and hit enter

You should now see the whole path variable listed

1 Like

Also you can replace long dir names by their short equivalent name (old DOS 8.3 format name like IIRC progra~1). That could save you some space.

Thanks to both of you! First I would like to say a special thanks for persisting in your answers here.

I'm afraid to do a lot of changes here because if I corrupt something, that would be a big problem. My customers depend on what I can deliver each day as does my family. That being said....

the max path length is 2047 and I'm up around 2400 so I have to do a lot of trimming for either of your solutions. Is there anyway around this such as using an extra long path in a bat file or something to make this work?

Sure,

In a batch file to run the elasticsearch.exe
you could add this line:

set PATH=%PATH%;C:\Program Files\JAVA\jdk1.8.0_112\bin

This will add the path to your current PATH ONLY while you run the program.

Hi Siradude,

Below is a screenshot of the output after using the recommendation above.

Now what do you recommend.
Thank you.

I don't think siradude meant for you to include elasticsearch.exe in the command.

Stop the Elastic service if running.

Just run
set PATH=%PATH%;C:\Program Files\JAVA\jdk1.8.0_112\bin

Then run the elasticsearch.exe and see if you get errors. If not, try to connect to the website.
If that works, quit the elasticsearch.exe and go start the service and see if you can still connect.

First lets try to solve the missing LOG dir.
in your C:\Program Files\Elastic\Elasticsearch\6.6.1
add a new folder named LOG

Your elasticRun.bat (just to call it differently than the .exe) should look like this.

set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_112
set Path=%PATH%;C:\Program Files\JAVA\jdk1.8.0_112\bin
Elasticsearch.exe

This .bat should be in your elasticsearch\6.6.1\bin folder

now make your Elasticsearch.exe always run as administrator by Right-Clicking the Elasticsearch.exe and select Properties, then select the top tab named SECURITY and check the box that says "Run this Program as Administrator", press APPLY the OK to close box

now running the .bat file should work.
Make sure the JAVA dir I used in the bat is the correct ver to your system.

I tested this in my system Windows 10 x64 and worked fine.

IF and after you get the Elasticsearch to run.... to close it just press CTRL-C in the open elasticsearch window

Hope this works for you.

This will only work as a manually started Elasticsearch, since the Set commands in the bat files will not be applied system wide, just in the window opened by the .bat file.

To get ElasticSearch to start automatically as a service you will need to solve your PATH problem permanently. Or the service might not start...

But first it will be good to see Elasticsearch start at least manually.

If problems still occur, try removing ALL Previous java versions on PC, then installing JAVA SE JDK with the lastest version and update the .bat file with the new JAVA dir values if any changed.

Page to download the latest JAVA SE JDK is
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Select the 64bit version (if your system is 64bit)
I'm using the Java SE Development Kit 8u202 windows x64 version.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.