Repository: accumulo Updated Branches: refs/heads/1.5.2-SNAPSHOT 53f2e3457 -> d22bf18f4 refs/heads/1.6.0-SNAPSHOT 84cc955db -> 0fb0369af refs/heads/master 23980d36c -> fbb18d6eb
ACCUMULO-2382 make agitation work with a non-default CONTINUOUS_CONF_DIR. * Change start-agitator to use inferred installation directory instead of passed in conf dir. * Ensure tserver and master agitator default ot ACCUMULO_HOME if present, so that starting all as root works. Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/d22bf18f Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/d22bf18f Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/d22bf18f Branch: refs/heads/1.5.2-SNAPSHOT Commit: d22bf18f4ccb56e7fe263f6e5e1aaffe6d41d2b2 Parents: 53f2e34 Author: Sean Busbey <bus...@cloudera.com> Authored: Mon Mar 17 16:30:30 2014 -0500 Committer: Sean Busbey <bus...@cloudera.com> Committed: Wed Mar 19 23:13:34 2014 -0500 ---------------------------------------------------------------------- test/system/continuous/datanode-agitator.pl | 9 +++++++-- test/system/continuous/master-agitator.pl | 8 +++++++- test/system/continuous/start-agitator.sh | 20 ++++++++++---------- test/system/continuous/tserver-agitator.pl | 9 +++++++-- 4 files changed, 31 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/d22bf18f/test/system/continuous/datanode-agitator.pl ---------------------------------------------------------------------- diff --git a/test/system/continuous/datanode-agitator.pl b/test/system/continuous/datanode-agitator.pl index f823593..acb5843 100755 --- a/test/system/continuous/datanode-agitator.pl +++ b/test/system/continuous/datanode-agitator.pl @@ -24,8 +24,13 @@ if(scalar(@ARGV) != 5 && scalar(@ARGV) != 3){ exit(1); } -$cwd=Cwd::cwd(); -$ACCUMULO_HOME=$cwd . '/../../..'; +my $ACCUMULO_HOME; +if( defined $ENV{'ACCUMULO_HOME'} ){ + $ACCUMULO_HOME = $ENV{'ACCUMULO_HOME'}; +} else { + $cwd=Cwd::cwd(); + $ACCUMULO_HOME=$cwd . '/../../..'; +} $HADOOP_PREFIX=$ARGV[2]; print "ACCUMULO_HOME=$ACCUMULO_HOME\n"; http://git-wip-us.apache.org/repos/asf/accumulo/blob/d22bf18f/test/system/continuous/master-agitator.pl ---------------------------------------------------------------------- diff --git a/test/system/continuous/master-agitator.pl b/test/system/continuous/master-agitator.pl index a40bfb2..0b7ff0d 100755 --- a/test/system/continuous/master-agitator.pl +++ b/test/system/continuous/master-agitator.pl @@ -23,7 +23,13 @@ if(scalar(@ARGV) != 2){ exit(1); } -$ACCUMULO_HOME="../../.."; +my $ACCUMULO_HOME; +if( defined $ENV{'ACCUMULO_HOME'} ){ + $ACCUMULO_HOME = $ENV{'ACCUMULO_HOME'}; +} else { + $cwd=Cwd::cwd(); + $ACCUMULO_HOME=$cwd . '/../../..'; +} if(defined $ENV{'ACCUMULO_CONF_DIR'}){ $ACCUMULO_CONF_DIR = $ENV{'ACCUMULO_CONF_DIR'}; http://git-wip-us.apache.org/repos/asf/accumulo/blob/d22bf18f/test/system/continuous/start-agitator.sh ---------------------------------------------------------------------- diff --git a/test/system/continuous/start-agitator.sh b/test/system/continuous/start-agitator.sh index 979899f..70d5c53 100755 --- a/test/system/continuous/start-agitator.sh +++ b/test/system/continuous/start-agitator.sh @@ -38,34 +38,34 @@ if [[ "`whoami`" == "root" ]]; then echo "Running master-agitator and tserver-agitator as $ACCUMULO_USER using su. Running datanode-agitator as $HDFS_USER using su." # Change to the correct user if started as root - su -c "nohup $CONTINUOUS_CONF_DIR/master-agitator.pl $MASTER_KILL_SLEEP_TIME $MASTER_RESTART_SLEEP_TIME >${LOG_BASE}_master-agitator.out 2>${LOG_BASE}_master-agitator.err &" -m - $ACCUMULO_USER + su -c "nohup ${bin}/master-agitator.pl $MASTER_KILL_SLEEP_TIME $MASTER_RESTART_SLEEP_TIME >${LOG_BASE}_master-agitator.out 2>${LOG_BASE}_master-agitator.err &" -m - $ACCUMULO_USER - su -c "nohup $CONTINUOUS_CONF_DIR/tserver-agitator.pl $KILL_SLEEP_TIME $TUP_SLEEP_TIME $MIN_KILL $MAX_KILL >${LOG_BASE}_tserver-agitator.out 2>${LOG_BASE}_tserver-agitator.err &" -m - $ACCUMULO_USER + su -c "nohup ${bin}/tserver-agitator.pl $KILL_SLEEP_TIME $TUP_SLEEP_TIME $MIN_KILL $MAX_KILL >${LOG_BASE}_tserver-agitator.out 2>${LOG_BASE}_tserver-agitator.err &" -m - $ACCUMULO_USER - su -c "nohup $CONTINUOUS_CONF_DIR/datanode-agitator.pl $KILL_SLEEP_TIME $TUP_SLEEP_TIME $HADOOP_PREFIX $MIN_KILL $MAX_KILL >${LOG_BASE}_datanode-agitator.out 2>${LOG_BASE}_datanode-agitator.err &" -m - $HDFS_USER + su -c "nohup ${bin}/datanode-agitator.pl $KILL_SLEEP_TIME $TUP_SLEEP_TIME $HADOOP_PREFIX $MIN_KILL $MAX_KILL >${LOG_BASE}_datanode-agitator.out 2>${LOG_BASE}_datanode-agitator.err &" -m - $HDFS_USER elif [[ "`whoami`" == $ACCUMULO_USER ]]; then echo "Running master-agitator and tserver-agitator as `whoami`. Running datanode-agitator as $HDFS_USER using sudo." # Just run the master-agitator if we're the accumulo user - nohup $CONTINUOUS_CONF_DIR/master-agitator.pl $MASTER_KILL_SLEEP_TIME $MASTER_RESTART_SLEEP_TIME >${LOG_BASE}_master-agitator.out 2>${LOG_BASE}_master-agitator.err & + nohup ${bin}/master-agitator.pl $MASTER_KILL_SLEEP_TIME $MASTER_RESTART_SLEEP_TIME >${LOG_BASE}_master-agitator.out 2>${LOG_BASE}_master-agitator.err & - nohup $CONTINUOUS_CONF_DIR/tserver-agitator.pl $KILL_SLEEP_TIME $TUP_SLEEP_TIME $MIN_KILL $MAX_KILL >${LOG_BASE}_tserver-agitator.out 2>${LOG_BASE}_tserver-agitator.err & + nohup ${bin}/tserver-agitator.pl $KILL_SLEEP_TIME $TUP_SLEEP_TIME $MIN_KILL $MAX_KILL >${LOG_BASE}_tserver-agitator.out 2>${LOG_BASE}_tserver-agitator.err & - sudo -u $HDFS_USER nohup $CONTINUOUS_CONF_DIR/datanode-agitator.pl $KILL_SLEEP_TIME $TUP_SLEEP_TIME $HADOOP_PREFIX $MIN_KILL $MAX_KILL >${LOG_BASE}_datanode-agitator.out 2>${LOG_BASE}_datanode-agitator.err & + sudo -u $HDFS_USER nohup ${bin}/datanode-agitator.pl $KILL_SLEEP_TIME $TUP_SLEEP_TIME $HADOOP_PREFIX $MIN_KILL $MAX_KILL >${LOG_BASE}_datanode-agitator.out 2>${LOG_BASE}_datanode-agitator.err & else echo "Running master-agitator and tserver-agitator as $ACCUMULO_USER using sudo. Running datanode-agitator as $HDFS_USER using sudo." # Not root, and not the accumulo user, hope you can sudo to it - sudo -u $ACCUMULO_USER "nohup $CONTINUOUS_CONF_DIR/master-agitator.pl $MASTER_KILL_SLEEP_TIME $MASTER_RESTART_SLEEP_TIME >${LOG_BASE}_master-agitator.out 2>${LOG_BASE}_master-agitator.err &" + sudo -u $ACCUMULO_USER "nohup ${bin}/master-agitator.pl $MASTER_KILL_SLEEP_TIME $MASTER_RESTART_SLEEP_TIME >${LOG_BASE}_master-agitator.out 2>${LOG_BASE}_master-agitator.err &" - sudo -u $ACCUMULO_USER "nohup $CONTINUOUS_CONF_DIR/tserver-agitator.pl $KILL_SLEEP_TIME $TUP_SLEEP_TIME $MIN_KILL $MAX_KILL >${LOG_BASE}_tserver-agitator.out 2>${LOG_BASE}_tserver-agitator.err &" + sudo -u $ACCUMULO_USER "nohup ${bin}/tserver-agitator.pl $KILL_SLEEP_TIME $TUP_SLEEP_TIME $MIN_KILL $MAX_KILL >${LOG_BASE}_tserver-agitator.out 2>${LOG_BASE}_tserver-agitator.err &" - sudo -u $HDFS_USER "nohup $CONTINUOUS_CONF_DIR/datanode-agitator.pl $KILL_SLEEP_TIME $TUP_SLEEP_TIME $HADOOP_PREFIX $MIN_KILL $MAX_KILL >${LOG_BASE}_datanode-agitator.out 2>${LOG_BASE}_datanode-agitator.err &" -m - $HDFS_USER + sudo -u $HDFS_USER "nohup ${bin}/datanode-agitator.pl $KILL_SLEEP_TIME $TUP_SLEEP_TIME $HADOOP_PREFIX $MIN_KILL $MAX_KILL >${LOG_BASE}_datanode-agitator.out 2>${LOG_BASE}_datanode-agitator.err &" -m - $HDFS_USER fi if ${AGITATE_HDFS:-false} ; then AGITATOR_LOG="${LOG_BASE}_hdfs-agitator" - sudo -u $AGITATE_HDFS_SUPERUSER nohup $CONTINUOUS_CONF_DIR/hdfs-agitator.pl --sleep ${AGITATE_HDFS_SLEEP_TIME} --hdfs-cmd ${AGITATE_HDFS_COMMAND} --superuser ${AGITATE_HDFS_SUPERUSER} >${AGITATOR_LOG}.out 2>${AGITATOR_LOG}.err & + sudo -u $AGITATE_HDFS_SUPERUSER nohup ${bin}/hdfs-agitator.pl --sleep ${AGITATE_HDFS_SLEEP_TIME} --hdfs-cmd ${AGITATE_HDFS_COMMAND} --superuser ${AGITATE_HDFS_SUPERUSER} >${AGITATOR_LOG}.out 2>${AGITATOR_LOG}.err & fi http://git-wip-us.apache.org/repos/asf/accumulo/blob/d22bf18f/test/system/continuous/tserver-agitator.pl ---------------------------------------------------------------------- diff --git a/test/system/continuous/tserver-agitator.pl b/test/system/continuous/tserver-agitator.pl index befc097..b4ae653 100755 --- a/test/system/continuous/tserver-agitator.pl +++ b/test/system/continuous/tserver-agitator.pl @@ -24,8 +24,13 @@ if(scalar(@ARGV) != 4 && scalar(@ARGV) != 2){ exit(1); } -$cwd=Cwd::cwd(); -$ACCUMULO_HOME=$cwd . '/../../..'; +my $ACCUMULO_HOME; +if( defined $ENV{'ACCUMULO_HOME'} ){ + $ACCUMULO_HOME = $ENV{'ACCUMULO_HOME'}; +} else { + $cwd=Cwd::cwd(); + $ACCUMULO_HOME=$cwd . '/../../..'; +} print "ACCUMULO_HOME=$ACCUMULO_HOME\n";