You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by cw...@apache.org on 2019/12/13 23:36:18 UTC

[incubator-druid] branch 0.17.0-incubating updated: allow druid.host to be undefined to use canonical hostname (#9019) (#9034)

This is an automated email from the ASF dual-hosted git repository.

cwylie pushed a commit to branch 0.17.0-incubating
in repository https://gitbox.apache.org/repos/asf/incubator-druid.git


The following commit(s) were added to refs/heads/0.17.0-incubating by this push:
     new 974ae79  allow druid.host to be undefined to use canonical hostname (#9019) (#9034)
974ae79 is described below

commit 974ae79ca38005e988a0a60a6a6d1a58d5a4fdbc
Author: Clint Wylie <cw...@apache.org>
AuthorDate: Fri Dec 13 15:36:10 2019 -0800

    allow druid.host to be undefined to use canonical hostname (#9019) (#9034)
    
    It is currently not possible to unset the druid.host property in the docker image to let Druid default to the canonical hostname. It always gets set to the container's IP address. Passing the override environment variable druid_host= unfortunately does not solve the problem, as this gets interpreted as empty string and does not let the default kick in.
    
    This change adds the option to pass DRUID_SET_HOST=0 as environment variable to disable the default behavior, and allows passing a common runtime.properties file without druid.host.
---
 distribution/docker/druid.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/distribution/docker/druid.sh b/distribution/docker/druid.sh
index c60b62a..76ffd1b 100755
--- a/distribution/docker/druid.sh
+++ b/distribution/docker/druid.sh
@@ -92,7 +92,11 @@ then
     setKey _common druid.zk.service.host "${ZOOKEEPER}"
 fi
 
-setKey $SERVICE druid.host $(ip r get 1 | awk '{print $7;exit}')
+DRUID_SET_HOST=${DRUID_SET_HOST:-1}
+if [ "${DRUID_SET_HOST}" = "1" ]
+then
+    setKey $SERVICE druid.host $(ip r get 1 | awk '{print $7;exit}')
+fi
 
 env | grep ^druid_ | while read evar;
 do
@@ -145,4 +149,4 @@ then
 fi
 
 mkdir -p var/tmp var/druid/segments var/druid/indexing-logs var/druid/task var/druid/hadoop-tmp var/druid/segment-cache
-exec java ${JAVA_OPTS} -cp $COMMON_CONF_DIR:$SERVICE_CONF_DIR:lib/*: org.apache.druid.cli.Main server $@
\ No newline at end of file
+exec java ${JAVA_OPTS} -cp $COMMON_CONF_DIR:$SERVICE_CONF_DIR:lib/*: org.apache.druid.cli.Main server $@


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org