Changeset 139


Ignore:
Timestamp:
Jun 1, 2010, 2:04:36 PM (15 years ago)
Author:
shunfa
Message:

修改install, install_func.sh, client_install_func.sh(新增帳號timeout部份)

Location:
nutchez-0.2/src/test
Files:
3 edited

Legend:

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

    r134 r139  
    184184# 新增nutchuser 帳號時用 Nutchuser_Passwd 當密碼
    185185function creat_nutchuser_account(){
    186 echo -e "\n= creat_nutchuser_account (debug) ="                             
     186echo -e "\n= creat_nutchuser_account (debug) ="
    187187
    188188if [ $(cat /etc/passwd | grep nutchuser) ]; then
    189189    echo "System already has nutchuser, change nutchuser password."
    190     expect -c "spawn passwd nutchuser                 
    191     expect \"*: \"                         
    192     send \"$1\r\"                         
    193     expect \"*: \"                         
    194     send \"$1\r\"                         
     190    expect -c "spawn passwd nutchuser
     191    set timeout 1
     192    expect \"*: \"
     193    send \"$1\r\"
     194    expect \"*: \"
     195    send \"$1\r\"
    195196    expect eof"
    196197else
    197198    echo "Create nutchuser and change password."
    198199    useradd -m nutchuser -s /bin/bash
    199     expect -c "spawn passwd nutchuser                 
    200     expect \"*: \"
    201     send \"$1\r\"
    202     expect \"*: \"
    203     send \"$1\r\"
     200    expect -c "spawn passwd nutchuser
     201    set timeout 1
     202    expect \"*: \"
     203    send \"$1\r\"
     204    expect \"*: \"
     205    send \"$1\r\"
    204206    expect eof"
    205207fi
    206208}
    207 
    208209
    209210# 用scp 複製 master 的設定與安裝資料
  • nutchez-0.2/src/test/install

    r137 r139  
    1919
    2020main () {
    21   echo "歡迎使用NutchEZ\ 此安裝程序會為您新建一個nutchuser帳號"
     21  echo "歡迎使用NutchEZ, 此安裝程序會為您新建一個nutchuser帳號"
    2222  set_install_information
    2323  show_info
    2424  read -p "Please confirm your install infomation: 1.Yes 2.No  " confirm
    2525  if [ $confirm -eq 1 ]; then
    26     # create_nutchuser_account
    27     # make_ssh_key
    28  
     26    creat_nutchuser_account $nutchuser_passwd
     27    make_ssh_key
     28    sleep 10
    2929    # 解壓縮
    30     # tar -zxvf nutchez-0.2-20100524.tar.gz
    31     # mv nutchez /opt/
     30    tar -zxvf nutchez-0.2-0531.tar.gz -C /opt/
    3231    Install_Nutch
    33     Install_Tomcat
     32#    Install_Tomcat
    3433    chown -R nutchuser:nutchuser /opt/nutchez
     34    chown -R nutchuser:nutchuser /var/nutchez
    3535    # make_client_install
    3636
     
    3838    format_HDFS
    3939    start_up_NutchEZ
    40     start_up_tomcat
    41 
     40    start_up_tomcat   
    4241    # 安裝流程結束,並進入網頁管理頁面設定爬網網址...等 
    4342    echo "Install Successfully!!"
  • nutchez-0.2/src/test/install_func.sh

    r137 r139  
    2424
    2525function set_install_information () {
     26  set_nutchuser_passwd
     27  read -p "Please enter Administrator's e-mail address: " Admin_email
     28  read -p "Please enter the Master DNS:  " MasterDNS
     29}
     30
     31function set_nutchuser_passwd () {
    2632  read -p "Please enter nutchuser's password :  " nutchuser_passwd
    2733  read -p "Please enter nutchuser's password again:  " nutchuser_passwd_confirm
    28   if [$nutchuser_passwd != $nutchuser_passwd_confirm]
    29     set_install_information
     34  if [ $nutchuser_passwd != $nutchuser_passwd_confirm ]; then
     35    set_nutchuser_passwd
    3036  fi
    31   read -p "Please enter Administrator's e-mail address: " Admin_email
    32   read -p "Please enter the Master DNS:  " MasterDNS
    3337}
    3438
     
    4145  read -p "Please confirm your install infomation: 1.Yes 2.No  " confirm
    4246}
     47
     48function make_ssh_key () {
     49  su nutchuser -c 'ssh-keygen -t rsa -f ~/.ssh/id_rsa -P ""'
     50  su nutchuser -c "cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys"
     51}
     52
    4353
    4454function set_haoop-site () {
     
    8494function format_HDFS () {
    8595  echo "format HDFS..."
    86   $Nutch_HOME/bin/hadoop namenode -format
     96  su nutchuser -c "$Nutch_HOME/bin/hadoop namenode -format"
    8797}
    8898
    8999function start_up_NutchEZ (){
    90100  echo "start up NutchEZ..."
    91   $NutchE_HOME/bin/start-all.sh
     101  su nutchuser -c "$Nutch_HOME/bin/start-all.sh"
    92102}
    93103
    94104function Install_Nutch () {
    95   set_hadoop-env
    96105  set_haoop-site
    97106  set_nutch-site
    98107}
    99108
    100 function Install_Tomcat () {
    101 # 設定nutch的搜尋引擎頁面到tomcat 
    102   cd $Nutch_HOME
    103   mkdir web
    104   cd web
    105   jar -xvf ../nutch-1.0.war
    106   mv $Tomcat_HOME/webapps/ROOT $Tomcat_HOME/webapps/ROOT-ori
    107   cd $Nutch_HOME
    108   mv $Nutch_HOME/web $Tomcat_HOME/webapps/ROOT
    109   mkdir $Index_DB
     109
     110function make_client_install () {
     111  # 將Master_IP_Address給client
     112  # 打包安裝目錄(不含tomcat)
     113  # tar -czv /opt/nutchez/nutch NutchezFor_$Master_IP_Client.tar.gz
     114  echo "undo... function make_client_install"
    110115}
    111116
    112117function start_up_tomcat () {
    113118  echo "start up tomcat..."
    114   $Tomcat_HOME/bin/startup.sh
     119  sleep 10s
     120  echo "su nutchuser -c "$Tomcat_HOME/bin/startup.sh""
     121  su nutchuser -c "$Tomcat_HOME/bin/startup.sh"
    115122}
Note: See TracChangeset for help on using the changeset viewer.