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