zeppelin.war.tempdir
webapps
diff --git a/docs/setup/operation/configuration.md b/docs/setup/operation/configuration.md
index a2184314d20..9588cd25a5b 100644
--- a/docs/setup/operation/configuration.md
+++ b/docs/setup/operation/configuration.md
@@ -61,6 +61,33 @@ Sources descending by priority:
8443 |
Zeppelin Server ssl port (used when ssl environment/property is set to true) |
+
+ ZEPPELIN_SERVER_RPC_PORTRANGE |
+ zeppelin.server.rpc.portRange |
+ : |
+
+ Specifies the port range for the Zeppelin Interpreter Event Server.
+ Format: <startPort>:<endPort>
+ If the <startPort> is omitted, the range will begin at 1024. If the <endPort> is omitted, the range will extend up to 65535.
+ Note: If zeppelin.server.rpc.port is set, this property will be ignored.
+ |
+
+
+ ZEPPELIN_INTERPRETER_RPC_PORTRANGE |
+ zeppelin.interpreter.rpc.portRange |
+ : |
+
+ Specifies the port range for the Zeppelin Interpreter.
+ Format: <startPort>:<endPort>
+ If the <startPort> is omitted, the range will begin at 1024. If the <endPort> is omitted, the range will extend up to 65535.
+ |
+
+
+ ZEPPELIN_SERVER_RPC_PORT |
+ zeppelin.server.rpc.port |
+ |
+ Port for the Zeppelin Interpreter Event Server. If not set, an available port will be used automatically. |
+
ZEPPELIN_JMX_ENABLE |
zeppelin.jmx.enable |
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/conf/ZeppelinConfiguration.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/conf/ZeppelinConfiguration.java
index b590fa8dda5..3b9ebee0bad 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/conf/ZeppelinConfiguration.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/conf/ZeppelinConfiguration.java
@@ -338,6 +338,14 @@ public int getServerPort() {
return getInt(ConfVars.ZEPPELIN_PORT);
}
+ public OptionalInt getZeppelinServerRpcPort() {
+ String zeppelinServerRpcPort = getString(ConfVars.ZEPPELIN_SERVER_RPC_PORT);
+ if (StringUtils.isBlank(zeppelinServerRpcPort)) {
+ return OptionalInt.empty();
+ }
+ return OptionalInt.of(Integer.parseInt(zeppelinServerRpcPort));
+ }
+
public String getServerContextPath() {
return getString(ConfVars.ZEPPELIN_SERVER_CONTEXT_PATH);
}
@@ -948,6 +956,7 @@ public enum ConfVars {
ZEPPELIN_SSL_TRUSTSTORE_PATH("zeppelin.ssl.truststore.path", null),
ZEPPELIN_SSL_TRUSTSTORE_TYPE("zeppelin.ssl.truststore.type", null),
ZEPPELIN_SSL_TRUSTSTORE_PASSWORD("zeppelin.ssl.truststore.password", null),
+ ZEPPELIN_SERVER_RPC_PORT("zeppelin.server.rpc.port", null),
ZEPPELIN_WAR("zeppelin.war", "zeppelin-web/dist"),
ZEPPELIN_ANGULAR_WAR("zeppelin.angular.war", "zeppelin-web-angular/dist/zeppelin"),
ZEPPELIN_WAR_TEMPDIR("zeppelin.war.tempdir", "webapps"),
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/RemoteInterpreterEventServer.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/RemoteInterpreterEventServer.java
index d2649ab226e..bab3ee7b2ad 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/RemoteInterpreterEventServer.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/RemoteInterpreterEventServer.java
@@ -20,6 +20,7 @@
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
+import java.util.OptionalInt;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.thrift.TException;
@@ -49,7 +50,6 @@
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterResultMessage;
import org.apache.zeppelin.interpreter.thrift.RunParagraphsEvent;
import org.apache.zeppelin.interpreter.thrift.WebUrlInfo;
-import org.apache.zeppelin.notebook.Note;
import org.apache.zeppelin.resource.RemoteResource;
import org.apache.zeppelin.resource.Resource;
import org.apache.zeppelin.resource.ResourceId;
@@ -78,7 +78,6 @@ public class RemoteInterpreterEventServer implements RemoteInterpreterEventServi
private static final Logger LOGGER = LoggerFactory.getLogger(RemoteInterpreterEventServer.class);
private static final Gson GSON = new Gson();
- private String portRange;
private int port;
private String host;
private ZeppelinConfiguration zConf;
@@ -96,7 +95,6 @@ public class RemoteInterpreterEventServer implements RemoteInterpreterEventServi
public RemoteInterpreterEventServer(ZeppelinConfiguration zConf,
InterpreterSettingManager interpreterSettingManager) {
this.zConf = zConf;
- this.portRange = zConf.getZeppelinServerRPCPortRange();
this.interpreterSettingManager = interpreterSettingManager;
this.listener = interpreterSettingManager.getRemoteInterpreterProcessListener();
this.appListener = interpreterSettingManager.getAppEventListener();
@@ -106,7 +104,9 @@ public void start() throws IOException {
Thread startingThread = new Thread() {
@Override
public void run() {
- try (TServerSocket tSocket = new TServerSocket(RemoteInterpreterUtils.findAvailablePort(portRange))){
+ try (TServerSocket tSocket = new TServerSocket(zConf.getZeppelinServerRpcPort().orElse(
+ RemoteInterpreterUtils.findAvailablePort(zConf.getZeppelinServerRPCPortRange())))
+ ) {
port = tSocket.getServerSocket().getLocalPort();
host = RemoteInterpreterUtils.findAvailableHostAddress();
LOGGER.info("InterpreterEventServer is starting at {}:{}", host, port);