Merge branch '1.4.5-SNAPSHOT' into 1.5.1-SNAPSHOT Conflicts: test/system/continuous/start-agitator.sh test/system/continuous/stop-agitator.sh
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/04539871 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/04539871 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/04539871 Branch: refs/heads/master Commit: 0453987164216aaea0ad17765f35eef5b139f366 Parents: b9adbd7 872fd1d Author: Josh Elser <els...@apache.org> Authored: Fri Dec 6 23:07:09 2013 -0500 Committer: Josh Elser <els...@apache.org> Committed: Fri Dec 6 23:07:09 2013 -0500 ---------------------------------------------------------------------- .../system/continuous/continuous-env.sh.example | 9 + test/system/continuous/hdfs-agitator.pl | 217 +++++++++++++++++++ test/system/continuous/start-agitator.sh | 5 + test/system/continuous/stop-agitator.sh | 4 + 4 files changed, 235 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/04539871/test/system/continuous/continuous-env.sh.example ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/04539871/test/system/continuous/start-agitator.sh ---------------------------------------------------------------------- diff --cc test/system/continuous/start-agitator.sh index 8c2bafb,c734943..e476c8d --- a/test/system/continuous/start-agitator.sh +++ b/test/system/continuous/start-agitator.sh @@@ -17,20 -17,12 +17,25 @@@ CONTINUOUS_CONF_DIR=${CONTINUOUS_CONF_DIR:-$ACCUMULO_HOME/test/system/continuous/} . $CONTINUOUS_CONF_DIR/continuous-env.sh +export HADOOP_PREFIX -nohup ./agitator.pl $KILL_SLEEP_TIME $TUP_SLEEP_TIME $MIN_KILL $MAX_KILL >$CONTINUOUS_LOG_DIR/`date +%Y%m%d%H%M%S`_`hostname`_agitator.out 2>$CONTINUOUS_LOG_DIR/`date +%Y%m%d%H%M%S`_`hostname`_agitator.err & +mkdir -p $CONTINUOUS_LOG_DIR -nohup ./magitator.pl $MASTER_KILL_SLEEP_TIME $MASTER_RESTART_SLEEP_TIME >$CONTINUOUS_LOG_DIR/`date +%Y%m%d%H%M%S`_`hostname`_magitator.out 2>$CONTINUOUS_LOG_DIR/`date +%Y%m%d%H%M%S`_`hostname`_magitator.err & +# Agitator needs to handle HDFS and Accumulo - can't switch to a single user and expect it to work +nohup ./agitator.pl $KILL_SLEEP_TIME $TUP_SLEEP_TIME $HDFS_USER $ACCUMULO_USER $MIN_KILL $MAX_KILL >$CONTINUOUS_LOG_DIR/`date +%Y%m%d%H%M%S`_`hostname`_agitator.out 2>$CONTINUOUS_LOG_DIR/`date +%Y%m%d%H%M%S`_`hostname`_agitator.err & + +if [[ "`whoami`" == "root" ]]; then + # Change to the correct user if started as root + su -c "nohup $CONTINUOUS_CONF_DIR/magitator.pl $MASTER_KILL_SLEEP_TIME $MASTER_RESTART_SLEEP_TIME >$CONTINUOUS_LOG_DIR/`date +%Y%m%d%H%M%S`_`hostname`_magitator.out 2>$CONTINUOUS_LOG_DIR/`date +%Y%m%d%H%M%S`_`hostname`_magitator.err &" -m - $ACCUMULO_USER +elif [[ "`whoami`" == $ACCUMULO_USER ]]; then + # Just run the magitator if we're the accumulo user + nohup $CONTINUOUS_CONF_DIR/magitator.pl $MASTER_KILL_SLEEP_TIME $MASTER_RESTART_SLEEP_TIME >$CONTINUOUS_LOG_DIR/`date +%Y%m%d%H%M%S`_`hostname`_magitator.out 2>$CONTINUOUS_LOG_DIR/`date +%Y%m%d%H%M%S`_`hostname`_magitator.err & +else + # Not root, and not the accumulo user, hope you can sudo to it + sudo -m -u $ACCUMULO_USER "nohup $CONTINUOUS_CONF_DIR/magitator.pl $MASTER_KILL_SLEEP_TIME $MASTER_RESTART_SLEEP_TIME >$CONTINUOUS_LOG_DIR/`date +%Y%m%d%H%M%S`_`hostname`_magitator.out 2>$CONTINUOUS_LOG_DIR/`date +%Y%m%d%H%M%S`_`hostname`_magitator.err &" +fi + + if ${AGITATE_HDFS:-false} ; then + AGITATOR_LOG=${CONTINUOUS_LOG_DIR}/`date +%Y%m%d%H%M%S`_`hostname`_hdfs-agitator + nohup ./hdfs-agitator.pl --sleep ${AGITATE_HDFS_SLEEP_TIME} --hdfs-cmd ${AGITATE_HDFS_COMMAND} --superuser ${AGITATE_HDFS_SUPERUSER} --sudo ${AGITATE_HDFS_SUDO} >${AGITATOR_LOG}.out 2>${AGITATOR_LOG}.err & + fi http://git-wip-us.apache.org/repos/asf/accumulo/blob/04539871/test/system/continuous/stop-agitator.sh ---------------------------------------------------------------------- diff --cc test/system/continuous/stop-agitator.sh index 8ce448e,f26e3b2..3d64e2d --- a/test/system/continuous/stop-agitator.sh +++ b/test/system/continuous/stop-agitator.sh @@@ -17,10 -18,9 +17,14 @@@ CONTINUOUS_CONF_DIR=${CONTINUOUS_CONF_DIR:-$ACCUMULO_HOME/test/system/continuous/} . $CONTINUOUS_CONF_DIR/continuous-env.sh +# Try to use sudo when we wouldn't normally be able to kill the processes +if [[ ("`whoami`" != "root") && ("`whoami`" != $ACCUMULO_USER) ]]; then + sudo -u $ACCUMULO_USER pkill -f agitator.pl +else + pkill -f agitator.pl +fi + + if ${AGITATE_HDFS:-false} ; then + pkill -f hdfs-agitator.pl + fi + -pkill -f agitator.pl -