# Creating cluster does not work with Windows Service

**URL:** <https://discuss.elastic.co/t/creating-cluster-does-not-work-with-windows-service/124297>\
**Category:** Elasticsearch\
**Created:** [March 16, 2018, 1:18pm UTC](https://discuss.elastic.co/t/creating-cluster-does-not-work-with-windows-service/124297 "2018-03-16T13:18:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![redX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redx/32/21864_2.png) [@redX](https://discuss.elastic.co/u/redX)\
**Post date:** [March 16, 2018, 1:18pm UTC](https://discuss.elastic.co/t/creating-cluster-does-not-work-with-windows-service/124297/1 "2018-03-16T13:18:20Z")

</div>

I'm try to set up a cluster between 2 windows machines.  
It works when I run the _elasticsearch.bat_ file from a command prompt.  
But it does not work when I run elasticsearch from a Windows Service.

What I did:

Install service:

> [...]\elasticsearch-6.2.2\bin\>elasticsearch-service.bat install  
> Installing service : "elasticsearch-service-x64"  
> Using JAVA\_HOME (64-bit): "[...]\Java\jdk1.8.0\_162"  
> -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=[...]\AppData\Local\Temp\elasticsearch;-XX:+HeapDumpOnOutOfMemoryError;-XX:+PrintGCDetails;-XX:+PrintGCDateStamps;-XX:+PrintTenuringDistribution;-XX:+PrintGCApplicationStoppedTime;-Xloggc:logs/gc.log;-XX:+UseGCLogFileRotation;-XX:NumberOfGCLogFiles=32;-XX:GCLogFileSize=64m  
> The service 'elasticsearch-service-x64' has been installed.

Run service:

> [...]\elasticsearch-6.2.2\bin\>elasticsearch-service.bat start  
> The service 'elasticsearch-service-x64' has been started

[http://localhost:9200](http://localhost:9200) shows:

```
   {
  "name" : "me",
  "cluster_name" : "my-cluster",
  "cluster_uuid" : "_na_",
  "version" : {
    "number" : "6.2.2",
    "build_hash" : "10b1edd",
    "build_date" : "2018-02-16T19:01:30.685723Z",
    "build_snapshot" : false,
    "lucene_version" : "7.2.1",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

```

Log shows:

> [2018-03-16T14:05:52,292][INFO][o.e.d.z.ZenDiscovery] [**me**] **failed to send join request to master** [{ **him** }{PWUIUF9dRdqXHA\_8PN\_TOg}{PFU3TkWGRoaPNbCQ8KOk4A}{10.201.132.134}{10.201.132.134:9300}], reason [RemoteTransportException[[**him**][10.201.132.134:9300][internal:discovery/zen/join]]; nested: ConnectTransportException[[**me**][10.201.130.238:9300] connect\_exception]; nested: IOException[Connection timed out: no further information: 10.201.130.238/10.201.130.238:9300]; nested: IOException[**Connection timed out: no further information**]; ]
> 
> [2018-03-16T14:06:34,301][INFO][o.e.d.z.ZenDiscovery] [**me**] **failed to send join request to master** [{ **him** }{PWUIUF9dRdqXHA\_8PN\_TOg}{PFU3TkWGRoaPNbCQ8KOk4A}{10.201.132.134}{10.201.132.134:9300}], reason [NodeDisconnectedException[[**him**][10.201.132.134:9300]**[internal:discovery/zen/join] disconnected**]]
> 
> [2018-03-16T14:06:37,302][WARN][o.e.d.z.ZenDiscovery] [**me**] **not enough master nodes discovered during pinging** (found [[Candidate{node={ **me** }{7DDri0WjQBmE\_0hjwDm54Q}{xTOCyScBRnOMjdbi7\_D0qA}{10.201.130.238}{10.201.130.238:9300}, clusterStateVersion=-1}]], but needed [2]), pinging again
> 
> [last massage repeats...]

Somebody an idea why it is working with a _bat_ file, but not with Windows Services?

ES Version: 6.2.2  
OS: Win 10  
Java: jdk1.8.0\_162 (_JAVA\_HOME_ has been created and added to _PATH_)  
elasticsearch.yml:

```
cluster.name: my-cluster
node.name: me
path.data: C:\ProgramFiles\elasticsearch-data
path.logs: C:\ProgramFiles\elasticsearch-logs
network.host: 0.0.0.0
discovery.zen.ping.unicast.hosts: ["him"]
discovery.zen.minimum_master_nodes: 2

```

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [March 20, 2018, 3:23am UTC](https://discuss.elastic.co/t/creating-cluster-does-not-work-with-windows-service/124297/2 "2018-03-20T03:23:09Z")

</div>

It is a network issue. Simply put, node with ip `10.201.132.134` can't connect to ip `10.201.130.238` at port `9300` (it gets a connection time out).

You need to check the connectivity between those hosts, maybe Windows Firewall is active?

---

<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:** [April 17, 2018, 3:23am UTC](https://discuss.elastic.co/t/creating-cluster-does-not-work-with-windows-service/124297/3 "2018-04-17T03:23:11Z")

</div>

Closed on April 17, 2018, 3:23am UTC

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