Skip to content

Commit e5d842a

Browse files
committed
MapR [SPARK-921] Replace sudo command with maprexecute in Spark (apache#940)
Co-authored-by: Egor Krivokon <>
1 parent ec39345 commit e5d842a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

bin/configure.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,17 @@ fi
324324
}
325325

326326
function createAppsSparkFolder() {
327-
sudo -u ${MAPR_USER} hadoop fs -mkdir -p /apps/spark > /dev/null 2>&1
328-
sudo -u ${MAPR_USER} hadoop fs -chmod 777 /apps/spark > /dev/null 2>&1
327+
if [ -z "$MAPR_TICKETFILE_LOCATION" ]; then
328+
isSecured="false"
329+
if [ -e "${MAPR_HOME}/conf/mapr-clusters.conf" ]; then
330+
isSecured=$(head -n1 "${MAPR_HOME}/conf/mapr-clusters.conf" | grep -o 'secure=\w*' | cut -d '=' -f 2)
331+
fi
332+
if [ "$isSecured" = "true" ] && [ -e "${MAPR_HOME}/conf/mapruserticket" ]; then
333+
export MAPR_TICKETFILE_LOCATION="${MAPR_HOME}/conf/mapruserticket"
334+
fi
335+
fi
336+
hadoop fs -mkdir -p /apps/spark > /dev/null 2>&1
337+
hadoop fs -chmod 777 /apps/spark > /dev/null 2>&1
329338
}
330339

331340
#

0 commit comments

Comments
 (0)