This is an automated email from the ASF dual-hosted git repository. zjffdu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/master by this push: new 80cc7e2 [ZEPPELIN-4216]. Introduce ZEPPELIN_SERVER_IP to specify the ip address of thrift server 80cc7e2 is described below commit 80cc7e27ac6001e415b6e0bac9321f6dc3a7b642 Author: Jeff Zhang <zjf...@apache.org> AuthorDate: Mon Jul 1 22:31:53 2019 +0800 [ZEPPELIN-4216]. Introduce ZEPPELIN_SERVER_IP to specify the ip address of thrift server ### What is this PR for? This PR use introduce env `ZEPPELIN_SERVER_IP` to specify the ip address of thrift server. It is used when you are in a complex network environment where yo might have multiple network cards or you use proxy. If it is not specified, it would still use the old approach to choose one IP randomly. ### What type of PR is it? [ Improvement ] ### Todos * [ ] - Task ### What is the Jira issue? * https://jira.apache.org/jira/browse/ZEPPELIN-4216 ### How should this be tested? * CI pass ### Screenshots (if appropriate) ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: Jeff Zhang <zjf...@apache.org> Closes #3392 from zjffdu/ZEPPELIN-4216 and squashes the following commits: 35fbcd51f [Jeff Zhang] [ZEPPELIN-4216]. Introduce ZEPPELIN_SERVER_IP to specify the ip address of thrift server --- conf/zeppelin-env.sh.template | 1 + .../apache/zeppelin/interpreter/remote/RemoteInterpreterUtils.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/conf/zeppelin-env.sh.template b/conf/zeppelin-env.sh.template index d8e265a..9f10be8 100644 --- a/conf/zeppelin-env.sh.template +++ b/conf/zeppelin-env.sh.template @@ -18,6 +18,7 @@ # export JAVA_HOME= # export MASTER= # Spark master url. eg. spark://master_addr:7077. Leave empty if you want to use local mode. +# export ZEPPELIN_LOCAL_IP # Zeppelin's thrift server ip address, if not specified, one random IP address will be choosen. # export ZEPPELIN_JAVA_OPTS # Additional jvm options. for example, export ZEPPELIN_JAVA_OPTS="-Dspark.executor.memory=8g -Dspark.cores.max=16" # export ZEPPELIN_MEM # Zeppelin jvm mem options Default -Xms1024m -Xmx1024m -XX:MaxPermSize=512m # export ZEPPELIN_INTP_MEM # zeppelin interpreter process jvm mem options. Default -Xms1024m -Xmx1024m -XX:MaxPermSize=512m diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterUtils.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterUtils.java index 7e9ff13..4ebc2a2 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterUtils.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterUtils.java @@ -94,6 +94,11 @@ public class RemoteInterpreterUtils { } public static String findAvailableHostAddress() throws UnknownHostException, SocketException { + String zeppelinServerIP = System.getenv("ZEPPELIN_LOCAL_IP"); + if (zeppelinServerIP != null) { + return zeppelinServerIP; + } + InetAddress address = InetAddress.getLocalHost(); if (address.isLoopbackAddress()) { for (NetworkInterface networkInterface : Collections