# Cannot connect to localhost:9200/

**URL:** https://discuss.elastic.co/t/cannot-connect-to-localhost-9200/138158
**Category:** Elasticsearch
**Created:** [July 2, 2018, 9:22am UTC](https://discuss.elastic.co/t/cannot-connect-to-localhost-9200/138158 "2018-07-02T09:22:49Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Sonny\_Berggreen\_Mads](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sonny_berggreen_mads/32/32854_2.png) [@Sonny\_Berggreen\_Mads](https://discuss.elastic.co/u/Sonny_Berggreen_Mads)
#### Post date: [July 2, 2018, 9:22am UTC](https://discuss.elastic.co/t/cannot-connect-to-localhost-9200/138158/1 "2018-07-02T09:22:49Z")

</div>

Hi,

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

Thanks.

Best  
Sonny

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [July 2, 2018, 10:37am UTC](https://discuss.elastic.co/t/cannot-connect-to-localhost-9200/138158/2 "2018-07-02T10:37:48Z")

</div>

I can.

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

---

<div class="post-metadata">

### Author: ![Sonny\_Berggreen\_Mads](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sonny_berggreen_mads/32/32854_2.png) [@Sonny\_Berggreen\_Mads](https://discuss.elastic.co/u/Sonny_Berggreen_Mads)
#### Post date: [July 2, 2018, 11:47am UTC](https://discuss.elastic.co/t/cannot-connect-to-localhost-9200/138158/3 "2018-07-02T11:47:16Z")

</div>

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/](http://localhost:9200/) which gave this output:

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

- curl [http://localhost:9200/](http://localhost:9200/)
- 

```auto
  + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
  + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

```

Do you know what I'm doing wrong?

---

<div class="post-metadata">

### Author: ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)
#### Post date: [July 2, 2018, 11:51am UTC](https://discuss.elastic.co/t/cannot-connect-to-localhost-9200/138158/4 "2018-07-02T11:51:46Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Sonny\_Berggreen\_Mads](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sonny_berggreen_mads/32/32854_2.png) [@Sonny\_Berggreen\_Mads](https://discuss.elastic.co/u/Sonny_Berggreen_Mads)
#### Post date: [July 2, 2018, 11:55am UTC](https://discuss.elastic.co/t/cannot-connect-to-localhost-9200/138158/5 "2018-07-02T11:55:32Z")

</div>

No more details than that.

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

- Invoke-RestMethod [http://localhost:9200](http://localhost:9200)
- 

```auto
  + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
  + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
```

---

<div class="post-metadata">

### Author: ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)
#### Post date: [July 2, 2018, 12:02pm UTC](https://discuss.elastic.co/t/cannot-connect-to-localhost-9200/138158/6 "2018-07-02T12:02:00Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Sonny\_Berggreen\_Mads](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sonny_berggreen_mads/32/32854_2.png) [@Sonny\_Berggreen\_Mads](https://discuss.elastic.co/u/Sonny_Berggreen_Mads)
#### Post date: [July 2, 2018, 12:07pm UTC](https://discuss.elastic.co/t/cannot-connect-to-localhost-9200/138158/7 "2018-07-02T12:07:28Z")

</div>

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

---

<div class="post-metadata">

### Author: ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)
#### Post date: [July 2, 2018, 12:21pm UTC](https://discuss.elastic.co/t/cannot-connect-to-localhost-9200/138158/8 "2018-07-02T12:21:56Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Sonny\_Berggreen\_Mads](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sonny_berggreen_mads/32/32854_2.png) [@Sonny\_Berggreen\_Mads](https://discuss.elastic.co/u/Sonny_Berggreen_Mads)
#### Post date: [July 2, 2018, 12:31pm UTC](https://discuss.elastic.co/t/cannot-connect-to-localhost-9200/138158/9 "2018-07-02T12:31:03Z")

</div>

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  
...

---

<div class="post-metadata">

### Author: ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)
#### Post date: [July 2, 2018, 12:38pm UTC](https://discuss.elastic.co/t/cannot-connect-to-localhost-9200/138158/10 "2018-07-02T12:38:55Z")

</div>

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

> [@Sonny\_Berggreen\_Mads](#):
>
> 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

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.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 30, 2018, 12:39pm UTC](https://discuss.elastic.co/t/cannot-connect-to-localhost-9200/138158/11 "2018-07-30T12:39:01Z")

</div>

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