Apache Hadoop

Shell Script

본 토픽은 현재 준비중입니다.공동공부에 참여하시면 완성 되었을 때 알려드립니다.
   sudo -u dbeorud nano ha.sh   
 
=========================================================================
 
#!/bin/bash
 
while [ $? == 0 ]
do
        cd /home/dbeorud/hadoop-1.0.3/bin
    rm -r localoutput
    sleep 2
        ./stop-all.sh
        echo "****************************** Stoped Hadoop **********"
        sleep 2
        ./start-all.sh
    /home/dbeorud/hadoop-1.0.3/bin/hadoop dfsadmin -safemode leave
        echo "****************************** Started Hadoop**********"
        sleep 2
        jps
    
    /home/dbeorud/hadoop-1.0.3/bin/hadoop fs -rmr /input
        /home/dbeorud/hadoop-1.0.3/bin/hadoop fs -rmr output
        echo "****************************** Deleted Input/Output**********"
        sleep 2
        /home/dbeorud/hadoop-1.0.3/bin/hadoop fs -mkdir /input
        echo "****************************** Made Input**********"
        sleep 2
        cut -f1-3 ub.base | tr '\tr' ',' > ub.base.hadoop
        /home/dbeorud/hadoop-1.0.3/bin/hadoop fs -put ub.base.hadoop /input
        /home/dbeorud/hadoop-1.0.3/bin/hadoop fs -ls /input
        sleep 5
        /home/dbeorud/hadoop-1.0.3/bin/hadoop jar /home/dbeorud/mahout-distribution-0.5/core/target/mahout-core-0.5-job.jar org.apache.mahout.cf.taste.hadoop.pseudo.RecommenderJob -Dmapred.input.dir=/input/ub.base.hadoop -Dmapred.output.dir=output --recommenderClassName org.apache.mahout.cf.taste.impl.recommender.slopeone.SlopeOneRecommender
        echo "****************************** Made Recommend**********"
        sleep 2
        /home/dbeorud/hadoop-1.0.3/bin/hadoop fs -ls output
        /home/dbeorud/hadoop-1.0.3/bin/hadoop fs -text /user/dbeorud/output/part-r-00000.gz
        echo "****************************** Read Part-r-0000**********"
        sleep 2
 
    /home/dbeorud/hadoop-1.0.3/bin/hadoop fs -copyToLocal output localoutput
        echo "****************************** Moved Part-r-00000.gz File**********"
        sleep 2
        cd /home/dbeorud/hadoop-1.0.3/bin/localoutput
        gzip -d part-r-00000.gz
        echo "****************************** Unziped File***********"
    ls -al
    sleep 10
done
 
=========================================================================
 
   su dbeorud ./ha.sh   
  • 봤어요 0명

댓글

댓글 본문