提交 1e2497b4 编写于 作者: S StephanEwen

Cleaned up sysouts and apache headers in shell scripts

上级 54bb2dec
#!/bin/bash
########################################################################################################################
#
# Copyright (C) 2010 by the Stratosphere project (http://stratosphere.eu)
# Copyright (C) 2010-2013 by the Stratosphere project (http://stratosphere.eu)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
......@@ -103,18 +103,18 @@ script=`basename "$this"`
bin=`cd "$bin"; pwd`
this="$bin/$script"
# Define the main directory of the Nephele installation
NEPHELE_ROOT_DIR=`dirname "$this"`/..
NEPHELE_LIB_DIR=$NEPHELE_ROOT_DIR/lib
# Define the main directory of the stratosphere installation
STRATOSPHERE_ROOT_DIR=`dirname "$this"`/..
STRATOSPHERE_LIB_DIR=$STRATOSPHERE_ROOT_DIR/lib
# These need to be mangled because they are directly passed to java.
# The above lib path is used by the shell script to retrieve jars in a
# directory, so it needs to be unmangled.
NEPHELE_ROOT_DIR_MANGLED=`manglePath $NEPHELE_ROOT_DIR`
NEPHELE_CONF_DIR=$NEPHELE_ROOT_DIR_MANGLED/conf
NEPHELE_BIN_DIR=$NEPHELE_ROOT_DIR_MANGLED/bin
NEPHELE_LOG_DIR=$NEPHELE_ROOT_DIR_MANGLED/log
YAML_CONF=${NEPHELE_CONF_DIR}/stratosphere-conf.yaml
STRATOSPHERE_ROOT_DIR_MANGLED=`manglePath $STRATOSPHERE_ROOT_DIR`
STRATOSPHERE_CONF_DIR=$STRATOSPHERE_ROOT_DIR_MANGLED/conf
STRATOSPHERE_BIN_DIR=$STRATOSPHERE_ROOT_DIR_MANGLED/bin
STRATOSPHERE_LOG_DIR=$STRATOSPHERE_ROOT_DIR_MANGLED/log
YAML_CONF=${STRATOSPHERE_CONF_DIR}/stratosphere-conf.yaml
########################################################################################################################
# ENVIRONMENT VARIABLES
......@@ -151,30 +151,30 @@ if [ -z "${HOSTNAME}" ]; then
HOSTNAME=`hostname`
fi
# Define NEPHELE_JM_HEAP if it is not already set
if [ -z "${NEPHELE_JM_HEAP}" ]; then
NEPHELE_JM_HEAP=$(readFromConfig ${KEY_JOBM_HEAP_MB} ${DEFAULT_JOBM_HEAP_MB} ${YAML_CONF})
# Define STRATOSPHERE_JM_HEAP if it is not already set
if [ -z "${STRATOSPHERE_JM_HEAP}" ]; then
STRATOSPHERE_JM_HEAP=$(readFromConfig ${KEY_JOBM_HEAP_MB} ${DEFAULT_JOBM_HEAP_MB} ${YAML_CONF})
fi
# Define NEPHELE_TM_HEAP if it is not already set
if [ -z "${NEPHELE_TM_HEAP}" ]; then
NEPHELE_TM_HEAP=$(readFromConfig ${KEY_TASKM_HEAP_MB} ${DEFAULT_TASKM_HEAP_MB} ${YAML_CONF})
# Define STRATOSPHERE_TM_HEAP if it is not already set
if [ -z "${STRATOSPHERE_TM_HEAP}" ]; then
STRATOSPHERE_TM_HEAP=$(readFromConfig ${KEY_TASKM_HEAP_MB} ${DEFAULT_TASKM_HEAP_MB} ${YAML_CONF})
fi
if [ -z "${MAX_LOG_FILE_NUMBER}" ]; then
MAX_LOG_FILE_NUMBER=$(readFromConfig ${KEY_ENV_LOG_MAX} ${DEFAULT_ENV_LOG_MAX} ${YAML_CONF})
fi
if [ -z "${NEPHELE_PID_DIR}" ]; then
NEPHELE_PID_DIR=$(readFromConfig ${KEY_ENV_PID_DIR} "${DEFAULT_ENV_PID_DIR}" ${YAML_CONF})
if [ -z "${STRATOSPHERE_PID_DIR}" ]; then
STRATOSPHERE_PID_DIR=$(readFromConfig ${KEY_ENV_PID_DIR} "${DEFAULT_ENV_PID_DIR}" ${YAML_CONF})
fi
if [ -z "${NEPHELE_OPTS}" ]; then
NEPHELE_OPTS=$(readFromConfig ${KEY_ENV_JAVA_OPTS} "${DEFAULT_ENV_JAVA_OPTS}" ${YAML_CONF})
if [ -z "${STRATOSPHERE_OPTS}" ]; then
STRATOSPHERE_OPTS=$(readFromConfig ${KEY_ENV_JAVA_OPTS} "${DEFAULT_ENV_JAVA_OPTS}" ${YAML_CONF})
fi
if [ -z "${NEPHELE_SSH_OPTS}" ]; then
NEPHELE_OPTS=$(readFromConfig ${KEY_ENV_SSH_OPTS} "${DEFAULT_ENV_SSH_OPTS}" ${YAML_CONF})
if [ -z "${STRATOSPHERE_SSH_OPTS}" ]; then
STRATOSPHERE_OPTS=$(readFromConfig ${KEY_ENV_SSH_OPTS} "${DEFAULT_ENV_SSH_OPTS}" ${YAML_CONF})
fi
# Arguments for the JVM. Used for job and task manager JVMs.
......@@ -183,7 +183,7 @@ fi
JVM_ARGS=""
# Default classpath
CLASSPATH=`manglePathList $( echo $NEPHELE_LIB_DIR/*.jar . | sed 's/ /:/g' )`
CLASSPATH=`manglePathList $( echo $STRATOSPHERE_LIB_DIR/*.jar . | sed 's/ /:/g' )`
# Auxilliary function which extracts the name of host from a line which
# also potentialy includes topology information and the instance type
......
#!/bin/bash
########################################################################################################################
#
# Copyright (C) 2010 by the Stratosphere project (http://stratosphere.eu)
# Copyright (C) 2010-2013 by the Stratosphere project (http://stratosphere.eu)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
......@@ -23,43 +23,42 @@ bin=`cd "$bin"; pwd`
. "$bin"/config.sh
if [ "$EXECUTIONMODE" = "local" ]; then
NEPHELE_JM_HEAP=`expr $NEPHELE_JM_HEAP + $NEPHELE_TM_HEAP`
STRATOSPHERE_JM_HEAP=`expr $STRATOSPHERE_JM_HEAP + $STRATOSPHERE_TM_HEAP`
fi
JVM_ARGS="$JVM_ARGS -Xms"$NEPHELE_JM_HEAP"m -Xmx"$NEPHELE_JM_HEAP"m"
JVM_ARGS="$JVM_ARGS -Xms"$STRATOSPHERE_JM_HEAP"m -Xmx"$STRATOSPHERE_JM_HEAP"m"
if [ "$NEPHELE_IDENT_STRING" = "" ]; then
NEPHELE_IDENT_STRING="$USER"
if [ "$STRATOSPHERE_IDENT_STRING" = "" ]; then
STRATOSPHERE_IDENT_STRING="$USER"
fi
# auxilliary function to construct a lightweight classpath for the
# Nephele JobManager
# auxilliary function to construct a the classpath for the jobmanager
constructJobManagerClassPath() {
for jarfile in $NEPHELE_LIB_DIR/*.jar ; do
if [[ $NEPHELE_JM_CLASSPATH = "" ]]; then
NEPHELE_JM_CLASSPATH=$jarfile;
for jarfile in $STRATOSPHERE_LIB_DIR/*.jar ; do
if [[ $STRATOSPHERE_JM_CLASSPATH = "" ]]; then
STRATOSPHERE_JM_CLASSPATH=$jarfile;
else
NEPHELE_JM_CLASSPATH=$NEPHELE_JM_CLASSPATH:$jarfile
STRATOSPHERE_JM_CLASSPATH=$STRATOSPHERE_JM_CLASSPATH:$jarfile
fi
done
echo $NEPHELE_JM_CLASSPATH
echo $STRATOSPHERE_JM_CLASSPATH
}
NEPHELE_JM_CLASSPATH=`manglePathList $(constructJobManagerClassPath)`
STRATOSPHERE_JM_CLASSPATH=`manglePathList $(constructJobManagerClassPath)`
log=$NEPHELE_LOG_DIR/nephele-$NEPHELE_IDENT_STRING-jobmanager-$HOSTNAME.log
out=$NEPHELE_LOG_DIR/nephele-$NEPHELE_IDENT_STRING-jobmanager-$HOSTNAME.out
pid=$NEPHELE_PID_DIR/nephele-$NEPHELE_IDENT_STRING-jobmanager.pid
log_setting="-Dlog.file="$log" -Dlog4j.configuration=file:"$NEPHELE_CONF_DIR"/log4j.properties"
log=$STRATOSPHERE_LOG_DIR/stratosphere-$STRATOSPHERE_IDENT_STRING-jobmanager-$HOSTNAME.log
out=$STRATOSPHERE_LOG_DIR/stratosphere-$STRATOSPHERE_IDENT_STRING-jobmanager-$HOSTNAME.out
pid=$STRATOSPHERE_PID_DIR/stratosphere-$STRATOSPHERE_IDENT_STRING-jobmanager.pid
log_setting="-Dlog.file="$log" -Dlog4j.configuration=file:"$STRATOSPHERE_CONF_DIR"/log4j.properties"
case $STARTSTOP in
(start)
mkdir -p "$NEPHELE_PID_DIR"
mkdir -p "$STRATOSPHERE_PID_DIR"
if [ -f $pid ]; then
if kill -0 `cat $pid` > /dev/null 2>&1; then
echo Nephele job manager running as process `cat $pid`. Stop it first.
echo Job manager running as process `cat $pid`. Stop it first.
exit 1
fi
fi
......@@ -68,21 +67,21 @@ case $STARTSTOP in
rotateLogFile $log
rotateLogFile $out
echo Starting Nephele job manager
$JAVA_RUN $JVM_ARGS $NEPHELE_OPTS $log_setting -classpath $NEPHELE_JM_CLASSPATH eu.stratosphere.nephele.jobmanager.JobManager -executionMode $EXECUTIONMODE -configDir $NEPHELE_CONF_DIR > "$out" 2>&1 < /dev/null &
echo Starting job manager
$JAVA_RUN $JVM_ARGS $STRATOSPHERE_OPTS $log_setting -classpath $STRATOSPHERE_JM_CLASSPATH eu.stratosphere.nephele.jobmanager.JobManager -executionMode $EXECUTIONMODE -configDir $STRATOSPHERE_CONF_DIR > "$out" 2>&1 < /dev/null &
echo $! > $pid
;;
(stop)
if [ -f $pid ]; then
if kill -0 `cat $pid` > /dev/null 2>&1; then
echo Stopping Nephele job manager
echo Stopping job manager
kill `cat $pid`
else
echo No Nephele job manager to stop
echo No job manager to stop
fi
else
echo No Nephele job manager to stop
echo No job manager to stop
fi
;;
......
#!/bin/bash
########################################################################################################################
#
# Copyright (C) 2010 by the Stratosphere project (http://stratosphere.eu)
# Copyright (C) 2010-2013 by the Stratosphere project (http://stratosphere.eu)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
......@@ -19,10 +19,10 @@ bin=`cd "$bin"; pwd`
. "$bin"/config.sh
HOSTLIST=$NEPHELE_SLAVES
HOSTLIST=$STRATOSPHERE_SLAVES
if [ "$HOSTLIST" = "" ]; then
HOSTLIST="${NEPHELE_CONF_DIR}/slaves"
HOSTLIST="${STRATOSPHERE_CONF_DIR}/slaves"
fi
if [ ! -f $HOSTLIST ]; then
......@@ -30,8 +30,8 @@ if [ ! -f $HOSTLIST ]; then
exit 1
fi
# cluster mode, only bring up job manager locally and a task manager on every slave host
$NEPHELE_BIN_DIR/jobmanager.sh start cluster
# cluster mode, bring up job manager locally and a task manager on every slave host
$STRATOSPHERE_BIN_DIR/jobmanager.sh start cluster
GOON=true
while $GOON
......@@ -39,6 +39,6 @@ do
read line || GOON=false
if [ -n "$line" ]; then
HOST=$( extractHostName $line)
ssh -n $NEPHELE_SSH_OPTS $HOST -- "nohup /bin/bash $NEPHELE_BIN_DIR/taskmanager.sh start &"
ssh -n $STRATOSPHERE_SSH_OPTS $HOST -- "nohup /bin/bash $STRATOSPHERE_BIN_DIR/taskmanager.sh start &"
fi
done < $HOSTLIST
#!/bin/bash
########################################################################################################################
#
# Copyright (C) 2010 by the Stratosphere project (http://stratosphere.eu)
# Copyright (C) 2010-2013 by the Stratosphere project (http://stratosphere.eu)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
......@@ -19,5 +19,5 @@ bin=`cd "$bin"; pwd`
. "$bin"/config.sh
# local mode, only bring up job manager. The job manager will take care to bring a task manager internally.
$NEPHELE_BIN_DIR/jobmanager.sh start local
# local mode, only bring up job manager. The job manager will start an internal task manager
$STRATOSPHERE_BIN_DIR/jobmanager.sh start local
#!/bin/bash
########################################################################################################################
#
# Copyright (C) 2010 by the Stratosphere project (http://stratosphere.eu)
# Copyright (C) 2010-2013 by the Stratosphere project (http://stratosphere.eu)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
......@@ -19,5 +19,4 @@ bin=`cd "$bin"; pwd`
. "$bin"/config.sh
# local mode, only bring up job manager. The job manager will take care to bring a task manager internally.
$NEPHELE_BIN_DIR/webclient.sh start
$STRATOSPHERE_BIN_DIR/webclient.sh start
#!/bin/bash
########################################################################################################################
#
# Copyright (C) 2010 by the Stratosphere project (http://stratosphere.eu)
# Copyright (C) 2010-2013 by the Stratosphere project (http://stratosphere.eu)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
......@@ -19,10 +19,10 @@ bin=`cd "$bin"; pwd`
. "$bin"/config.sh
HOSTLIST=$NEPHELE_SLAVES
HOSTLIST=$STRATOSPHERE_SLAVES
if [ "$HOSTLIST" = "" ]; then
HOSTLIST="${NEPHELE_CONF_DIR}/slaves"
HOSTLIST="${STRATOSPHERE_CONF_DIR}/slaves"
fi
if [ ! -f $HOSTLIST ]; then
......@@ -30,8 +30,8 @@ if [ ! -f $HOSTLIST ]; then
exit 1
fi
# cluster mode, only bring up job manager locally and a task manager on every slave host
$NEPHELE_BIN_DIR/jobmanager.sh stop
# cluster mode, stop the job manager locally and stop the task manager on every slave host
$STRATOSPHERE_BIN_DIR/jobmanager.sh stop
GOON=true
while $GOON
......@@ -39,6 +39,6 @@ do
read line || GOON=false
if [ -n "$line" ]; then
HOST=$( extractHostName $line)
ssh -n $NEPHELE_SSH_OPTS $HOST -- "nohup /bin/bash $NEPHELE_BIN_DIR/taskmanager.sh stop &"
ssh -n $STRATOSPHERE_SSH_OPTS $HOST -- "nohup /bin/bash $STRATOSPHERE_BIN_DIR/taskmanager.sh stop &"
fi
done < $HOSTLIST
#!/bin/bash
########################################################################################################################
#
# Copyright (C) 2010 by the Stratosphere project (http://stratosphere.eu)
# Copyright (C) 2010-2013 by the Stratosphere project (http://stratosphere.eu)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
......@@ -19,5 +19,5 @@ bin=`cd "$bin"; pwd`
. "$bin"/config.sh
# stop local job manager. Local job manager will take care of stopping the task manager internally
$NEPHELE_BIN_DIR/jobmanager.sh stop
# stop local job manager (has an internal task manager)
$STRATOSPHERE_BIN_DIR/jobmanager.sh stop
#!/bin/bash
########################################################################################################################
#
# Copyright (C) 2010 by the Stratosphere project (http://stratosphere.eu)
# Copyright (C) 2010-2013 by the Stratosphere project (http://stratosphere.eu)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
......@@ -19,5 +19,4 @@ bin=`cd "$bin"; pwd`
. "$bin"/config.sh
# local mode, only bring up job manager. The job manager will take care to bring a task manager internally.
$NEPHELE_BIN_DIR/webclient.sh stop
$STRATOSPHERE_BIN_DIR/webclient.sh stop
#!/bin/bash
########################################################################################################################
#
# Copyright (C) 2010 by the Stratosphere project (http://stratosphere.eu)
# Copyright (C) 2010-2013 by the Stratosphere project (http://stratosphere.eu)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
......@@ -19,28 +19,27 @@ bin=`cd "$bin"; pwd`
. "$bin"/config.sh
if [ "$NEPHELE_IDENT_STRING" = "" ]; then
NEPHELE_IDENT_STRING="$USER"
if [ "$STRATOSPHERE_IDENT_STRING" = "" ]; then
STRATOSPHERE_IDENT_STRING="$USER"
fi
# auxilliary function to construct a lightweight classpath for the
# Nephele visualization component
# auxilliary function to construct the classpath for the swt visualization component
constructVisualizationClassPath() {
for jarfile in $NEPHELE_LIB_DIR/*.jar ; do
if [[ $NEPHELE_VS_CLASSPATH = "" ]]; then
NEPHELE_VS_CLASSPATH=$jarfile;
for jarfile in $STRATOSPHERE_LIB_DIR/*.jar ; do
if [[ $STRATOSPHERE_VS_CLASSPATH = "" ]]; then
STRATOSPHERE_VS_CLASSPATH=$jarfile;
else
NEPHELE_VS_CLASSPATH=$NEPHELE_VS_CLASSPATH:$jarfile
STRATOSPHERE_VS_CLASSPATH=$STRATOSPHERE_VS_CLASSPATH:$jarfile
fi
done
echo $NEPHELE_VS_CLASSPATH
echo $STRATOSPHERE_VS_CLASSPATH
}
log=$NEPHELE_LOG_DIR/nephele-$NEPHELE_IDENT_STRING-visualization-$HOSTNAME.log
log_setting="-Dlog.file="$log" -Dlog4j.configuration=file://"$NEPHELE_CONF_DIR"/log4j.properties"
log=$STRATOSPHERE_LOG_DIR/stratosphere-$STRATOSPHERE_IDENT_STRING-visualization-$HOSTNAME.log
log_setting="-Dlog.file="$log" -Dlog4j.configuration=file://"$STRATOSPHERE_CONF_DIR"/log4j.properties"
NEPHELE_VS_CLASSPATH=$(constructVisualizationClassPath)
STRATOSPHERE_VS_CLASSPATH=$(constructVisualizationClassPath)
$JAVA_RUN $JVM_ARGS $NEPHELE_OPTS $log_setting -classpath $NEPHELE_VS_CLASSPATH eu.stratosphere.addons.visualization.swt.SWTVisualization -configDir $NEPHELE_CONF_DIR
$JAVA_RUN $JVM_ARGS $STRATOSPHERE_OPTS $log_setting -classpath $STRATOSPHERE_VS_CLASSPATH eu.stratosphere.addons.visualization.swt.SWTVisualization -configDir $STRATOSPHERE_CONF_DIR
#!/bin/bash
########################################################################################################################
#
# Copyright (C) 2010 by the Stratosphere project (http://stratosphere.eu)
# Copyright (C) 2010-2013 by the Stratosphere project (http://stratosphere.eu)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
......@@ -21,41 +21,41 @@ bin=`cd "$bin"; pwd`
. "$bin"/config.sh
if [ "$NEPHELE_IDENT_STRING" = "" ]; then
NEPHELE_IDENT_STRING="$USER"
if [ "$STRATOSPHERE_IDENT_STRING" = "" ]; then
STRATOSPHERE_IDENT_STRING="$USER"
fi
# auxilliary function to construct a lightweight classpath for the
# Nephele TaskManager
constructTaskManagerClassPath() {
for jarfile in $NEPHELE_LIB_DIR/*.jar ; do
if [[ $NEPHELE_TM_CLASSPATH = "" ]]; then
NEPHELE_TM_CLASSPATH=$jarfile;
for jarfile in $STRATOSPHERE_LIB_DIR/*.jar ; do
if [[ $STRATOSPHERE_TM_CLASSPATH = "" ]]; then
STRATOSPHERE_TM_CLASSPATH=$jarfile;
else
NEPHELE_TM_CLASSPATH=$NEPHELE_TM_CLASSPATH:$jarfile
STRATOSPHERE_TM_CLASSPATH=$STRATOSPHERE_TM_CLASSPATH:$jarfile
fi
done
echo $NEPHELE_TM_CLASSPATH
echo $STRATOSPHERE_TM_CLASSPATH
}
NEPHELE_TM_CLASSPATH=`manglePathList $(constructTaskManagerClassPath)`
STRATOSPHERE_TM_CLASSPATH=`manglePathList $(constructTaskManagerClassPath)`
log=$NEPHELE_LOG_DIR/nephele-$NEPHELE_IDENT_STRING-taskmanager-$HOSTNAME.log
out=$NEPHELE_LOG_DIR/nephele-$NEPHELE_IDENT_STRING-taskmanager-$HOSTNAME.out
pid=$NEPHELE_PID_DIR/nephele-$NEPHELE_IDENT_STRING-taskmanager.pid
log_setting="-Dlog.file="$log" -Dlog4j.configuration=file:"$NEPHELE_CONF_DIR"/log4j.properties"
log=$STRATOSPHERE_LOG_DIR/stratosphere-$STRATOSPHERE_IDENT_STRING-taskmanager-$HOSTNAME.log
out=$STRATOSPHERE_LOG_DIR/stratosphere-$STRATOSPHERE_IDENT_STRING-taskmanager-$HOSTNAME.out
pid=$STRATOSPHERE_PID_DIR/stratosphere-$STRATOSPHERE_IDENT_STRING-taskmanager.pid
log_setting="-Dlog.file="$log" -Dlog4j.configuration=file:"$STRATOSPHERE_CONF_DIR"/log4j.properties"
JVM_ARGS="$JVM_ARGS -XX:+UseParNewGC -XX:NewRatio=8 -XX:PretenureSizeThreshold=64m -Xms"$NEPHELE_TM_HEAP"m -Xmx"$NEPHELE_TM_HEAP"m"
JVM_ARGS="$JVM_ARGS -XX:+UseParNewGC -XX:NewRatio=8 -XX:PretenureSizeThreshold=64m -Xms"$STRATOSPHERE_TM_HEAP"m -Xmx"$STRATOSPHERE_TM_HEAP"m"
case $STARTSTOP in
(start)
mkdir -p "$NEPHELE_PID_DIR"
mkdir -p "$STRATOSPHERE_PID_DIR"
if [ -f $pid ]; then
if kill -0 `cat $pid` > /dev/null 2>&1; then
echo Nephele task manager running as process `cat $pid` on host $HOSTNAME. Stop it first.
echo Task manager running as process `cat $pid` on host $HOSTNAME. Stop it first.
exit 1
fi
fi
......@@ -64,21 +64,21 @@ case $STARTSTOP in
rotateLogFile $log
rotateLogFile $out
echo Starting Nephele task manager on host $HOSTNAME
$JAVA_RUN $JVM_ARGS $NEPHELE_OPTS $log_setting -classpath $NEPHELE_TM_CLASSPATH eu.stratosphere.nephele.taskmanager.TaskManager -configDir $NEPHELE_CONF_DIR > "$out" 2>&1 < /dev/null &
echo Starting task manager on host $HOSTNAME
$JAVA_RUN $JVM_ARGS $STRATOSPHERE_OPTS $log_setting -classpath $STRATOSPHERE_TM_CLASSPATH eu.stratosphere.nephele.taskmanager.TaskManager -configDir $STRATOSPHERE_CONF_DIR > "$out" 2>&1 < /dev/null &
echo $! > $pid
;;
(stop)
if [ -f $pid ]; then
if kill -0 `cat $pid` > /dev/null 2>&1; then
echo Stopping Nephele task manager on host $HOSTNAME
echo Stopping task manager on host $HOSTNAME
kill `cat $pid`
else
echo No Nephele task manager to stop on host $HOSTNAME
echo No task manager to stop on host $HOSTNAME
fi
else
echo No Nephele task manager to stop on host $HOSTNAME
echo No task manager to stop on host $HOSTNAME
fi
;;
......
#!/bin/bash
########################################################################################################################
#
# Copyright (C) 2010 by the Stratosphere project (http://stratosphere.eu)
# Copyright (C) 2010-2013 by the Stratosphere project (http://stratosphere.eu)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
......@@ -22,65 +22,64 @@ bin=`cd "$bin"; pwd`
# get nephele config
. "$bin"/config.sh
if [ "$NEPHELE_IDENT_STRING" = "" ]; then
NEPHELE_IDENT_STRING="$USER"
if [ "$STRATOSPHERE_IDENT_STRING" = "" ]; then
STRATOSPHERE_IDENT_STRING="$USER"
fi
NEPHELE_LIB_CLIENTS_DIR=$NEPHELE_ROOT_DIR/lib_clients
STRATOSPHERE_LIB_CLIENTS_DIR=$STRATOSPHERE_ROOT_DIR/lib_clients
JVM_ARGS="$JVM_ARGS -Xmx512m"
# auxilliary function to construct a lightweight classpath for the
# PACT Webfrontend
constructPactWebFrontendClassPath() {
# auxilliary function to construct the classpath for the webclient
constructWebclientClassPath() {
for jarfile in $NEPHELE_LIB_DIR/*.jar ; do
if [[ $PACT_WF_CLASSPATH = "" ]]; then
PACT_WF_CLASSPATH=$jarfile;
for jarfile in $STRATOSPHERE_LIB_DIR/*.jar ; do
if [[ $STRATOSPHERE_WEBCLIENT_CLASSPATH = "" ]]; then
STRATOSPHERE_WEBCLIENT_CLASSPATH=$jarfile;
else
PACT_WF_CLASSPATH=$PACT_WF_CLASSPATH:$jarfile
STRATOSPHERE_WEBCLIENT_CLASSPATH=$STRATOSPHERE_WEBCLIENT_CLASSPATH:$jarfile
fi
done
for jarfile in $NEPHELE_LIB_CLIENTS_DIR/*.jar ; do
PACT_WF_CLASSPATH=$PACT_WF_CLASSPATH:$jarfile
for jarfile in $STRATOSPHERE_LIB_CLIENTS_DIR/*.jar ; do
STRATOSPHERE_WEBCLIENT_CLASSPATH=$STRATOSPHERE_WEBCLIENT_CLASSPATH:$jarfile
done
echo $PACT_WF_CLASSPATH
echo $STRATOSPHERE_WEBCLIENT_CLASSPATH
}
PACT_WF_CLASSPATH=`manglePathList $(constructPactWebFrontendClassPath)`
STRATOSPHERE_WEBCLIENT_CLASSPATH=`manglePathList $(constructWebclientClassPath)`
log=$NEPHELE_LOG_DIR/nephele-$NEPHELE_IDENT_STRING-pact-web-$HOSTNAME.log
out=$NEPHELE_LOG_DIR/nephele-$NEPHELE_IDENT_STRING-pact-web-$HOSTNAME.out
pid=$NEPHELE_PID_DIR/nephele-$NEPHELE_IDENT_STRING-pact-web.pid
log_setting="-Dlog.file="$log" -Dlog4j.configuration=file:"$NEPHELE_CONF_DIR"/log4j.properties"
log=$STRATOSPHERE_LOG_DIR/stratosphere-$STRATOSPHERE_IDENT_STRING-webclient-$HOSTNAME.log
out=$STRATOSPHERE_LOG_DIR/stratosphere-$STRATOSPHERE_IDENT_STRING-webclient-$HOSTNAME.out
pid=$STRATOSPHERE_PID_DIR/stratosphere-$STRATOSPHERE_IDENT_STRING-webclient.pid
log_setting="-Dlog.file="$log" -Dlog4j.configuration=file:"$STRATOSPHERE_CONF_DIR"/log4j.properties"
case $STARTSTOP in
(start)
mkdir -p "$NEPHELE_PID_DIR"
mkdir -p "$STRATOSPHERE_PID_DIR"
if [ -f $pid ]; then
if kill -0 `cat $pid` > /dev/null 2>&1; then
echo PACT Webfrontend running as process `cat $pid`. Stop it first.
echo Stratosphere webclient running as process `cat $pid`. Stop it first.
exit 1
fi
fi
echo Starting PACT Webfrontend
$JAVA_RUN $JVM_ARGS $log_setting -classpath $PACT_WF_CLASSPATH eu.stratosphere.client.WebFrontend -configDir $NEPHELE_CONF_DIR > "$out" 2>&1 < /dev/null &
echo Starting Stratosphere webclient
$JAVA_RUN $JVM_ARGS $log_setting -classpath $STRATOSPHERE_WEBCLIENT_CLASSPATH eu.stratosphere.client.WebFrontend -configDir $STRATOSPHERE_CONF_DIR > "$out" 2>&1 < /dev/null &
echo $! > $pid
;;
(stop)
if [ -f $pid ]; then
if kill -0 `cat $pid` > /dev/null 2>&1; then
echo Stopping PACT Webfrontend
echo Stopping Stratosphere webclient
kill `cat $pid`
else
echo No PACT Webfrontend to stop
echo No Stratosphere webclient to stop
fi
else
echo No PACT Webfrontend to stop
echo No Stratosphere webclient to stop
fi
;;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册