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