Skip to content

Commit

Permalink
MapR [SPARK-1158] Spark unable to launch jobs after upgrading hadoop …
Browse files Browse the repository at this point in the history
…patches (apache#1074)

Co-authored-by: Egor Krivokon <>
  • Loading branch information
ekrivokonmapr committed Nov 6, 2023
1 parent c8569e9 commit 505463e
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions bin/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,31 @@ function registerPortHistoryServer() {

function configureDepBlackList() {
dep_blacklist_path=$MAPR_HOME/spark/spark-$SPARK_VERSION/conf/dep-blacklist.txt
slf4j_reload4j=$(ls $MAPR_HOME/hadoop/hadoop-$HADOOP_VERSION/share/hadoop/common/lib/ | grep slf4j-reload4j)

echo $MAPR_HOME/hadoop/hadoop-$HADOOP_VERSION/share/hadoop/common/sources/hadoop-common-$HADOOP_VERSION.*sources.jar >> $dep_blacklist_path
echo $MAPR_HOME/hadoop/hadoop-$HADOOP_VERSION/share/hadoop/common/lib/$slf4j_reload4j >> $dep_blacklist_path
echo $MAPR_HOME/lib/$slf4j_reload4j >> $dep_blacklist_path
echo $MAPR_HOME/lib/log4j2/$(ls /opt/mapr/lib/log4j2/ | grep log4j-slf4j-impl) >> $dep_blacklist_path
slf4j_reload4j_name=$(ls $MAPR_HOME/hadoop/hadoop-$HADOOP_VERSION/share/hadoop/common/lib/ | grep slf4j-reload4j)
slf4j_reload4j_hadoop_path=$MAPR_HOME/hadoop/hadoop-$HADOOP_VERSION/share/hadoop/common/lib/$slf4j_reload4j_name
slf4j_reload4j_lib_path=$MAPR_HOME/lib/$slf4j_reload4j_name

hadoop_common_name=$(ls $MAPR_HOME/hadoop/hadoop-$HADOOP_VERSION/share/hadoop/common/sources/ | grep hadoop-common | grep -v test)
hadoop_common_path=$MAPR_HOME/hadoop/hadoop-$HADOOP_VERSION/share/hadoop/common/sources/$hadoop_common_name

log4j2_slf4j_impl_path=$MAPR_HOME/lib/log4j2/$(ls /opt/mapr/lib/log4j2/ | grep log4j-slf4j-impl)

if ! grep -q $hadoop_common_path $dep_blacklist_path; then
echo $hadoop_common_path >> $dep_blacklist_path
fi

if ! grep -q $slf4j_reload4j_hadoop_path $dep_blacklist_path; then
echo $slf4j_reload4j_hadoop_path >> $dep_blacklist_path
fi

if ! grep -q $slf4j_reload4j_lib_path $dep_blacklist_path; then
echo $slf4j_reload4j_lib_path >> $dep_blacklist_path
fi

if ! grep -q $log4j2_slf4j_impl_path $dep_blacklist_path; then
echo $log4j2_slf4j_impl_path >> $dep_blacklist_path
fi
}

function registerServicePorts() {
Expand Down Expand Up @@ -635,9 +654,7 @@ fi
if [ ! "$isSecure" -eq 2 ] ; then
configureSecurity
fi
if [ ! -s $MAPR_HOME/spark/spark-$SPARK_VERSION/conf/dep-blacklist.txt ]; then
configureDepBlackList
fi
configureDepBlackList
createAppsSparkFolder
change_permissions
mkBackupForOldConfigs
Expand Down

0 comments on commit 505463e

Please sign in to comment.