I have the same questions posted in https://github.com/elastic/elasticsearch/issues/21774
Unfortunately 21774 is closed and DOES NOT answer the question. It points us to documentation
https://www.elastic.co/guide/en/elasticsearch/reference/current/windows.html#windows-service
on HOW to change the values, but does not indicate WHAT appropriate values are. Also, WHY are there no reasonable defaults that run.
This doc on heap size doesn't help either.
https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
Also my JAVA_HOME is properly set as this person did to "fix" the same problem: https://github.com/elastic/elasticsearch/issues/18001
It's not clear exactly what your issue is, you should post a complete issue instead of having to surmise it by following links to other issues. I see your question:
Any suggestion on WHAT to set the heap size and thread stack size? The documentation link says nothing about appropriate values. Also, I wonder why good defaults are not set, or even where there is a discussion about these settings.
Heap size is up to your use case, stack size is configured by default now assuming a 64-bit platform. You can change these in the jvm.options file and the docs cover the case of setting the heap size.
Beyond this, Elastic provides a forum for asking general questions and instead prefers to use GitHub only for verified bug reports and feature requests. There's an active community there that should be able to help get an answer to any follow up questions. As such, I am going to close this.
maybe point me to that"active community"????
also, why doesn't the default configuration work on 64bit windows?
The issue is IDENTICAL to the one in the post i references. IDENTICAL. And that one was not solved anyway.
Also, the pages you references, I already looked at, and it WAS NOT HELPFUL. Telling me HOW to setup the settings is great,except that I know how to do that AND the settings that are in the manager MATCH the document, so clearly don't work.
https://www.elastic.co/guide/en/elasticsearch/reference/5.3/heap-size.html
maybe point me to that"active community"????
I did, I linked to the forum.
also, why doesn't the default configuration work on 64bit windows?
It does, I don't know why you think that it doesn't.
The issue is IDENTICAL to the one in the post i references. IDENTICAL. And that one was not solved anyway.
It is solved, that issue is from 5.0.0 when we did not ship with the thread stack size set by default and it's likely that the user only needed to set that via the jvm.options. We never heard back from the user after recommending this.
Also, the pages you references, I already looked at, and it WAS NOT HELPFUL. Telling me HOW to setup the settings is great,except that I know how to do that AND the settings that are in the manager MATCH the document, so clearly don't work.
Again, I encourage you to open a topic on the forum. We can probably give you some pointers, including some logs to look at. Please though, I implore you, stop saying your issue is identical to another one that is likely on a different version of the software then you're on now (and if you are on the same version, please, upgrade, we fix bugs all the time). Every computer is different, every environment is different, there are so many moving parts here so let's just get a complete description of the problem that you're seeing and the community will try to help you.
Above all, I'm sorry that you're experiencing frustration. Let's approach this patiently and without excitement and we can probably figure it out.
Please don't tell me to not get excited. I've been writing software for 25 years, and I already burned an entire day before even writing here.
@scottf your tone of voice is not acceptable here and will definitely not help to get someone to look at your issue faster. The amount of years you spent developing software is totally not relevant here.
it doesn't describe the WHAT and the WHY of those settings.
Memory settings of ES is a more complicated issue and is not windows specific. There are resources on that online. A quick search gets you this and this.
That said, thank you for the more detailed information. @Mpdreamz can you take this one and see what went wrong with the starting the service? I must say those error messages are cryptic for me too. I'm reopening the issue pending investigation.
Happy too, on vacation now though so will park it until next week.
@scottf Would you please also provide the output of:
(or the most recent ones as the date will have rolled over if you attempt to start Elasticsearch again)?
Also, can you please execute elasticsearch-service manager
and show the contents of the Java tab, provide the value of echo %JAVA_HOME%
from the command prompt, and the value of JAVA_HOME
from the system environment variables
I made a clean install of 5.3.0 and ran elasticsearch-service install
then elasticsearch-service start
.
I see the log shows a possible JAVA_HOME issue, so maybe the way the install runs it doesn't pickup JAVA_HOME and the path to the dll correctly. I verified that it is in fact set. But notice I had to quote the path for the dir command, since "Program Files" contains a space. This result matches what I have in the Windows Environment Settings
C:\programs\elasticsearch-5.3.0\bin>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.8.0_131
and
C:\programs\elasticsearch-5.3.0\bin>dir "%JAVA_HOME%\jre\bin\server\jvm.dll"
Volume in drive C is Windoze
Volume Serial Number is 0EBF-E42B
Directory of C:\Program Files\Java\jdk1.8.0_131\jre\bin\server
04/19/2017 09:11 AM 8,802,848 jvm.dll
1 File(s) 8,802,848 bytes
0 Dir(s) 511,035,289,600 bytes free
stdout
2017-04-20 12:49:00 Commons Daemon procrun stdout initialized
service
[2017-04-20 12:48:47] [info] [17404] Commons Daemon procrun (1.0.15.0 64-bit) started
[2017-04-20 12:48:47] [info] [17404] Service elasticsearch-service-x64 name Elasticsearch 5.3.0 (elasticsearch-service-x64)
[2017-04-20 12:48:47] [info] [17404] Service 'elasticsearch-service-x64' installed
[2017-04-20 12:48:47] [info] [17404] Commons Daemon procrun finished
[2017-04-20 12:48:59] [info] [ 8880] Commons Daemon procrun (1.0.15.0 64-bit) started
[2017-04-20 12:49:00] [info] [ 8880] Starting service 'elasticsearch-service-x64' ...
[2017-04-20 12:49:00] [info] [ 4112] Commons Daemon procrun (1.0.15.0 64-bit) started
[2017-04-20 12:49:00] [info] [ 4112] Running 'elasticsearch-service-x64' Service...
[2017-04-20 12:49:00] [info] [ 7800] Starting service...
[2017-04-20 12:49:00] [error] [ 7800] Failed creating java %JAVA_HOME%\jre\bin\server\jvm.dll
[2017-04-20 12:49:00] [error] [ 7800] The system cannot find the path specified.
[2017-04-20 12:49:00] [error] [ 7800] ServiceStart returned 1
[2017-04-20 12:49:00] [error] [ 7800] The system cannot find the path specified.
[2017-04-20 12:49:00] [info] [ 4112] Run service finished.
[2017-04-20 12:49:00] [info] [ 4112] Commons Daemon procrun finished
[2017-04-20 12:49:02] [error] [ 8880] Failed to start 'elasticsearch-service-x64' service
[2017-04-20 12:49:02] [error] [ 8880] The data area passed to a system call is too small.
[2017-04-20 12:49:02] [info] [ 8880] Start service finished.
[2017-04-20 12:49:02] [error] [ 8880] Commons Daemon procrun failed with exit value: 5 (Failed to start service)
[2017-04-20 12:49:02] [error] [ 8880] The data area passed to a system call is too small.
stderr
2017-04-20 12:49:00 Commons Daemon procrun stderr initialized
The data area passed to a system call is too small.
Failed to start service
Here is the manager.
The jvm line does not have quotes, but I don't know if it matters.
%JAVA_HOME%\jre\bin\server\jvm.dll
The full classpath is this
C:\programs\elasticsearch-5.3.0/lib/elasticsearch-5.3.0.jar;C:\programs\elasticsearch-5.3.0/lib/*
I notice that there are some forward slashes. This is probably fine since the jvm is what's looking at this, but who knows.
The full options are
-Xmx2g
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
-XX:+DisableExplicitGC
-XX:+AlwaysPreTouch
-Xss1m
-Djava.awt.headless=true
-Dfile.encoding=UTF-8
-Djna.nosys=true
-Djdk.io.permissionsUseCanonicalPath=true
-Dio.netty.noUnsafe=true
-Dio.netty.noKeySetOptimization=true
-Dio.netty.recycler.maxCapacityPerThread=0
-Dlog4j.shutdownHookEnabled=false
-Dlog4j2.disable.jmx=true
-Dlog4j.skipJansi=true
-XX:+HeapDumpOnOutOfMemoryError
-Delasticsearch
-Des.path.home=C:\programs\elasticsearch-5.3.0
-Des.default.path.logs=C:\programs\elasticsearch-5.3.0\logs
-Des.default.path.data=C:\programs\elasticsearch-5.3.0\data
-Des.default.path.conf=C:\programs\elasticsearch-5.3.0\config
Can you please check that the system has the environment variable JAVA_HOME
set by going to System Properties
-> Environment Variables
-> System Variables
. I can reproduce your exact issue if JAVA_HOME
is not set here. Please set it and point it to C:\Program Files\Java\jdk1.8.0_131
and verify that it fixes your issue?
I verified that it is in fact set
I already noted that I checked it. Plus it's windows, and I didn't set it manually in my command window so this demonstrates it:
C:\programs\elasticsearch-5.3.0\bin>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.8.0_131
@scottf That's the user variables, not the system variables. The command prompt output would not show what I'm looking for, and neither does your screenshot.
Moving the property to the "system" area did the trick, the service started.
Either the java installer put it in "user" properties or I did, so it does not go automatically to the system area. Just something to note I suppose.
I'm glad that you got it sorted out.
Just something to note I suppose.
I will see if there is room for improvement in the docs here.
I will see if there is room for improvement in the docs here.
I opened #24260.
Thanks to scott's "Moving the property to the "system" area did the trick, the service started." valuable information. I had same problem making JAVA_HOME as system variable resolved the issue.
"Moving the property to the "system" area did the trick"
How did you move the property to the system area? Please point me to the right direction. I have been having the same issue for about 3 days now
Note, I had a similar problem. Elasticsearch works fine when running from the console. However, running from a service was failing. I have to use Elasticsearch 2.4.1 with a private JRE not a system JRE. I thought the problem was that. So I tried using a system JRE (setting the JAVA_HOME, etc). However, the problem persisted. One error that led me to a solution was the following:
Exception in thread "main" tion: path.home is not configured" in the stderr log file.
I debugged the service.bat execution and noticed a line where it was setting the %ES_PARAMS% variable. For some reason, none of the -D options set in this variable was showing in the Java options of the Windows service. Using the "service manager" commaind, I added the -Des.path.home and setting it to the Elasticsearch folder in the Java Options panel to fix the issue.
Hi all,
I have downloaded and installed elasticsearch and when I hit localhost:9200 on the browser it is giving the result but when i try to run it from the command prompt, I am getting some error in main thread. I am attaching the screenshot of the issue. Kindly tell me what mistake I am doing.
@vivekranjan92 Please ask this question on discuss.elastic.co where we can give a better support.
Please don't post images there but formatted text as it will be more readable and searchable.
About your problem, you already have one node running locally. If you have more questions, please ask on discuss.
Most helpful comment
@scottf That's the user variables, not the system variables. The command prompt output would not show what I'm looking for, and neither does your screenshot.