浏览代码

Export hostname as environment variable for plugin manager

In #9474, we exported the hostname in the bin/elasticsearch scripts so that it
could be used as a variable in the elasticsearch.yml file but did not do the same
for plugin manager. When using the hostname variable in elasticsearch.yml and
trying to use the plugin manager, initialization will fail because the property could
not be resolved. This change will allow the hostname to be resolved in the same
manner as the service scripts.

Closes #10902
jaymode 10 年之前
父节点
当前提交
f732900111
共有 2 个文件被更改,包括 4 次插入0 次删除
  1. 2 0
      bin/plugin
  2. 2 0
      bin/plugin.bat

+ 2 - 0
bin/plugin

@@ -103,4 +103,6 @@ if [ -e "$CONF_FILE" ]; then
   esac
   esac
 fi
 fi
 
 
+export HOSTNAME=`hostname -s`
+
 exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS -Xmx64m -Xms16m -Delasticsearch -Des.path.home="$ES_HOME" $properties -cp "$ES_HOME/lib/*" org.elasticsearch.plugins.PluginManager $args
 exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS -Xmx64m -Xms16m -Delasticsearch -Des.path.home="$ES_HOME" $properties -cp "$ES_HOME/lib/*" org.elasticsearch.plugins.PluginManager $args

+ 2 - 0
bin/plugin.bat

@@ -9,6 +9,8 @@ for %%I in ("%SCRIPT_DIR%..") do set ES_HOME=%%~dpfI
 
 
 TITLE Elasticsearch Plugin Manager ${project.version}
 TITLE Elasticsearch Plugin Manager ${project.version}
 
 
+SET HOSTNAME=%COMPUTERNAME%
+
 "%JAVA_HOME%\bin\java" %JAVA_OPTS% %ES_JAVA_OPTS% -Xmx64m -Xms16m -Des.path.home="%ES_HOME%" -cp "%ES_HOME%/lib/*;" "org.elasticsearch.plugins.PluginManager" %*
 "%JAVA_HOME%\bin\java" %JAVA_OPTS% %ES_JAVA_OPTS% -Xmx64m -Xms16m -Des.path.home="%ES_HOME%" -cp "%ES_HOME%/lib/*;" "org.elasticsearch.plugins.PluginManager" %*
 goto finally
 goto finally