Ignore:
Timestamp:
Jun 8, 2010, 3:27:23 PM (14 years ago)
Author:
rock
Message:

管理介面初版完成

File:
1 edited

Legend:

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

    r162 r165  
    1818function prepare_check(){
    1919if [ ! -e /home/nutchuser/nutch_nodes ]; then
    20     $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "nutch_nodes Files:" \
    21     --msgbox "Fail: Don't find /home/nutchuser/nutch_nodes!!!" 10 40
     20    $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "[nutch_nodes Files]" \
     21    --msgbox "Fail: Don't find /home/nutchuser/nutch_nodes !!!" 10 40
    2222    exit
    2323fi
    2424
    25 $DIALOG --clear --defaultno --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "/etc/host Update" \
    26     --yesno "Do you want to update /etc/hosts!!!" 6 40
     25$DIALOG --clear --defaultno --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "[/etc/host Update]" \
     26    --yesno "Do you want to update \"/etc/hosts\" !!!\n(First time to execute it, please update)" 6 50
     27
    2728
    2829 if [ "$?" == "0" ]; then
    2930    ./duplicate_del /home/nutchuser/nutch_nodes
    30     echo -e "\nPlz input root password to modify /etc/hosts !!!"
    31     su root -c "./duplicate_del /etc/hosts"
    32     su root -c "./add_hosts /home/nutchuser/nutch_nodes /etc/hosts"
     31    echo -e "\nPlz input root password to update /etc/hosts !!!"
     32    su root -c "./duplicate_del /etc/hosts && ./add_hosts /home/nutchuser/nutch_nodes /etc/hosts"
    3333 fi
    3434
     
    4040
    4141$DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" \
    42     --title "management options" \
     42    --title "[Management Options]" \
    4343        --menu "Plz choose: " 15 55 5 \
    44         "cluster_setup" "Setup your datanode & tasknode" \
     44        "cluster_setup" "Setup your datanode & tasktracker" \
    4545        "tomcat_switch" "Start/Stop/Restart Tomcat" \
    4646        "tomcat_port" "Change Tomcat port" \
     
    4949}
    5050
    51 ## Cluster Setup (datanode & tasknode) ##
     51## Cluster Setup (datanode & tasktracker) ##
    5252function cluster_setup(){
    5353
     
    6060#echo $dataNodes
    6161clusterSetup="/tmp/clusterSetup"
    62 $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "Datanode & Tasktracker Setup" \
     62$DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "[Datanode & Tasktracker Setup]" \
    6363    --menu "Plz choose: " 10 65 3 \
    64     "start" "Start all datanodes & taskcrackers in cluster" \
    65     "stop" "Stop all datanodes & taskcrackers in cluster" \
     64    "start" "Start all datanodes & tasktrackers in cluster" \
     65    "stop" "Stop all datanodes & tasktrackers in cluster" \
    6666    "exit" "Exit" 2>$clusterSetup
    6767
     
    7070if [ "$(cat $clusterSetup)" == "start" ]; then
    7171    echo "/opt/nutchez/nutch/bin/hadoop-daemon.sh start datanode"
    72     echo "/opt/nutchez/nutch/bin/hadoop-daemon.sh start tasktracke"
     72    echo "/opt/nutchez/nutch/bin/hadoop-daemon.sh start tasktracker"
    7373    /opt/nutchez/nutch/bin/hadoop-daemon.sh start datanode
    7474    /opt/nutchez/nutch/bin/hadoop-daemon.sh start tasktracker
    7575    for node in $(echo $node_list)
    7676    do
    77         echo -e "ssh $node -c /opt/nutchez/nutch/bin/hadoop-daemon.sh start datanode"
    78 #        ssh $node -c "/opt/nutchez/nutch/bin/hadoop-daemon.sh start datanode"
    79         echo -e "ssh $node -c /opt/nutchez/nutch/bin/hadoop-daemon.sh start tasktracker"
    80 #        ssh $node -c "/opt/nutchez/nutch/bin/hadoop-daemon.sh start tasktracker"
     77        echo -e "ssh -o StrictHostKeyChecking=no $node /opt/nutchez/nutch/bin/hadoop-daemon.sh start datanode"
     78#        ssh -o StrictHostKeyChecking=no $node "/opt/nutchez/nutch/bin/hadoop-daemon.sh start datanode"
     79        echo -e "ssh -o StrictHostKeyChecking=no $node /opt/nutchez/nutch/bin/hadoop-daemon.sh start tasktracker"
     80#        ssh -o StrictHostKeyChecking=no $node "/opt/nutchez/nutch/bin/hadoop-daemon.sh start tasktracker"
    8181    done
    8282elif [ "$(cat $clusterSetup)" == "stop" ]; then
     
    8787    for node in $(echo $node_list)
    8888    do
    89         echo -e "ssh $node -c /opt/nutchez/nutch/bin/hadoop-daemon.sh stop datanode"
    90 #       ssh $node -c "/opt/nutchez/nutch/bin/hadoop-daemon.sh stop datanode"
    91         echo -e "ssh $node -c /opt/nutchez/nutch/bin/hadoop-daemon.sh stop tasktracker"
    92 #       ssh $node -c "/opt/nutchez/nutch/bin/hadoop-daemon.sh stop tasktracker"
     89        echo -e "ssh -o StrictHostKeyChecking=no $node /opt/nutchez/nutch/bin/hadoop-daemon.sh stop datanode"
     90#       ssh -o StrictHostKeyChecking=no $node "/opt/nutchez/nutch/bin/hadoop-daemon.sh stop datanode"
     91        echo -e "ssh -o StrictHostKeyChecking=no $node /opt/nutchez/nutch/bin/hadoop-daemon.sh stop tasktracker"
     92#       ssh -o StrictHostKeyChecking=no $node "/opt/nutchez/nutch/bin/hadoop-daemon.sh stop tasktracker"
    9393    done
    9494else
     
    103103#read
    104104if [ -n "$pid_tc" ]; then
    105     $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "Tomcat Status" \
    106         --msgbox "Tomcat is runing in this system!!!" 7 50
     105    $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "[Tomcat Status]" \
     106        --msgbox "Tomcat is runing in this system !!!" 7 50
    107107else
    108     $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "Tomcat Status" \
    109         --msgbox "Tomcat is not running in this system!!!" 7 50
     108    $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "[Tomcat Status]" \
     109        --msgbox "Tomcat is not running in this system !!!" 7 50
    110110fi
    111111tomcatSwitch="/tmp/tomcatSwitch"
    112 $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "Tomcat Service Options" \
     112$DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "[Tomcat Service Options]" \
    113113    --menu "Plz choose: " 15 55 4 \
    114114        "start" "Start tomcat" \
     
    136136
    137137if [ ! -e /opt/nutchez/tomcat/conf/server.xml ]; then
    138     $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "Tomcat Servel.xml" \
     138    $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "[Tomcat Servel.xml]" \
    139139        --msgbox "Fial: Don't find /opt/nutchez/tomcat/conf/server.xml !!!" 10 50
    140140    exit
    141141fi
    142142tomcatPort="/tmp/tomcatPort"
    143 $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC  = " --title "Tomcat Port Change" \
     143$DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC  = " --title "[Tomcat Port Change]" \
    144144    --inputbox "Plz input port number for tomcat (default is 8080)" 10 55 2>$tomcatPort
    145145
     
    157157echo -e "lang_switch"
    158158langSwitch="/tmp/langSwitch"
    159 $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC  =" --title "Language Change" \
     159$DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC  =" --title "[Language Swaitch]" \
    160160    --menu "Plz choose: " 15 55 3 \
    161161    "English" "English" \
Note: See TracChangeset for help on using the changeset viewer.