Changeset 206


Ignore:
Timestamp:
Jun 18, 2010, 2:00:28 PM (15 years ago)
Author:
shunfa
Message:
  1. master中文版安裝流程已測試
  2. master移除程式已測試
Location:
nutchez-0.2/src/test
Files:
7 edited

Legend:

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

    r205 r206  
    5353function remove_folders () {
    5454  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
    5757  show_info "$remove_folders_echo_2" # "安裝時所建立的檔案及資料夾已刪除"
    5858}
     
    7373function user_delete () {
    7474  show_info "$user_delete_echo_1" # "正在刪除nutchuser使用者..."
    75   userdel -r nutcheruser
     75  userdel -r nutchuser
    7676  show_info "$user_delete_echo_2" # "使用者nutchuser已刪除"
    7777}
  • nutchez-0.2/src/test/install

    r199 r206  
    2828main () {
    2929  check_info
    30   show_info $main_echo_1
     30  show_info "$main_echo_1"
    3131# show_info "歡迎使用NutchEZ, 此安裝程序會為您新建一個nutchuser帳號並協助您設定密碼"
    3232  set_install_information
     33  show_master_info
    3334  read -p "$main_echo_2" confirm
    3435# read -p "Please confirm your install infomation: 1.Yes 2.No  " confirm
     
    3637    creat_nutchuser_account $Nutchuser_Passwd
    3738    make_ssh_key
    38    
    3939    # 解壓縮
    4040    tar -zxvf nutchezV2-current.tar.gz -C /opt/
     41   
    4142    Install_Nutch
     43
    4244    mkdir /var/nutchez
    4345    chown -R nutchuser:nutchuser /opt/nutchez
     
    4951    su nutchuser -c "mkdir /home/nutchuser/nutchez/source"
    5052    su nutchuser -c "mkdir /home/nutchuser/nutchez/system"
     53
    5154    make_client_install
    52 
    5355    # 啟動系統
    5456    format_HDFS
     
    5658    start_up_tomcat   
    5759    # 安裝流程結束,並進入網頁管理頁面設定爬網網址...等 
    58     show_info $main_echo_3
     60    show_info "$main_echo_3"
    5961#   show_info "Install Successfully!!"
    60     show_info $main_echo_4
     62    show_info "$main_echo_4"
    6163#   show_info "Visit http://$MasterIP_Address:8080"
    6264    client_install_commands
  • 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
  • nutchez-0.2/src/test/install_lang.zh

    r201 r206  
    1111
    1212## Lang for master_install ##
    13 main_echo_1="歡迎使用NutchEZ, 此安裝程序會為您新建一個nutchuser帳號並協助您設定>密碼"
    14 main_echo_2="請確認上述的安裝資訊:1.正確 2.不正確"
     13main_echo_1="歡迎使用NutchEZ, 此安裝程序會為您新建一個nutchuser帳號並協助您設定密碼"
     14main_echo_2="請確認上述的安裝資訊:1.正確 2.不正確 "
    1515main_echo_3="安裝成功!"
    1616main_echo_4="請進入管理頁面:http://$MasterIP_Address:8080"
     
    6565check_dialog_2="系統已有 dialog."
    6666check_dialog_3="請安裝 dialog."
     67
     68### [for creat_nutchuser_account()] ###
     69create_nutchuser_d1="creat_nutchuser_account"
     70create_nutchuser_1="請輸入 Master 上 nuchuser 使用者的密碼: "
     71create_nutchuser_2="請再輸入一次: "
     72create_nutchuser_3="兩次密碼一致"
     73create_nutchuser_4="兩次密碼不一致,請重新輸入"
     74create_nutchuser_s1="系統已經有 nutchuser,直接更改 nuchuser 密碼"
     75create_nutchuser_s2="建立 nuchuser 使用者並更改密碼"
    6776     
    6877#
     
    7382select_eth_echo_1="系統偵測到目前擁有網卡如下:"
    7483select_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"
     84select_eth_echo_3="您選擇的網卡為:"
     85select_eth_echo_4="Master網路IP位址為:"
     86select_eth_echo_5="Master的MAC為:"
     87
     88#
     89show_master_info_echo_1="主機的IP位址為:"
     90show_master_info_echo_2="主機的hostname為:"
    7891
    7992#
     
    87100#
    88101set_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."
     102set_nutch_site_echo_2="http.agent.url 設定行號為"
     103set_nutch_site_echo_3="編輯http.agent.url, 刪除行號"
    91104set_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."
     105set_nutch_site_echo_5="http.agent.email 設定行號"
     106set_nutch_site_echo_6="編輯http.agent.email, 刪除行號"
    94107set_nutch_site_echo_7="編輯http.agent.email完成"
    95108set_nutch_site_echo_8="hadoop-site.xml設定完成"
     
    110123
    111124#
    112 client_PassMasterIPAddr_echo_1="在client安裝檔修改MasterIP的行號: $Line_NO"
     125client_PassMasterIPAddr_echo_1="在client安裝檔修改MasterIP"
    113126client_PassMasterIPAddr_echo_2="編輯MasterIP..."
    114127client_PassMasterIPAddr_echo_3="完成編輯MasterIP."
    115128
    116129#
    117 client_PassMaster_Hostname_echo_1="在client安裝檔修改Hostname, 行號為: $Line_NO"
     130client_PassMaster_Hostname_echo_1="在client安裝檔修改Hostname"
    118131client_PassMaster_Hostname_echo_2="編輯Hostname..."
    119132client_PassMaster_Hostname_echo_3="完成編輯Hostname."
     
    124137#
    125138start_up_tomcat_echo_1="啟動tomcat..."
    126 start_up_tomcat_echo_2="等待 $i 秒..."
     139start_up_tomcat_echo_2="請等待約10秒..."
    127140start_up_tomcat_echo_3="tomcat 已經啟動!"
    128141
  • nutchez-0.2/src/test/lang_zh_TW_client_remove

    r203 r206  
    3030
    3131# main
    32 main_echo_1="警告-此一程式為移除此用戶端的nutch node, 若您為誤執行此一程式, 請按Ctrl+c離開此程序!"
     32main_echo_1="警告!!! - 此一程式為移除此用戶端的nutch node, 若您為誤執行此一程式, 請按 Ctrl+c 離開此程序!"
    3333main_echo_2="本執行程序將會移除安裝nutchEZ時所新增的檔案及nutchuser使用者帳號。"
    34 main_echo_3="請問是否確定移除此一節點:1.確定 2.取消"
     34main_echo_3="請問是否確定移除此一節點:1.確定 2.取消 "
    3535main_echo_4="移除程序已完成!"
    3636main_echo_5="您已取消移除程序!"
  • nutchez-0.2/src/test/lang_zh_TW_master_remove

    r202 r206  
    3232# main
    3333main_echo_1="警告 - 此一程式為移除nutchEZ程式, 若您為誤執行此一程式, 請按Ctrl+c離開此程序!"
    34 main_echo_2="本執行程序將會移除安裝nutchEZ時所新增的檔案及nutchuser使用者帳號。"
    35 main_echo_3="請問是否確定移除此一節點:1.確定 2.取消"
     34main_echo_2="本執行程序將會移除安裝nutchEZ時所新增的檔案及nutchuser使用者帳號,請先確認目前已無其他client服務仍在執行中。"
     35main_echo_3="請問是否確定移除此一節點:1.確定 2.取消 "
    3636main_echo_4="移除程序已完成!"
    3737main_echo_5="您已取消移除程序!"
  • nutchez-0.2/src/test/master_remove.sh

    r205 r206  
    99#   
    1010
    11 # source ./lang_zh_TW_master_remove
     11source ./lang_zh_TW_master_remove
    1212
    1313##########  echo function  ##########
     
    5050  show_info "$shutdown_service_echo_2" # "關閉本機服務..."
    5151  su nutchuser -c "/opt/nutchez/nutch/bin/stop-all.sh"
     52  su nutchuser -c "/opt/nutchez/tomcat/bin/shutdown.sh"
    5253  show_info "$shutdown_service_echo_3" # "本機服務已關閉"
    5354}
     
    5657function remove_folders () {
    5758  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
    6061  show_info "$remove_folders_echo_2" # "安裝時所建立的檔案及資料夾已刪除"
    6162}
     
    7980function user_delete () {
    8081  show_info "$user_delete_echo_1" # "正在刪除nutchuser使用者..."
    81   userdel -r nutcheruser
     82  userdel -r nutchuser
    8283  show_info "$user_delete_echo_2" # "使用者nutchuser已刪除"
    8384}
Note: See TracChangeset for help on using the changeset viewer.