Pass ES_JAVA_OPTS to JVM for plugins script

This commit adds support for ES_JAVA_OPTS to the elasticsearch-plugin
script.

Relates #18140
This commit is contained in:
Jason Tedor 2016-05-04 12:48:39 -04:00
parent 34d90b041f
commit 4c6cf7ee88
3 changed files with 14 additions and 2 deletions

View File

@ -110,4 +110,4 @@ fi
HOSTNAME=`hostname | cut -d. -f1`
export HOSTNAME
eval "\"$JAVA\"" -client -Delasticsearch -Des.path.home="\"$ES_HOME\"" $properties -cp "\"$ES_HOME/lib/*\"" org.elasticsearch.plugins.PluginCli $args
eval "\"$JAVA\"" "$ES_JAVA_OPTS" -client -Delasticsearch -Des.path.home="\"$ES_HOME\"" $properties -cp "\"$ES_HOME/lib/*\"" org.elasticsearch.plugins.PluginCli $args

View File

@ -48,7 +48,7 @@ GOTO loop
SET HOSTNAME=%COMPUTERNAME%
"%JAVA_HOME%\bin\java" -client -Des.path.home="%ES_HOME%" !properties! -cp "%ES_HOME%/lib/*;" "org.elasticsearch.plugins.PluginCli" !args!
"%JAVA_HOME%\bin\java" %ES_JAVA_OPTS% -client -Des.path.home="%ES_HOME%" !properties! -cp "%ES_HOME%/lib/*;" "org.elasticsearch.plugins.PluginCli" !args!
goto finally

View File

@ -476,3 +476,15 @@ fi
# restore JAVA_HOME
export JAVA_HOME=$java_home
}
@test "[$GROUP] test ES_JAVA_OPTS" {
# preserve ES_JAVA_OPTS
local es_java_opts=$ES_JAVA_OPTS
export ES_JAVA_OPTS="-XX:+PrintFlagsFinal"
# this will fail if ES_JAVA_OPTS is not passed through
"$ESHOME/bin/elasticsearch-plugin" list | grep MaxHeapSize
# restore ES_JAVA_OPTS
export ES_JAVA_OPTS=$es_java_opts
}