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 13 additions and 0 deletions

View File

@ -148,6 +148,8 @@ launch_service()
LANG=en_US.UTF-8 LANG=en_US.UTF-8
LC_ALL=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. # 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 if [ "x$daemonized" = "x" ]; then
es_parms="$es_parms -Des.foreground=yes" es_parms="$es_parms -Des.foreground=yes"

Binary file not shown.

View File

@ -208,6 +208,17 @@ node:
name: <NAME OF YOUR 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 Internally, all settings are collapsed into "namespaced" settings. For
example, the above gets collapsed into `node.name`. This means that example, the above gets collapsed into `node.name`. This means that
its easy to support other configuration formats, for example, its easy to support other configuration formats, for example,