Skip to content

Commit

Permalink
a few tweaks for jenkins debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Lee committed Jul 21, 2014
1 parent 0e4b555 commit 6dba705
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions bin/templates/hadoop-template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ stopService() {
PID=`jps | grep ${SERVICE} | cut -d' ' -f1`
if [ "${PID}" ]
then
echo Shutting down $*
echo kill -s ${KILL_SIGNAL-TERM} ${PID}
kill -s ${KILL_SIGNAL-TERM} ${PID}
fi
}

startService() {
BIN=$1
SERVICE=$2
echo Starting ${SERVICE}
echo @HADOOP_HOME@/bin/${BIN} ${SERVICE} &> "@PROJECT_HOME@/logs/${SERVICE}.log" &
@HADOOP_HOME@/bin/${BIN} ${SERVICE} &> "@PROJECT_HOME@/logs/${SERVICE}.log" &
}

Expand All @@ -37,7 +37,13 @@ start() {
done

startService @BIN@ namenode
sleep 5
if [ "${JENKINS_URL}" ]
then
echo Sleep 30s to let the namenode settle
sleep 30
else
sleep 5
fi
startService @BIN@ datanode
if [[ "@HADOOP_VERSION@" != 1.* ]]
then
Expand All @@ -50,17 +56,19 @@ start() {

if [[ "@HADOOP_VERSION@" == *cdh4* ]]
then
echo @HADOOP_HOME@/bin/hadoop fs -mkdir @HIVE_HOME@/lib
@HADOOP_HOME@/bin/hadoop fs -mkdir @HIVE_HOME@/lib
echo @HADOOP_HOME@/bin/hadoop fs -put @HIVE_HOME@/lib/hive-builtins-*.jar @HIVE_HOME@/lib
@HADOOP_HOME@/bin/hadoop fs -put @HIVE_HOME@/lib/hive-builtins-*.jar @HIVE_HOME@/lib
sleep 5
fi

echo Starting hiveserver
export HADOOP_HOME=@HADOOP_HOME@
if [[ "@HADOOP_VERSION@" == *cdh* ]]
then
export MAPRED_DIR=@HADOOP_HOME@/share/hadoop/mapreduce2
fi
echo @HIVE_HOME@/bin/hive --service hiveserver &> "@PROJECT_HOME@/logs/hiveserver.log" &
@HIVE_HOME@/bin/hive --service hiveserver &> "@PROJECT_HOME@/logs/hiveserver.log" &
}

Expand All @@ -73,6 +81,7 @@ stopAll() {
stopService NameNode name node
stopService RunJar hive server
}

shutdown() {
stopAll

Expand Down

0 comments on commit 6dba705

Please sign in to comment.