[ZEPPELIN-13] ZEPPELIN_CONF_DIR cannot be reached until ZEPPELIN_CONF_DIR become set

- Added option of --config on zeppelin{-daemon}.sh
- Removed ZEPPELIN_CONF_DIR from zeppelin-env.sh
This commit is contained in:
Jongyoul Lee 2015-04-01 10:41:55 +09:00
parent df1457f5e0
commit 29619d3fd9
4 changed files with 70 additions and 4 deletions

View file

@ -21,6 +21,13 @@
# description: Start and stop daemon script for.
#
USAGE="Usage: zeppelin-daemon.sh [--config <conf-dir>] {start|stop|restart|reload|status}"
if [ $# -le 1 ]; then
echo $USAGE
exit 1
fi
if [ -L ${BASH_SOURCE-$0} ]; then
BIN=$(dirname $(readlink "${BASH_SOURCE-$0}"))
else
@ -28,6 +35,22 @@ else
fi
BIN=$(cd "${BIN}">/dev/null; pwd)
if [ "$1" == "--config" ]
then
shift
conf_dir="$1"
if [ ! -d "$conf_dir" ]
then
echo "ERROR : $conf_dir is not a directory"
echo ${USAGE}
exit 1
else
export ZEPPELIN_CONF_DIR="$conf_dir"
fi
shift
fi
. "${BIN}/common.sh"
. "${BIN}/functions.sh"
@ -205,5 +228,5 @@ case "${1}" in
find_zeppelin_process
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
echo ${USAGE}
esac

View file

@ -22,10 +22,30 @@
#
function usage() {
echo "Usage: bin/zeppelin.sh [spark options] [application options]"
echo "Usage: bin/zeppelin.sh [--config <conf-dir>] [spark options] [application options]"
exit 0
}
if [ $# -le 1 ]; then
echo $USAGE
exit 1
fi
if [ "$1" == "--config" ]
then
shift
conf_dir="$1"
if [ ! -d "$conf_dir" ]
then
echo "ERROR : $conf_dir is not a directory"
echo ${USAGE}
exit 1
else
export ZEPPELIN_CONF_DIR="$conf_dir"
fi
shift
fi
bin=$(dirname "${BASH_SOURCE-$0}")
bin=$(cd "${bin}">/dev/null; pwd)

View file

@ -7,7 +7,6 @@
# export ZEPPELIN_INTP_MEM # zeppelin interpreter process jvm mem options. Defualt = ZEPPELIN_MEM
# export ZEPPELIN_INTP_JAVA_OPTS # zeppelin interpreter process jvm options. Default = ZEPPELIN_JAVA_OPTS
# export ZEPPELIN_CONF_DIR # Alternate zeppelin conf dir. Default is ${ZEPPELIN_HOME}/conf.
# export ZEPPELIN_LOG_DIR # Where log files are stored. PWD by default.
# export ZEPPELIN_PID_DIR # The pid files are stored. /tmp by default.
# export ZEPPELIN_NOTEBOOK_DIR # Where notebook saved

View file

@ -279,7 +279,19 @@
"progressUpdateIntervalMs": 500
},
{
"config": {},
"text": "%pyspark\nprint \"hello, world\"",
"config": {
"colWidth": 12.0,
"graph": {
"mode": "table",
"height": 300.0,
"optionOpen": false,
"keys": [],
"values": [],
"groups": [],
"scatter": {}
}
},
"settings": {
"params": {},
"forms": {}
@ -289,6 +301,18 @@
"dateCreated": "Feb 13, 2015 11:07:51 PM",
"status": "READY",
"progressUpdateIntervalMs": 500
},
{
"config": {},
"settings": {
"params": {},
"forms": {}
},
"jobName": "paragraph_1427850802691_-422382127",
"id": "20150401-101322_1217450604",
"dateCreated": "Apr 1, 2015 10:13:22 AM",
"status": "READY",
"progressUpdateIntervalMs": 500
}
],
"name": "Zeppelin Tutorial",