Changeset 206 for nutchez-0.2/src
- Timestamp:
- Jun 18, 2010, 2:00:28 PM (14 years ago)
- Location:
- nutchez-0.2/src/test
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
nutchez-0.2/src/test/client_remove.sh
r205 r206 53 53 function remove_folders () { 54 54 show_info "$remove_folders_echo_1" # "正在刪除安裝時所建立的檔案及資料夾..." 55 rm -rf /opt/nutchez /*56 rm -rf /var/nutchez /*55 rm -rf /opt/nutchez 56 rm -rf /var/nutchez 57 57 show_info "$remove_folders_echo_2" # "安裝時所建立的檔案及資料夾已刪除" 58 58 } … … 73 73 function user_delete () { 74 74 show_info "$user_delete_echo_1" # "正在刪除nutchuser使用者..." 75 userdel -r nutch eruser75 userdel -r nutchuser 76 76 show_info "$user_delete_echo_2" # "使用者nutchuser已刪除" 77 77 } -
nutchez-0.2/src/test/install
r199 r206 28 28 main () { 29 29 check_info 30 show_info $main_echo_130 show_info "$main_echo_1" 31 31 # show_info "歡迎使用NutchEZ, 此安裝程序會為您新建一個nutchuser帳號並協助您設定密碼" 32 32 set_install_information 33 show_master_info 33 34 read -p "$main_echo_2" confirm 34 35 # read -p "Please confirm your install infomation: 1.Yes 2.No " confirm … … 36 37 creat_nutchuser_account $Nutchuser_Passwd 37 38 make_ssh_key 38 39 39 # 解壓縮 40 40 tar -zxvf nutchezV2-current.tar.gz -C /opt/ 41 41 42 Install_Nutch 43 42 44 mkdir /var/nutchez 43 45 chown -R nutchuser:nutchuser /opt/nutchez … … 49 51 su nutchuser -c "mkdir /home/nutchuser/nutchez/source" 50 52 su nutchuser -c "mkdir /home/nutchuser/nutchez/system" 53 51 54 make_client_install 52 53 55 # 啟動系統 54 56 format_HDFS … … 56 58 start_up_tomcat 57 59 # 安裝流程結束,並進入網頁管理頁面設定爬網網址...等 58 show_info $main_echo_360 show_info "$main_echo_3" 59 61 # show_info "Install Successfully!!" 60 show_info $main_echo_462 show_info "$main_echo_4" 61 63 # show_info "Visit http://$MasterIP_Address:8080" 62 64 client_install_commands -
nutchez-0.2/src/test/install_func.sh
r204 r206 96 96 function check_nez_installed(){ 97 97 debug_info "$check_nez_1" 98 if [ -d " opt/nutchez" ]; then98 if [ -d "/opt/nutchez" ]; then 99 99 show_info "$check_nez_2" 100 100 exit … … 221 221 } 222 222 223 # 新增nutchuser 帳號時用 Nutchuser_Passwd 當密碼 224 function creat_nutchuser_account(){ 225 debug_info "$create_nutchuser_d1" 226 while [ "$Nutchuser_Passwd" != "$Nutchuser_Passwd2" ] 227 do 228 echo -e "\n" 229 read -sp "$create_nutchuser_1" Nutchuser_Passwd 230 echo 231 read -sp "$create_nutchuser_2" Nutchuser_Passwd2 232 echo 233 if [ "$Nutchuser_Passwd" == "$Nutchuser_Passwd2" ]; then 234 show_info "$create_nutchuser_3" 235 else 236 show_info "$create_nutchuser_4" 237 fi 238 done 239 unset Nutchuser_Passwd2 240 241 if [ $(cat /etc/passwd | grep nutchuser) ]; then 242 show_info "$create_nutchuser_s1" 243 expect -c "spawn passwd nutchuser 244 set timeout 1 245 expect \"*: \" 246 send \"$Nutchuser_Passwd\r\" 247 expect \"*: \" 248 send \"$Nutchuser_Passwd\r\" 249 expect eof" 250 else 251 show_info "$create_nutchuser_s2" 252 useradd -m nutchuser -s /bin/bash 253 expect -c "spawn passwd nutchuser 254 set timeout 1 255 expect \"*: \" 256 send \"$Nutchuser_Passwd\r\" 257 expect \"*: \" 258 send \"$Nutchuser_Passwd\r\" 259 expect eof" 260 fi 261 } 223 262 224 263 function select_eth () { … … 248 287 fi 249 288 250 show_info "$select_eth_echo_3 "289 show_info "$select_eth_echo_3 $net_choice" 251 290 # show_info "Your choice is $net_choice" 252 291 net_interface=$(echo $net_interfaces | cut -d " " -f $net_choice) … … 255 294 net_MacAddr=$(ifconfig $net_interface | grep 'HW' | sed 's/^.*HWaddr //g') 256 295 257 show_info "$select_eth_echo_4 "296 show_info "$select_eth_echo_4 $net_address" 258 297 # show_info "net_address is $net_address" 259 show_info "$select_eth_echo_5 "298 show_info "$select_eth_echo_5 $net_MacAddr" 260 299 # show_info "net_MacAddr is $net_MacAddr" 261 300 fi … … 263 302 264 303 265 #function show_master_info () { 304 function show_master_info () { 305 show_info "$show_master_info_echo_1 $MasterIP_Address" 306 show_info "$show_master_info_echo_2 $net_MacAddr" 307 266 308 # show_info "The Master IP Address is $MasterIP_Address" 267 309 # show_info "The Master MacAddr is $net_MacAddr" 268 #}310 } 269 311 270 312 function make_ssh_key () { … … 305 347 # 修改nutch-site.xml中-http.agent.url, http.agent.email 306 348 function set_nutch-site () { 307 debug_info "$set_ haoop_site_echo_1"349 debug_info "$set_nutch_site_echo_1" 308 350 # debug_info "set nutch-site.xml(begin...)" 309 351 Line_NO=`cat $Nutch_HOME'/conf/nutch-site.xml' | grep -n 'http.agent.url' | sed 's/:.*//g'` 310 debug_info "$set_ haoop_site_echo_2"352 debug_info "$set_nutch_site_echo_2" 311 353 # debug_info "debug...http.agent.url line number = $Line_NO..." 312 354 sed -i ''$((Line_NO+1))'d' $Nutch_HOME/conf/nutch-site.xml 313 debug_info "$set_ haoop_site_echo_3"355 debug_info "$set_nutch_site_echo_3" 314 356 # debug_info "debug...edit http.agent.url delete line $((Line_NO+1))..." 315 357 sed -i ''$Line_NO'a <value>'$MasterIP_Address'</value>' $Nutch_HOME/conf/nutch-site.xml 316 debug_info "$set_ haoop_site_echo_4"358 debug_info "$set_nutch_site_echo_4" 317 359 # debug_info "debug...edit http.agent.url done..." 318 360 319 361 Line_NO=`cat $Nutch_HOME'/conf/nutch-site.xml' | grep -n 'http.agent.email' | sed 's/:.*//g'` 320 debug_info "$set_ haoop_site_echo_5"362 debug_info "$set_nutch_site_echo_5" 321 363 # debug_info "debug...http.agent.email line number = $Line_NO..." 322 364 323 365 sed -i ''$((Line_NO+1))'d' $Nutch_HOME/conf/nutch-site.xml 324 debug_info "$set_ haoop_site_echo_6"366 debug_info "$set_nutch_site_echo_6" 325 367 # debug_info "debug...edit http.agent.email delete line $((Line_NO+1))..." 326 368 sed -i ''$Line_NO'a <value>'$Admin_email'</value>' $Nutch_HOME/conf/nutch-site.xml 327 debug_info "$set_ haoop_site_echo_7"369 debug_info "$set_nutch_site_echo_7" 328 370 # debug_info "debug...edit http.agent.email done..." 329 debug_info "$set_ haoop_site_echo_8"371 debug_info "$set_nutch_site_echo_8" 330 372 # debug_info "set nutch-site.xml(done!)" 331 373 } … … 353 395 354 396 function Install_Nutch () { 355 debug_info "$install_Nutch_echo_1 "397 debug_info "$install_Nutch_echo_1 $MasterIP_Address " 356 398 # debug_info "MasterIP_Address=$MasterIP_Address" 357 debug_info "$install_Nutch_echo_2 "399 debug_info "$install_Nutch_echo_2 $(hostname)" 358 400 # debug_info "Master_Hostname=$(hostname)" 359 401 su nutchuser -c "echo $net_address $(hostname) $net_MacAddr \>\> ~/nutchez/system/nutch_nodes" … … 393 435 function client_PassMasterIPAddr_for_Remove () { 394 436 cd $Start_PATH 395 Line_NO=`cat client_remove.sh grep -n '# Master IP here'| sed 's/:.*//g'`437 Line_NO=`cat client_remove.sh | grep -n "# Master IP here" | sed 's/:.*//g'` 396 438 sed -i ''$((Line_NO+1))'d' client_remove.sh 397 439 sed -i ''$Line_NO'a Master_IP_Address='$MasterIP_Address'' client_remove.sh … … 425 467 426 468 i=10 469 debug_info "$start_up_tomcat_echo_2" 427 470 until [ $i -lt 1 ] 428 471 do 429 472 sleep 1s 430 debug_info "$start_up_tomcat_echo_2"431 # debug_info "wait $i sec..."432 473 i=`expr $i - 1` 433 474 done -
nutchez-0.2/src/test/install_lang.zh
r201 r206 11 11 12 12 ## Lang for master_install ## 13 main_echo_1="歡迎使用NutchEZ, 此安裝程序會為您新建一個nutchuser帳號並協助您設定 >密碼"14 main_echo_2="請確認上述的安裝資訊:1.正確 2.不正確 "13 main_echo_1="歡迎使用NutchEZ, 此安裝程序會為您新建一個nutchuser帳號並協助您設定密碼" 14 main_echo_2="請確認上述的安裝資訊:1.正確 2.不正確 " 15 15 main_echo_3="安裝成功!" 16 16 main_echo_4="請進入管理頁面:http://$MasterIP_Address:8080" … … 65 65 check_dialog_2="系統已有 dialog." 66 66 check_dialog_3="請安裝 dialog." 67 68 ### [for creat_nutchuser_account()] ### 69 create_nutchuser_d1="creat_nutchuser_account" 70 create_nutchuser_1="請輸入 Master 上 nuchuser 使用者的密碼: " 71 create_nutchuser_2="請再輸入一次: " 72 create_nutchuser_3="兩次密碼一致" 73 create_nutchuser_4="兩次密碼不一致,請重新輸入" 74 create_nutchuser_s1="系統已經有 nutchuser,直接更改 nuchuser 密碼" 75 create_nutchuser_s2="建立 nuchuser 使用者並更改密碼" 67 76 68 77 # … … 73 82 select_eth_echo_1="系統偵測到目前擁有網卡如下:" 74 83 select_eth_echo_2="請選擇欲給nutchez使用的網卡(1/2/3):" 75 select_eth_echo_3="您選擇的網卡為:$net_choice" 76 select_eth_echo_4="Master網路IP位址為:$net_address" 77 select_eth_echo_5="Master的MAC為:$net_MacAddr" 84 select_eth_echo_3="您選擇的網卡為:" 85 select_eth_echo_4="Master網路IP位址為:" 86 select_eth_echo_5="Master的MAC為:" 87 88 # 89 show_master_info_echo_1="主機的IP位址為:" 90 show_master_info_echo_2="主機的hostname為:" 78 91 79 92 # … … 87 100 # 88 101 set_nutch_site_echo_1="正在設定nutch-site.xml..." 89 set_nutch_site_echo_2="http.agent.url 設定行號為 :$Line_NO..."90 set_nutch_site_echo_3="編輯http.agent.url, 刪除行號 $Line_NO."102 set_nutch_site_echo_2="http.agent.url 設定行號為" 103 set_nutch_site_echo_3="編輯http.agent.url, 刪除行號" 91 104 set_nutch_site_echo_4="編輯http.agent.url完成" 92 set_nutch_site_echo_5="http.agent.email 設定行號 為:$Line_NO."93 set_nutch_site_echo_6="編輯http.agent.email, 刪除行號 $Line_NO."105 set_nutch_site_echo_5="http.agent.email 設定行號" 106 set_nutch_site_echo_6="編輯http.agent.email, 刪除行號" 94 107 set_nutch_site_echo_7="編輯http.agent.email完成" 95 108 set_nutch_site_echo_8="hadoop-site.xml設定完成" … … 110 123 111 124 # 112 client_PassMasterIPAddr_echo_1="在client安裝檔修改MasterIP 的行號: $Line_NO"125 client_PassMasterIPAddr_echo_1="在client安裝檔修改MasterIP" 113 126 client_PassMasterIPAddr_echo_2="編輯MasterIP..." 114 127 client_PassMasterIPAddr_echo_3="完成編輯MasterIP." 115 128 116 129 # 117 client_PassMaster_Hostname_echo_1="在client安裝檔修改Hostname , 行號為: $Line_NO"130 client_PassMaster_Hostname_echo_1="在client安裝檔修改Hostname" 118 131 client_PassMaster_Hostname_echo_2="編輯Hostname..." 119 132 client_PassMaster_Hostname_echo_3="完成編輯Hostname." … … 124 137 # 125 138 start_up_tomcat_echo_1="啟動tomcat..." 126 start_up_tomcat_echo_2=" 等待 $i秒..."139 start_up_tomcat_echo_2="請等待約10秒..." 127 140 start_up_tomcat_echo_3="tomcat 已經啟動!" 128 141 -
nutchez-0.2/src/test/lang_zh_TW_client_remove
r203 r206 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 main_echo_3="請問是否確定移除此一節點:1.確定 2.取消 "34 main_echo_3="請問是否確定移除此一節點:1.確定 2.取消 " 35 35 main_echo_4="移除程序已完成!" 36 36 main_echo_5="您已取消移除程序!" -
nutchez-0.2/src/test/lang_zh_TW_master_remove
r202 r206 32 32 # main 33 33 main_echo_1="警告 - 此一程式為移除nutchEZ程式, 若您為誤執行此一程式, 請按Ctrl+c離開此程序!" 34 main_echo_2="本執行程序將會移除安裝nutchEZ時所新增的檔案及nutchuser使用者帳號 。"35 main_echo_3="請問是否確定移除此一節點:1.確定 2.取消 "34 main_echo_2="本執行程序將會移除安裝nutchEZ時所新增的檔案及nutchuser使用者帳號,請先確認目前已無其他client服務仍在執行中。" 35 main_echo_3="請問是否確定移除此一節點:1.確定 2.取消 " 36 36 main_echo_4="移除程序已完成!" 37 37 main_echo_5="您已取消移除程序!" -
nutchez-0.2/src/test/master_remove.sh
r205 r206 9 9 # 10 10 11 #source ./lang_zh_TW_master_remove11 source ./lang_zh_TW_master_remove 12 12 13 13 ########## echo function ########## … … 50 50 show_info "$shutdown_service_echo_2" # "關閉本機服務..." 51 51 su nutchuser -c "/opt/nutchez/nutch/bin/stop-all.sh" 52 su nutchuser -c "/opt/nutchez/tomcat/bin/shutdown.sh" 52 53 show_info "$shutdown_service_echo_3" # "本機服務已關閉" 53 54 } … … 56 57 function remove_folders () { 57 58 show_info "$remove_folders_echo_1" # "正在刪除安裝時所建立的檔案及資料夾..." 58 rm -rf /opt/nutchez /*59 rm -rf /var/nutchez /*59 rm -rf /opt/nutchez 60 rm -rf /var/nutchez 60 61 show_info "$remove_folders_echo_2" # "安裝時所建立的檔案及資料夾已刪除" 61 62 } … … 79 80 function user_delete () { 80 81 show_info "$user_delete_echo_1" # "正在刪除nutchuser使用者..." 81 userdel -r nutch eruser82 userdel -r nutchuser 82 83 show_info "$user_delete_echo_2" # "使用者nutchuser已刪除" 83 84 }
Note: See TracChangeset
for help on using the changeset viewer.