Changeset 176 for nutchez-0.2/src


Ignore:
Timestamp:
Jun 10, 2010, 1:27:27 PM (14 years ago)
Author:
rock
Message:

修改路徑

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nutchez-0.2/src/test/nutchez

    r175 r176  
    1515# [PATH Declaration] #
    1616NutchEZ_Install_PATH=/opt/nutchez
     17Tomcat_HOME=/opt/nutchez/tomcat
    1718NutchEZ_HOME=/home/nutchuser/nutchez
    1819
     
    5556    fi
    5657fi
    57 
    5858}
    5959
     
    7979rm $clusterStatus 2> /dev/null
    8080#printf '%16s\t %11s\t %10s\t %25s\n' "[IP] [Hostanme] [Network] [Dtatnode & Tasktracker]" >>$clusterStatus
    81 echo -e "[IP] \t\t [Hostanme] \t [Network] \t [Dtatnode & Tasktracker]" >>$clusterStatus
     81echo -e "[IP] \t\t [Hostname] \t [Network] \t [Dtatnode & Tasktracker]" >>$clusterStatus
    8282echo -e "------------------------------------------------------------------------" >>$clusterStatus
    8383echo -e "\nStart to check cluster..."
     
    136136
    137137$DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "[Datanode & Tasktracker Setup]" \
    138     --menu "Plz choose: " 10 65 3 \
     138    --menu "Plz choose: " 15 65 4 \
    139139    "start" "Start datanodes & tasktrackers" \
    140140    "stop" "Stop datanodes & tasktrackers" \
     
    143143
    144144if [ "$(cat $clusterSetup)" == "start" ]; then
     145    echo -e "\n[Start datanode & tasktracker]"
    145146    for node in $(cat $runNodes)
    146147    do
    147         echo -e "start !"
    148         echo -e "ssh -o StrictHostKeyChecking=no $node /opt/nutchez/nutch/bin/hadoop-daemon.sh start datanode"
    149         ssh -o StrictHostKeyChecking=no $node "/opt/nutchez/nutch/bin/hadoop-daemon.sh start datanode"
    150         echo -e "ssh -o StrictHostKeyChecking=no $node /opt/nutchez/nutch/bin/hadoop-daemon.sh start tasktracker"
    151         ssh -o StrictHostKeyChecking=no $node "/opt/nutchez/nutch/bin/hadoop-daemon.sh start tasktracker"
     148        echo -e "start $node datanode & tasktracker !"
     149        ssh -o StrictHostKeyChecking=no $node "$NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh start datanode \
     150        ; $NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh start tasktracker"
    152151        [ $? == "0" ] || echo "Can't ssh to $node !!!"
    153152    done
    154153elif [ "$(cat $clusterSetup)" == "stop" ]; then
     154    echo -e "\n[Stop datanode & tasktracker]"
    155155    for node in $(cat $runNodes)
    156156    do
    157         echo -e "stop !"
    158         echo -e "ssh -o StrictHostKeyChecking=no $node /opt/nutchez/nutch/bin/hadoop-daemon.sh stop datanode"
    159         ssh -o StrictHostKeyChecking=no $node "/opt/nutchez/nutch/bin/hadoop-daemon.sh stop datanode"
    160         echo -e "ssh -o StrictHostKeyChecking=no $node /opt/nutchez/nutch/bin/hadoop-daemon.sh stop tasktracker"
    161         ssh -o StrictHostKeyChecking=no $node "/opt/nutchez/nutch/bin/hadoop-daemon.sh stop tasktracker"
     157        echo -e "stop $node datanode & tasktracker !"
     158        ssh -o StrictHostKeyChecking=no $node "$NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh stop datanode \
     159        ; $NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh stop tasktracker"
    162160        [ $? == "0" ] || echo "Can't ssh to $node !!!"
    163161    done
    164162else
     163    echo -e "\n[Restart datanode & tasktracker]"
    165164    for node in $(cat $runNodes)
    166165    do 
    167         echo -e "restart !"
    168         ssh -o StrictHostKeyChecking=no $node "/opt/nutchez/nutch/bin/hadoop-daemon.sh stop datanode"
    169         ssh -o StrictHostKeyChecking=no $node "/opt/nutchez/nutch/bin/hadoop-daemon.sh stop tasktracker"
    170         ssh -o StrictHostKeyChecking=no $node "/opt/nutchez/nutch/bin/hadoop-daemon.sh start datanode"
    171         ssh -o StrictHostKeyChecking=no $node "/opt/nutchez/nutch/bin/hadoop-daemon.sh start tasktracker"
     166        echo -e "restart $node datanode & tasktracker !"
     167        ssh -o StrictHostKeyChecking=no $node "$NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh stop datanode \
     168        ; $NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh stop tasktracker"
     169        ssh -o StrictHostKeyChecking=no $node "$NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh start datanode \
     170        ; $NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh start tasktracker"
    172171        [ $? == "0" ] || echo "Can't ssh to $node !!!"
    173172    done
     
    197196
    198197if [ "$(cat $tomcatSwitch)" == "start" ]; then
    199     echo "/opt/nutchez/tomcat/bin/startup.sh"
    200     /opt/nutchez/tomcat/bin/startup.sh
     198    echo "$Tomcat_HOME/bin/startup.sh"
     199    $Tomcat_HOME/bin/startup.sh
    201200elif [ "$(cat $tomcatSwitch)" == "stop" ]; then
    202     echo "/opt/nutchez/tomcat/bin/shutdown.sh"
    203     /opt/nutchez/tomcat/bin/shutdown.sh
     201    echo "$Tomcat_HOME/bin/shutdown.sh"
     202    $Tomcat_HOME/bin/shutdown.sh
    204203elif [ "$(cat $tomcatSwitch)" == "restart" ]; then
    205     echo "/opt/nutchez/tomcat/bin/restart.sh"
    206     /opt/nutchez/tomcat/bin/shutdown.sh
    207     /opt/nutchez/tomcat/bin/startup.sh
     204    echo "$Tomcat_HOME/bin/restart.sh"
     205    $Tomcat_HOME/bin/shutdown.sh
     206    $Tomcat_HOME/bin/startup.sh
    208207else
    209208    exit 0
     
    214213function tomcat_port(){
    215214
    216 if [ ! -e /opt/nutchez/tomcat/conf/server.xml ]; then
     215if [ ! -e $Tomcat_HOME/conf/server.xml ]; then
    217216    $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "[Tomcat Servel.xml]" \
    218         --msgbox "Fial: Don't find /opt/nutchez/tomcat/conf/server.xml !!!" 10 50
     217        --msgbox "Fial: Don't find $Tomcat_HOME/conf/server.xml !!!" 10 50
    219218    exit
    220219fi
     
    226225    exit
    227226else
    228     modify_line_nu=$(cat -n /opt/nutchez/tomcat/conf/server.xml | grep -v SSL | grep 'HTTP/1.1' | grep '<Connector' | awk '{print $1}')
    229     sed -i "${modify_line_nu}c <Connector port="$tomcatPort" protocol="HTTP/1.1"" /opt/nutchez/tomcat/conf/server.xml
    230 fi
     227    modify_line_nu=$(cat -n $Tomcat_HOME/conf/server.xml | grep -v SSL | grep 'HTTP/1.1' | grep '<Connector' | awk '{print $1}')
     228    sed -i "${modify_line_nu}c <Connector port="$tomcatPort" protocol="HTTP/1.1"" $Tomcat_HOME/conf/server.xml
     229    $Tomcat_HOME/bin/shutdown.sh
     230    $Tomcat_HOME/bin/startup.sh
     231fi
     232
     233
    231234}
    232235
Note: See TracChangeset for help on using the changeset viewer.