Changeset 206 for nutchez-0.2/src/test/install_func.sh
- Timestamp:
- Jun 18, 2010, 2:00:28 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.