Changeset 183


Ignore:
Timestamp:
Jun 11, 2010, 6:07:06 PM (14 years ago)
Author:
rock
Message:

新增 NameNodeJobTracker 功能

File:
1 edited

Legend:

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

    r182 r183  
    6464$DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" \
    6565    --title "[Management Options]" \
    66         --menu "Plz choose: " 15 60 6 \
     66        --menu "Plz choose: " 15 60 7 \
    6767        "cluster_status" "Check cluster status" \
    68         "cluster_setup" "Setup your datanode & tasktracker" \
     68        "server_setup" "Setup namenode & jobtracker" \
     69        "cluster_setup" "Setup datanode & tasktracker" \
    6970        "tomcat_switch" "Start/Stop/Restart Tomcat" \
    7071        "tomcat_port" "Change Tomcat port" \
     
    109110     --title "[Cluster Status]" --textbox $clusterStatus 20 90
    110111}
     112
     113
     114## [Cluster Setup (namenode & jobtracker)] ##
     115function server_setup(){
     116serverSetup=/tmp/serverSetup
     117pid_name=$(jps | grep NameNode)
     118pid_job=$(jps | grep JobTracker)
     119
     120if [ -z "$pid_name" -a -z "$pid_job" ]; then                                                                                               
     121    $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "[Server Status]" \
     122    --msgbox "Namenode & Jobtracker are not running" 7 50
     123elif [ -z "$pid_name" -a -n "$pid_job" ]; then
     124    $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "[Server Status]" \
     125    --msgbox "Jobtracker is running, Namenode is not running" 7 50
     126elif [ -n "$pid_name" -a -z "$pid_job" ]; then
     127    $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "[Server Status]" \
     128    --msgbox "Namenode is running, Jobtracker is not running" 7 50
     129else
     130    $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "[Server Status]" \
     131    --msgbox "Namenode & Jobtracker are running" 7 50
     132fi
     133
     134$DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" --title "[Namenode & Jobtracker Setup]" \
     135    --menu "Plz choose: " 15 65 4 \
     136    "start" "Start namenode & jobtracker" \
     137    "stop" "Stop namenode & jobtracker" \
     138    "restart" "restart namenode & jobtracker" \
     139    "exit" "Exit" 2>$serverSetup
     140
     141if [ "$(cat $serverSetup)" == "start" ]; then
     142    $NutchEZ_Install_PATH/nutch/bin/start-dfs.sh
     143    $NutchEZ_Install_PATH/nutch/bin/start-mapred.sh
     144elif [ "$(cat $serverSetup)" == "stop" ]; then
     145    $NutchEZ_Install_PATH/nutch/bin/stop-dfs.sh
     146    $NutchEZ_Install_PATH/nutch/bin/stop-mapred.sh
     147elif [ "$(cat $serverSetup)" == "restart" ]; then
     148    $NutchEZ_Install_PATH/nutch/bin/stop-dfs.sh
     149    $NutchEZ_Install_PATH/nutch/bin/stop-mapred.sh
     150    $NutchEZ_Install_PATH/nutch/bin/start-dfs.sh
     151    $NutchEZ_Install_PATH/nutch/bin/start-mapred.sh
     152else
     153    exit
     154fi
     155
     156
     157}
     158
    111159
    112160## [Cluster Setup (datanode & tasktracker)] ##
     
    289337    "cluster_status")
    290338        cluster_status;;
     339    "server_setup")   
     340        server_setup;;
    291341    "cluster_setup")
    292342        cluster_setup;;
Note: See TracChangeset for help on using the changeset viewer.