Changeset 174
- Timestamp:
- Jun 10, 2010, 11:52:51 AM (15 years ago)
- Location:
- nutchez-0.2/src/test
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
nutchez-0.2/src/test/add_hosts
r172 r174 2 2 # Program: 3 3 # Add nutch_nodes to /etc/hosts (for nutchez management interface). 4 # $1=/home/nutchuser/nutch _nodes4 # $1=/home/nutchuser/nutchez/system/nutch_nodes 5 5 # $2=/etc/hosts 6 6 # Author: … … 38 38 done 39 39 40 # 附加 nutch_nodes 到 /etc/hosts 41 cp -f /etc/hosts /etc/hosts.bak 42 cat $1 | grep -v '#' >> $2 40 # Backup /etc/hosts 41 cp -f "$2" "$2.bak" 42 43 # attache nutch_nodes to hosts 44 sed -i '/# NutchEz add/d' $2 45 echo "# NutchEz add" >>$2 46 cat $1 | grep -v '#' >>$2 47 -
nutchez-0.2/src/test/duplicate_del
r172 r174 13 13 14 14 # 刪掉空白行 15 sed -i '/^$/d' $1 15 #sed -i '/^$/d' "$1" 16 16 17 17 cp -f "$1" "${1}.old" -
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.