Ignore:
Timestamp:
Jun 18, 2010, 2:00:28 PM (14 years ago)
Author:
shunfa
Message:
  1. master中文版安裝流程已測試
  2. master移除程式已測試
File:
1 edited

Legend:

Unmodified
Added
Removed
  • nutchez-0.2/src/test/install_func.sh

    r204 r206  
    9696function check_nez_installed(){
    9797  debug_info "$check_nez_1"
    98   if [ -d "opt/nutchez" ]; then
     98  if [ -d "/opt/nutchez" ]; then
    9999    show_info "$check_nez_2"
    100100    exit
     
    221221}
    222222
     223# 新增nutchuser 帳號時用 Nutchuser_Passwd 當密碼
     224function 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}
    223262
    224263function select_eth () {
     
    248287    fi
    249288
    250     show_info "$select_eth_echo_3"
     289    show_info "$select_eth_echo_3 $net_choice"
    251290#   show_info "Your choice is $net_choice"
    252291    net_interface=$(echo $net_interfaces | cut -d " " -f $net_choice)
     
    255294    net_MacAddr=$(ifconfig $net_interface | grep 'HW' | sed 's/^.*HWaddr //g')
    256295
    257     show_info "$select_eth_echo_4"
     296    show_info "$select_eth_echo_4 $net_address"
    258297#   show_info "net_address is $net_address"
    259     show_info "$select_eth_echo_5"
     298    show_info "$select_eth_echo_5 $net_MacAddr"
    260299#   show_info "net_MacAddr is $net_MacAddr"
    261300  fi
     
    263302
    264303
    265 #function show_master_info () {
     304function show_master_info () {
     305  show_info "$show_master_info_echo_1 $MasterIP_Address"
     306  show_info "$show_master_info_echo_2 $net_MacAddr"
     307
    266308#  show_info "The Master IP Address is $MasterIP_Address"
    267309#  show_info "The Master MacAddr is $net_MacAddr"
    268 #}
     310}
    269311
    270312function make_ssh_key () {
     
    305347# 修改nutch-site.xml中-http.agent.url, http.agent.email
    306348function set_nutch-site () {
    307   debug_info "$set_haoop_site_echo_1"
     349  debug_info "$set_nutch_site_echo_1"
    308350# debug_info "set nutch-site.xml(begin...)"
    309351  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"
    311353# debug_info "debug...http.agent.url line number = $Line_NO..."
    312354  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"
    314356# debug_info "debug...edit http.agent.url delete line $((Line_NO+1))..."
    315357  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"
    317359# debug_info "debug...edit http.agent.url done..."
    318360
    319361  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"
    321363# debug_info "debug...http.agent.email line number = $Line_NO..."
    322364
    323365  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"
    325367# debug_info "debug...edit http.agent.email delete line $((Line_NO+1))..."
    326368  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"
    328370# debug_info "debug...edit http.agent.email done..."
    329   debug_info "$set_haoop_site_echo_8"
     371  debug_info "$set_nutch_site_echo_8"
    330372# debug_info "set nutch-site.xml(done!)"
    331373}
     
    353395
    354396function Install_Nutch () {
    355   debug_info "$install_Nutch_echo_1"
     397  debug_info "$install_Nutch_echo_1 $MasterIP_Address "
    356398# debug_info "MasterIP_Address=$MasterIP_Address"
    357   debug_info "$install_Nutch_echo_2"
     399  debug_info "$install_Nutch_echo_2 $(hostname)"
    358400# debug_info "Master_Hostname=$(hostname)"
    359401  su nutchuser -c "echo $net_address $(hostname) $net_MacAddr \>\> ~/nutchez/system/nutch_nodes"
     
    393435function client_PassMasterIPAddr_for_Remove () {
    394436  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'`
    396438  sed -i ''$((Line_NO+1))'d' client_remove.sh
    397439  sed -i ''$Line_NO'a Master_IP_Address='$MasterIP_Address'' client_remove.sh
     
    425467
    426468  i=10
     469  debug_info "$start_up_tomcat_echo_2"
    427470  until [ $i -lt 1 ]
    428471    do
    429472      sleep 1s
    430       debug_info "$start_up_tomcat_echo_2"
    431 #     debug_info "wait $i sec..."
    432473      i=`expr $i - 1`
    433474    done
Note: See TracChangeset for help on using the changeset viewer.