Merge pull request #9474 from AndreKR/export-hostname-for-config

Export the hostname as environment variable
This commit is contained in:
Tanguy Leroux 2015-04-17 10:17:55 +02:00
commit a806314e2c
3 changed files with 15 additions and 0 deletions

View File

@ -148,6 +148,8 @@ launch_service()
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
export HOSTNAME=`hostname -s`
# The es-foreground option will tell Elasticsearch not to close stdout/stderr, but it's up to us not to daemonize.
if [ "x$daemonized" = "x" ]; then
es_parms="$es_parms -Des.foreground=yes"

View File

@ -33,6 +33,8 @@ FOR /F "usebackq tokens=1* delims= " %%A IN (!params!) DO (
)
)
SET HOSTNAME=%COMPUTERNAME%
CALL "%~dp0elasticsearch.in.bat"
IF ERRORLEVEL 1 (
IF NOT DEFINED nopauseonerror (

View File

@ -208,6 +208,17 @@ node:
name: <NAME OF YOUR NODE>
--------------------------------------------------
The hostname of the machine is provided in an
environment variable, so you can set the node name
to the hostname, if on that machine you only run _a
single elasticsearch node_ for that cluster.
[source,yaml]
--------------------------------------------------
node:
name: ${HOSTNAME}
--------------------------------------------------
Internally, all settings are collapsed into "namespaced" settings. For
example, the above gets collapsed into `node.name`. This means that
its easy to support other configuration formats, for example,