Changeset 174 for nutchez-0.2/src/test/nutchez
- Timestamp:
- Jun 10, 2010, 11:52:51 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
nutchez-0.2/src/test/nutchez
r172 r174 64 64 $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" \ 65 65 --title "[Management Options]" \ 66 --menu "Plz choose: " 15 55 5 \ 66 --menu "Plz choose: " 15 55 6 \ 67 "cluster_status" "Check cluster status" \ 67 68 "cluster_setup" "Setup your datanode & tasktracker" \ 68 69 "tomcat_switch" "Start/Stop/Restart Tomcat" \ … … 70 71 "lang_switch" "Change language" \ 71 72 "exit" "Exit" 2>$main_choice 73 } 74 75 ## [Cluster Status (datanode & tasktracker)] ## 76 function cluster_status(){ 77 IP_list=$(cat $NutchEZ_HOME/system/nutch_nodes | grep -v '^$' | grep -v '#' | awk '{print $1}') 78 clusterStatus="/tmp/clusterStatus" 79 rm $clusterStatus 2> /dev/null 80 #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 82 echo -e "------------------------------------------------------------------------" >>$clusterStatus 83 echo -e "\nStart to check cluster..." 84 for ip in $IP_list 85 do 86 # Check Network status 87 ip_status="online" 88 ping -c1 -w1 $ip 2>&1 > /dev/null || ip_status="offline" 89 # Check Hadoop/Nutch service through ssh 90 Task_Data_status="stop" 91 if [ $ip_status == "online" ]; then 92 Task_Data=$(ssh -o StrictHostKeyChecking=no $ip "jps |grep TaskTracker ; jps | grep DataNode") 93 fi 94 95 # if [ $? == "255" ]; then 96 # echo -e "$ip Network is down" 97 # elif [ $? == "1" ]; then 98 # echo -e "Can't ssh to $ip" 99 # fi 100 101 [ -z $Task_Data ] || Task_Data_status="running" 102 host_name=$(cat $NutchEZ_HOME/system/nutch_nodes | grep $ip | awk '{print $2}') 103 echo -e "$ip $host_name \t\t $ip_status \t $Task_Data_status" >>$clusterStatus 104 # printf '%16s\t %11s\t %10s\t %25s\n' "$ip $host_name $ip_status $Task_Data_status" >>$clusterStatus 105 done 106 107 read -p "Plz input anykey to continue..." 108 $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" \ 109 --title "[Cluster Status]" --textbox $clusterStatus 20 90 72 110 } 73 111 … … 216 254 main_menu 217 255 case $(cat $main_choice) in 256 "cluster_status") 257 cluster_status;; 218 258 "cluster_setup") 219 259 cluster_setup;;
Note: See TracChangeset
for help on using the changeset viewer.