Cannot connect to localhost:9200/

Hi,

I'm not able to connect to localhost:9200/, can anybody help me?

Thanks.

Best
Sonny

I can.

So question is: what did you do? What are the logs?

I'm new to this, so please bear with me.

Here is what i did:

  1. I ran the "bin\elasticsearch.bat" in Command Prompt
  2. I opened and typed: curl http://localhost:9200/ which gave this output:

PS C:\Users\sbm> curl http://localhost:9200/
curl : Unable to connect to the remote server
At line:1 char:1

  • curl http://localhost:9200/
  •   + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
      + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
    
    
    

Do you know what I'm doing wrong?

Are there any more details from the PowerShell exception? As an exercise, do you get the same response using the iwr alias for Invoke-WebRequest as opposed to the curl alias?

No more details than that.

yes, then I get this:
PS C:\Users\sbm> Invoke-RestMethod http://localhost:9200
Invoke-RestMethod : Unable to connect to the remote server
At line:1 char:1

  • Invoke-RestMethod http://localhost:9200
  •   + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
      + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Is there anything in the output where you have elastisearch.bat running?

I'm not sure? - the Command Promt is open and I have ran the elastisearch.bat

Elasticsearch will write out log messages to standard output by default when started with Elasticsearch.bat. Can you show the log messages written out?

I'm not sure how to find that - is that the text that shows up on the Command Prompt when in running the Elasticsearch.bat? In that case:

[2018-07-02T13:45:11,453][INFO ][o.e.n.Node ] [] initializing ...
[2018-07-02T13:45:11,500][INFO ][o.e.e.NodeEnvironment ] [SjRaHTL] using [1] data paths, mounts [[System (C:)]], net usable_space [370.6gb], net total_space [475.7gb], types [NTFS]
[2018-07-02T13:45:11,500][INFO ][o.e.e.NodeEnvironment ] [SjRaHTL] heap size [998.4mb], compressed ordinary object pointers [unknown]
[2018-07-02T13:45:11,500][INFO ][o.e.n.Node ] [SjRaHTL] node name derived from node ID [SjRaHTL1RHm_s4bH6m2cGw]; set [node.name] to override
[2018-07-02T13:45:11,500][INFO ][o.e.n.Node ] [SjRaHTL] version[6.3.0], pid[1112], build[default/zip/424e937/2018-06-11T23:38:03.357887Z], OS[Windows 10/10.0/x86], JVM[Oracle Corporation/Java HotSpot(TM) Client VM/1.8.0_171/25.171-b11]
[2018-07-02T13:45:11,500][INFO ][o.e.n.Node ] [SjRaHTL] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=C:\Users\sbm\AppData\Local\Temp\elasticsearch, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Delasticsearch, -Des.path.home=C:\Users\sbm\Desktop\New\elasticsearch-6.3.0, -Des.path.conf=C:\Users\sbm\Desktop\New\elasticsearch-6.3.0\config, -Des.distribution.flavor=default, -Des.distribution.type=zip]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [aggs-matrix-stats]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [analysis-common]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [ingest-common]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [lang-expression]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [lang-mustache]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [lang-painless]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [mapper-extras]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [parent-join]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [percolator]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [rank-eval]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [reindex]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [repository-url]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [transport-netty4]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [tribe]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [x-pack-core]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [x-pack-deprecation]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [x-pack-graph]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [x-pack-logstash]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [x-pack-ml]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [x-pack-monitoring]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [x-pack-rollup]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [x-pack-security]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [x-pack-sql]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [x-pack-upgrade]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] loaded module [x-pack-watcher]
[2018-07-02T13:45:13,946][INFO ][o.e.p.PluginsService ] [SjRaHTL] no plugins loaded
[2018-07-02T13:45:18,668][INFO ][o.e.x.s.a.s.FileRolesStore] [SjRaHTL] parsed [0] roles from file [C:\Users\sbm\Desktop\New\elasticsearch-6.3.0\config\roles.yml]
[2018-07-02T13:45:19,043][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: ElasticsearchException[X-Pack is not supported and Machine Learning is not available for [windows-x86]; you can use the other X-Pack features (unsupported) by setting xpack.ml.enabled: false in elasticsearch.yml]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:140) ~[elasticsearch-6.3.0.jar:6.3.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:127) ~[elasticsearch-6.3.0.jar:6.3.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.3.0.jar:6.3.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.3.0.jar:6.3.0]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.3.0.jar:6.3.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.3.0.jar:6.3.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:86) ~[elasticsearch-6.3.0.jar:6.3.0]
Caused by: org.elasticsearch.ElasticsearchException: X-Pack is not supported and Machine Learning is not available for [windows-x86]; you can use the other X-Pack features (unsupported) by setting xpack.ml.enabled: false in elasticsearch.yml
at
...

Yep, that's it. Here's the problem

It looks like you're running on 32-bit Windows. The log message indicates what you can do to disable X-pack Machine Learning but still use other features unsupported. The elasticsearch.yml file can be found in the config directory and you'll need to restart Elasticsearch for the change to take effect.

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