Merge pull request #9474 from AndreKR/export-hostname-for-config
Export the hostname as environment variable
This commit is contained in:
commit
a806314e2c
|
@ -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"
|
||||
|
|
|
@ -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 (
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue