diff --git a/bin/slaves.sh b/bin/slaves.sh index 752565b759f77384b169f917bf212a474abd59ae..bcb77601300f362abf2df908912656851141eccb 100755 --- a/bin/slaves.sh +++ b/bin/slaves.sh @@ -46,6 +46,22 @@ bin=`cd "$bin"; pwd` # spark-env.sh. Save it here. HOSTLIST=$SPARK_SLAVES +#check if conf dir passed as an argument +if [ "$1" == "--config" ] +then + shift + conf_dir=$1 + if [ ! -d "$conf_dir" ] + then + echo "$conf_dir is not a valid directory" + echo $usage + exit 1 + else + export SPARK_CONF_DIR=$conf_dir + fi + shift +fi + if [ -f "${SPARK_CONF_DIR}/spark-env.sh" ]; then . "${SPARK_CONF_DIR}/spark-env.sh" fi diff --git a/bin/spark-daemon.sh b/bin/spark-daemon.sh index 5bfe967fbfaeb76729ae3a30b81287cfb6021b55..48d552f3db41a101a70b99e80c466aad5ae14521 100755 --- a/bin/spark-daemon.sh +++ b/bin/spark-daemon.sh @@ -43,6 +43,23 @@ bin=`cd "$bin"; pwd` . "$bin/spark-config.sh" # get arguments + +# check if conf dir passed as an argument +if [ "$1" == "--config" ] +then + shift + conf_dir=$1 + if [ ! -d "$conf_dir" ] + then + echo "$conf_dir is not a valid directory" + echo "FOUL :"$usage + exit 1 + else + export SPARK_CONF_DIR=$conf_dir + fi + shift +fi + startStop=$1 shift command=$1