Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions bin/zeppelin-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,26 @@ function initialize_default_directories() {
echo "Pid dir doesn't exist, create ${ZEPPELIN_PID_DIR}"
$(mkdir -p "${ZEPPELIN_PID_DIR}")
fi

PORT_NUMBER="8080"
ZEPPELIN_SITE="conf/zeppelin-site.xml"
ZEPPELIN_ENV="conf/zeppelin-env.sh"
if [ -e "${ZEPPELIN_SITE}" ]; then
PORT_NUMBER="$(xmllint --xpath 'string(//configuration/property[@name="zeppelin.server.port"]/value)' conf/zeppelin-site.xml)"
fi


if [ -e "${ZEPPELIN_ENV}" ]; then
PORT_LINE="$(cat conf/zeppelin-env.sh | grep ZEPPELIN_PORT | xargs)"
if [[ ! ${#PORT_LINE} -lt 0 ]]; then
if [[ $PORT_LINE != \#* ]]; then
PORT_NUMBER="$(cat conf/zeppelin-env.sh | grep ZEPPELIN_PORT | cut -d '=' -f2)"
fi
fi
fi

IP_ADDR="$(ifconfig en0 | grep inet | grep -v inet6 | cut -d ' ' -f2)"
echo -e "Browse $IP_ADDR:$PORT_NUMBER in your browser.\nIf you are testing on your local computer, use localhost:$PORT_NUMBER"
}

function wait_for_zeppelin_to_die() {
Expand Down
23 changes: 21 additions & 2 deletions bin/zeppelin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Run Zeppelin
# Run Zeppelin
#

USAGE="Usage: bin/zeppelin.sh [--config <conf-dir>]"
Expand Down Expand Up @@ -46,7 +46,7 @@ fi
HOSTNAME=$(hostname)
ZEPPELIN_LOGFILE="${ZEPPELIN_LOG_DIR}/zeppelin-${ZEPPELIN_IDENT_STRING}-${HOSTNAME}.log"
LOG="${ZEPPELIN_LOG_DIR}/zeppelin-cli-${ZEPPELIN_IDENT_STRING}-${HOSTNAME}.out"

ZEPPELIN_SERVER=org.apache.zeppelin.server.ZeppelinServer
JAVA_OPTS+=" -Dzeppelin.log.file=${ZEPPELIN_LOGFILE}"

Expand Down Expand Up @@ -87,4 +87,23 @@ if [[ ! -d "${ZEPPELIN_NOTEBOOK_DIR}" ]]; then
$(mkdir -p "${ZEPPELIN_NOTEBOOK_DIR}")
fi

PORT_NUMBER="8080"
ZEPPELIN_SITE="conf/zeppelin-site.xml"
ZEPPELIN_ENV="conf/zeppelin-env.sh"
if [ -e "${ZEPPELIN_SITE}" ]; then
PORT_NUMBER="$(xmllint --xpath 'string(//configuration/property[@name="zeppelin.server.port"]/value)' conf/zeppelin-site.xml)"
fi


if [ -e "${ZEPPELIN_ENV}" ]; then
PORT_LINE="$(cat conf/zeppelin-env.sh | grep ZEPPELIN_PORT | xargs)"
if [[ ! ${#PORT_LINE} -lt 0 ]]; then
if [[ $PORT_LINE != \#* ]]; then
PORT_NUMBER="$(cat conf/zeppelin-env.sh | grep ZEPPELIN_PORT | cut -d '=' -f2)"
fi
fi
fi

IP_ADDR="$(ifconfig en0 | grep inet | grep -v inet6 | cut -d ' ' -f2)"
echo -e "Browse $IP_ADDR:$PORT_NUMBER in your browser.\nIf you are testing on your local computer, use localhost:$PORT_NUMBER"
exec $ZEPPELIN_RUNNER $JAVA_OPTS -cp $ZEPPELIN_CLASSPATH_OVERRIDES:$CLASSPATH $ZEPPELIN_SERVER "$@"
4 changes: 2 additions & 2 deletions conf/zeppelin-site.xml.template
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@

<configuration>

<property>
<property name="zeppelin.server.addr">
<name>zeppelin.server.addr</name>
<value>0.0.0.0</value>
<description>Server address</description>
</property>

<property>
<property name="zeppelin.server.port">
<name>zeppelin.server.port</name>
<value>8080</value>
<description>Server port.</description>
Expand Down