Changeset 203 for nutchez-0.2/src
- Timestamp:
- Jun 17, 2010, 4:51:05 PM (14 years ago)
- Location:
- nutchez-0.2/src/test
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
nutchez-0.2/src/test/client_remove.sh
r200 r203 46 46 # shutdown service 47 47 function shutdown_service () { 48 show_info $shutdown_service_echo_1# "關閉本機服務..."48 show_info "$shutdown_service_echo_1" # "關閉本機服務..." 49 49 su nutchuser -c "/opt/nutchez/nutch/bin/hadoop-daemon.sh stop datanode" 50 50 su nutchuser -c "/opt/nutchez/nutch/bin/hadoop-daemon.sh stop tasktracker" 51 show_info $shutdown_service_echo_2# "本機服務已關閉"51 show_info "$shutdown_service_echo_2" # "本機服務已關閉" 52 52 } 53 53 54 54 # 移除檔案及資料夾 55 55 function remove_folders () { 56 show_info $remove_folders_echo_1# "正在刪除安裝時所建立的檔案及資料夾..."56 show_info "$remove_folders_echo_1" # "正在刪除安裝時所建立的檔案及資料夾..." 57 57 rm -rf /opt/nutchez/* 58 58 rm -rf /var/nutchez/* 59 show_info $remove_folders_echo_2# "安裝時所建立的檔案及資料夾已刪除"59 show_info "$remove_folders_echo_2" # "安裝時所建立的檔案及資料夾已刪除" 60 60 } 61 61 … … 63 63 # 還原/etc/hosts 64 64 function edit_hosts () { 65 show_info $edit_hosts_echo_1# "修改/etc/hosts..."65 show_info "$edit_hosts_echo_1" # "修改/etc/hosts..." 66 66 Line_NO=`cat /etc/hosts | grep -n $Master_IP_Address | sed 's/:.*//g'` 67 67 sed -i ''$Line_NO'd' /etc/hosts 68 show_info $edit_hosts_echo_2# "完成修改/etc/hosts"68 show_info "$edit_hosts_echo_2" # "完成修改/etc/hosts" 69 69 } 70 70 … … 72 72 # 移除使用者 73 73 function user_delete () { 74 show_info $user_delete_echo_1# "正在刪除nutchuser使用者..."74 show_info "$user_delete_echo_1" # "正在刪除nutchuser使用者..." 75 75 userdel -r nutcheruser 76 show_info $user_delete_echo_2# "使用者nutchuser已刪除"76 show_info "$user_delete_echo_2" # "使用者nutchuser已刪除" 77 77 } 78 78 79 79 # Main function 80 80 function main () { 81 show_info $main_echo_1#"警告 - 此一程式為移除此用戶端的nutch node, 若您為誤執行此一程式, 請按Ctrl+c離開此程序!"82 show_info $main_echo_2#"本執行程序將會移除安裝nutchEZ時所新增的檔案及nutchuser使用者帳號"81 show_info "$main_echo_1" #"警告 - 此一程式為移除此用戶端的nutch node, 若您為誤執行此一程式, 請按Ctrl+c離開此程序!" 82 show_info "$main_echo_2" #"本執行程序將會移除安裝nutchEZ時所新增的檔案及nutchuser使用者帳號" 83 83 # 詢問是否繼續 84 84 read -p "$main_echo_3" confirm # "請問是否確定移除此一節點:1.確定 2.取消" … … 90 90 edit_hosts 91 91 user_delete 92 show_info $main_echo_4# "移除程序已完成!"92 show_info "$main_echo_4" # "移除程序已完成!" 93 93 elif [ $confirm -eq 2 ]; then 94 show_info $main_echo_5# "您已取消移除程序!"95 show_info $main_echo_6# "若要移除請再重新執行!"94 show_info "$main_echo_5" # "您已取消移除程序!" 95 show_info "$main_echo_6" # "若要移除請再重新執行!" 96 96 fi 97 97 } -
nutchez-0.2/src/test/install_func.sh
r199 r203 234 234 else 235 235 declare -i i=1 236 show_info $select_eth_echo_1236 show_info "$select_eth_echo_1" 237 237 # show_info "\nSystem have multiple network device, which network use for this machine: " 238 238 … … 242 242 i=i+1 243 243 done 244 read -p "$select_eth_echo_2 244 read -p "$select_eth_echo_2" net_choice 245 245 # read -p "Please choice(1/2/3...): " net_choice 246 246 if [ -z $net_choice ]; then … … 248 248 fi 249 249 250 show_info $select_eth_echo_3250 show_info "$select_eth_echo_3" 251 251 # show_info "Your choice is $net_choice" 252 252 net_interface=$(echo $net_interfaces | cut -d " " -f $net_choice) … … 255 255 net_MacAddr=$(ifconfig $net_interface | grep 'HW' | sed 's/^.*HWaddr //g') 256 256 257 show_info $select_eth_echo_4257 show_info "$select_eth_echo_4" 258 258 # show_info "net_address is $net_address" 259 show_info $select_eth_echo_5259 show_info "$select_eth_echo_5" 260 260 # show_info "net_MacAddr is $net_MacAddr" 261 261 fi … … 269 269 270 270 function make_ssh_key () { 271 debug_info $make_ssh_key_echo_1271 debug_info "$make_ssh_key_echo_1" 272 272 # debug_info "Make ssh key(begin...)" 273 273 su nutchuser -c 'ssh-keygen -t rsa -f ~/.ssh/id_rsa -P ""' 274 274 su nutchuser -c "cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys" 275 275 su nutchuser -c "ssh-add /home/nutchuser/.ssh/id_rsa" 276 debug_info $make_ssh_key_echo_2276 debug_info "$make_ssh_key_echo_2" 277 277 # debug_info "Make ssh key(done!)" 278 278 } … … 280 280 281 281 function set_haoop-site () { 282 debug_info $set_haoop_site_echo_1282 debug_info "$set_haoop_site_echo_1" 283 283 # debug_info "set hadoop-site.xml(begin...)" 284 284 cd $Nutch_HOME/conf/ … … 299 299 </configuration> 300 300 EOF 301 debug_info $set_haoop_site_echo_2301 debug_info "$set_haoop_site_echo_2" 302 302 # debug_info "set hadoop-site.xml(done!)" 303 303 } … … 305 305 # 修改nutch-site.xml中-http.agent.url, http.agent.email 306 306 function set_nutch-site () { 307 debug_info $set_haoop_site_echo_1307 debug_info "$set_haoop_site_echo_1" 308 308 # debug_info "set nutch-site.xml(begin...)" 309 309 Line_NO=`cat $Nutch_HOME'/conf/nutch-site.xml' | grep -n 'http.agent.url' | sed 's/:.*//g'` 310 debug_info $set_haoop_site_echo_2310 debug_info "$set_haoop_site_echo_2" 311 311 # debug_info "debug...http.agent.url line number = $Line_NO..." 312 312 sed -i ''$((Line_NO+1))'d' $Nutch_HOME/conf/nutch-site.xml 313 debug_info $set_haoop_site_echo_3313 debug_info "$set_haoop_site_echo_3" 314 314 # debug_info "debug...edit http.agent.url delete line $((Line_NO+1))..." 315 315 sed -i ''$Line_NO'a <value>'$MasterIP_Address'</value>' $Nutch_HOME/conf/nutch-site.xml 316 debug_info $set_haoop_site_echo_4316 debug_info "$set_haoop_site_echo_4" 317 317 # debug_info "debug...edit http.agent.url done..." 318 318 319 319 Line_NO=`cat $Nutch_HOME'/conf/nutch-site.xml' | grep -n 'http.agent.email' | sed 's/:.*//g'` 320 debug_info $set_haoop_site_echo_5320 debug_info "$set_haoop_site_echo_5" 321 321 # debug_info "debug...http.agent.email line number = $Line_NO..." 322 322 323 323 sed -i ''$((Line_NO+1))'d' $Nutch_HOME/conf/nutch-site.xml 324 debug_info $set_haoop_site_echo_6324 debug_info "$set_haoop_site_echo_6" 325 325 # debug_info "debug...edit http.agent.email delete line $((Line_NO+1))..." 326 326 sed -i ''$Line_NO'a <value>'$Admin_email'</value>' $Nutch_HOME/conf/nutch-site.xml 327 debug_info $set_haoop_site_echo_7327 debug_info "$set_haoop_site_echo_7" 328 328 # debug_info "debug...edit http.agent.email done..." 329 debug_info $set_haoop_site_echo_8329 debug_info "$set_haoop_site_echo_8" 330 330 # debug_info "set nutch-site.xml(done!)" 331 331 } 332 332 333 333 function format_HDFS () { 334 debug_info $format_HDFS_echo_1334 debug_info "$format_HDFS_echo_1" 335 335 su nutchuser -c "$Nutch_HOME/bin/hadoop namenode -format" 336 debug_info $format_HDFS_echo_2336 debug_info "$format_HDFS_echo_2" 337 337 } 338 338 339 339 function start_up_NutchEZ (){ 340 debug_info $start_up_NutchEZ_echo_1340 debug_info "$start_up_NutchEZ_echo_1" 341 341 # debug_info "start up NutchEZ..." 342 342 su nutchuser -c "$Nutch_HOME/bin/start-all.sh" … … 345 345 346 346 function set_hosts () { 347 debug_info $set_hosts_echo_1347 debug_info "$set_hosts_echo_1" 348 348 Line_NO=`cat /etc/hosts | grep -n $(hostname) | sed 's/:.*//g'` 349 349 content=$(cat /etc/hosts | awk 'NR=='$Line_NO'{printf "# " ; print}' ) … … 353 353 354 354 function Install_Nutch () { 355 debug_info $install_Nutch_echo_1355 debug_info "$install_Nutch_echo_1" 356 356 # debug_info "MasterIP_Address=$MasterIP_Address" 357 debug_info $install_Nutch_echo_2357 debug_info "$install_Nutch_echo_2" 358 358 # debug_info "Master_Hostname=$(hostname)" 359 359 su nutchuser -c "echo $net_address $(hostname) $net_MacAddr \>\> ~/nutchez/system/nutch_nodes" … … 367 367 cd $Start_PATH 368 368 Line_NO=`cat client_install | grep -n '# Master IP here' | sed 's/:.*//g'` 369 debug_info $client_PassMasterIPAddr_echo_1369 debug_info "$client_PassMasterIPAddr_echo_1" 370 370 # debug_info "debug...Master IP here line number = $Line_NO..." 371 371 sed -i ''$((Line_NO+1))'d' client_install 372 debug_info $client_PassMasterIPAddr_echo_2372 debug_info "$client_PassMasterIPAddr_echo_2" 373 373 # debug_info "debug...edit Master IP at line $((Line_NO+1))..." 374 374 sed -i ''$Line_NO'a Master_IP_Address='$MasterIP_Address'' client_install 375 debug_info $client_PassMasterIPAddr_echo_3375 debug_info "$client_PassMasterIPAddr_echo_3" 376 376 # debug_info "edit client_install done..." 377 377 } … … 381 381 cd $Start_PATH 382 382 Line_NO=`cat client_install | grep -n '# Master Hostname here' | sed 's/:.*//g'` 383 debug_info $client_PassMaster_Hostname_echo_1383 debug_info "$client_PassMaster_Hostname_echo_1" 384 384 # debug_info "debug...Master hostname here line number = $Line_NO..." 385 385 sed -i ''$((Line_NO+1))'d' client_install 386 debug_info $client_PassMaster_Hostname_echo_2386 debug_info "$client_PassMaster_Hostname_echo_2" 387 387 # debug_info "debug...edit Master Hostname at line $((Line_NO+1))..." 388 388 sed -i ''$Line_NO'a Master_Hostname='$(hostname)'' client_install 389 debug_info $client_PassMaster_Hostname_echo_3389 debug_info "$client_PassMaster_Hostname_echo_3" 390 390 # debug_info "edit client_install done..." 391 391 } … … 399 399 # 打包安裝目錄(不含tomcat) 400 400 401 debug_info $make_client_install_echo_1401 debug_info "$make_client_install_echo_1" 402 402 # debug_info "function make_client_install..." 403 403 … … 413 413 414 414 function start_up_tomcat () { 415 debug_info $start_up_tomcat_echo_1415 debug_info "$start_up_tomcat_echo_1" 416 416 # debug_info "start up tomcat..." 417 417 … … 420 420 do 421 421 sleep 1s 422 debug_info $start_up_tomcat_echo_2422 debug_info "$start_up_tomcat_echo_2" 423 423 # debug_info "wait $i sec..." 424 424 i=`expr $i - 1` 425 425 done 426 426 su nutchuser -c "$Tomcat_HOME/bin/startup.sh" 427 debug_info $start_up_tomcat_echo_3427 debug_info "$start_up_tomcat_echo_3" 428 428 # debug_info "tomcat has been started..." 429 429 } … … 432 432 # client簡易步驟 433 433 function client_install_commands () { 434 show_info $client_install_commands_echo_1435 show_info $client_install_commands_echo_2436 show_info $client_install_commands_echo_3437 show_info $client_install_commands_echo_4438 show_info $client_install_commands_echo_5439 show_info $client_install_commands_echo_6440 show_info $client_install_commands_echo_7434 show_info "$client_install_commands_echo_1" 435 show_info "$client_install_commands_echo_2" 436 show_info "$client_install_commands_echo_3" 437 show_info "$client_install_commands_echo_4" 438 show_info "$client_install_commands_echo_5" 439 show_info "$client_install_commands_echo_6" 440 show_info "$client_install_commands_echo_7" 441 441 442 442 -
nutchez-0.2/src/test/lang_zh_TW_client_install
r195 r203 13 13 par_echo_1="Master 的 IP位址: " 14 14 par_echo_2="資料是否正確 (yes/no): " 15 par_echo_3="資料是正 錯的"15 par_echo_3="資料是正確的" 16 16 par_echo_4="請修改為正確的參數" 17 17 -
nutchez-0.2/src/test/lang_zh_TW_client_remove
r200 r203 30 30 31 31 # main 32 main_echo_1="警告 -此一程式為移除此用戶端的nutch node, 若您為誤執行此一程式, 請按Ctrl+c離開此程序!"32 main_echo_1="警告-此一程式為移除此用戶端的nutch node, 若您為誤執行此一程式, 請按Ctrl+c離開此程序!" 33 33 main_echo_2="本執行程序將會移除安裝nutchEZ時所新增的檔案及nutchuser使用者帳號。" 34 34 main_echo_3="請問是否確定移除此一節點:1.確定 2.取消" -
nutchez-0.2/src/test/master_remove.sh
r202 r203 41 41 # shutdown service 42 42 function shutdown_service () { 43 show_info $shutdown_service_echo_1# "停止其他尚未關閉的slaves服務..."43 show_info "$shutdown_service_echo_1" # "停止其他尚未關閉的slaves服務..." 44 44 slaves_list=`cat $nutch_PATH'/nutch_nodes' | cut -d' ' -f1` 45 45 for nutch_node in $slaves_list … … 48 48 su nutchuser -c "ssh nutchuser@$nutch_node /opt/nutchez/nutch/bin/hadoop-daemon.sh stop tasktracker" 49 49 done 50 show_info $shutdown_service_echo_2# "關閉本機服務..."50 show_info "$shutdown_service_echo_2" # "關閉本機服務..." 51 51 su nutchuser -c "/opt/nutchez/nutch/bin/stop-all.sh" 52 show_info $shutdown_service_echo_3# "本機服務已關閉"52 show_info "$shutdown_service_echo_3" # "本機服務已關閉" 53 53 } 54 54 55 55 # 移除檔案及資料夾 56 56 function remove_folders () { 57 show_info $remove_folders_echo_1# "正在刪除安裝時所建立的檔案及資料夾..."57 show_info "$remove_folders_echo_1" # "正在刪除安裝時所建立的檔案及資料夾..." 58 58 rm -rf /opt/nutchez/* 59 59 rm -rf /var/nutchez/* 60 show_info $remove_folders_echo_2# "安裝時所建立的檔案及資料夾已刪除"60 show_info "$remove_folders_echo_2" # "安裝時所建立的檔案及資料夾已刪除" 61 61 } 62 62 … … 64 64 # 還原/etc/hosts 65 65 function edit_hosts () { 66 show_info $edit_hosts_echo_1# "修改/etc/hosts..."66 show_info "$edit_hosts_echo_1" # "修改/etc/hosts..." 67 67 68 68 slaves_list=`cat $nutch_PATH'/nutch_nodes' | cut -d' ' -f1` … … 72 72 sed -i ''$Line_NO'd' /etc/hosts 73 73 done 74 show_info $edit_hosts_echo_2# "完成修改/etc/hosts"74 show_info "$edit_hosts_echo_2" # "完成修改/etc/hosts" 75 75 } 76 76 77 77 # 移除使用者 78 78 function user_delete () { 79 show_info $user_delete_echo_1# "正在刪除nutchuser使用者..."79 show_info "$user_delete_echo_1" # "正在刪除nutchuser使用者..." 80 80 userdel -r nutcheruser 81 show_info $user_delete_echo_2# "使用者nutchuser已刪除"81 show_info "$user_delete_echo_2" # "使用者nutchuser已刪除" 82 82 } 83 83 84 84 # Main function 85 85 function main () { 86 show_info $main_echo_1#"警告 - 此一程式為移除nutchEZ程式, 若您為誤執行此一程式, 請按Ctrl+c離開此程序!"87 show_info $main_echo_2#"本執行程序將會移除安裝nutchEZ時所新增的檔案及nutchuser使用者帳號"86 show_info "$main_echo_1" #"警告 - 此一程式為移除nutchEZ程式, 若您為誤執行此一程式, 請按Ctrl+c離開此程序!" 87 show_info "$main_echo_2" #"本執行程序將會移除安裝nutchEZ時所新增的檔案及nutchuser使用者帳號" 88 88 # 詢問是否繼續 89 89 read -p "$main_echo_3" confirm # "請問是否確定移除此一節點:1.確定 2.取消" … … 95 95 edit_hosts 96 96 user_delete 97 show_info $main_echo_4# "移除程序已完成!"97 show_info "$main_echo_4" # "移除程序已完成!" 98 98 elif [ $confirm -eq 2 ]; then 99 show_info $main_echo_5# "您已取消移除程序!"100 show_info $main_echo_6# "若要移除請再重新執行!"99 show_info "$main_echo_5" # "您已取消移除程序!" 100 show_info "$main_echo_6" # "若要移除請再重新執行!" 101 101 fi 102 102 }
Note: See TracChangeset
for help on using the changeset viewer.