Starting up, the log shows a warning (~ "JVM should be configured with
-server flag")
So I tried exporting ES_JAVA_OPTS="-server", echo $ES_JAVA_OPTS shows
"-server"
But to no avail ...
I hardcoded the option into elasticsearch.in.sh to see if it works at all -
which it does.
So where to put this setting (and others)? In the YAML configuration file I
didn't find anything related to the JVM like min/max ram size and the like
... Documentation didn't help, either.
I'd really appreciate keeping these settings in one place like the YAML,
this should be easily possible, shouldn't it?
if you need to add the server flag to the JVM, what Java JRE/JDK have you
installed?
I recommend installing the latest Oracle Java 7 JDK, there is no such thing
like "server VM" anymore. Please note that Java 6 is set end-of-life by
Oracle.
The reason the JVM startup options can not be intermixed with the
elasticsearch config are the separate startup phases each Java app must
pass. The JVM options are early initialization parameters and are effective
before any Java app code is active. Such parameters can be shared between
Java apps. Then, after the JVM has started and Elasticsearch jars have been
loaded und bootstrapped, the YAML parser loads the ES
config/elasticsearch.yml und continues the startup process which is
specific to ES.
plus, on the same page, that you can control the JVM from inside the
elasticsearch.conf ("Note, passing JVM level configuration (such as -X
parameters) should be set within the elasticsearch.conf file.")
which is incorrect as you're saying!? Or is this a file also used by the
shell script/service wrapper or the like?
So whom to believe - and where to put the JVM settings (-server flag for
Java 6 and others like mem limits as well) as using ES_JAVA_OPTS didn't
work?
for best out-of-the-box Java experience, I always recommend to install
the latest aligned runtime environments of OpenJDK 7 = Oracle Java 7. That
is independent of Elasticsearch. In Java 7, the preconfigured JVM settings
for "client VM" and "server VM" are so close, there is no longer a
substantial difference, and there is no "-server" flag warning anymore.
in February 2013, Oracle will retire Java 6. Sooner or later you must
transition to Java 7, so why not now. That is the reason I do not recommend
Java 6.
The elasticsearch.conf file is part of the service
wrapper https://github.com/elasticsearch/elasticsearch-servicewrapper I
wasn't aware you want to make use of the service wrapper, because it is an
add-on. Of course I recommend using it, I use it for myself on my RHEL
servers for automatic starting up the ES node when the server is booting.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.