Changeset 139 for nutchez-0.2
- Timestamp:
- Jun 1, 2010, 2:04:36 PM (14 years ago)
- Location:
- nutchez-0.2/src/test
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
nutchez-0.2/src/test/client_install_func.sh
r134 r139 184 184 # 新增nutchuser 帳號時用 Nutchuser_Passwd 當密碼 185 185 function creat_nutchuser_account(){ 186 echo -e "\n= creat_nutchuser_account (debug) =" 186 echo -e "\n= creat_nutchuser_account (debug) =" 187 187 188 188 if [ $(cat /etc/passwd | grep nutchuser) ]; then 189 189 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\" 195 196 expect eof" 196 197 else 197 198 echo "Create nutchuser and change password." 198 199 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\" 204 206 expect eof" 205 207 fi 206 208 } 207 208 209 209 210 # 用scp 複製 master 的設定與安裝資料 -
nutchez-0.2/src/test/install
r137 r139 19 19 20 20 main () { 21 echo "歡迎使用NutchEZ \此安裝程序會為您新建一個nutchuser帳號"21 echo "歡迎使用NutchEZ, 此安裝程序會為您新建一個nutchuser帳號" 22 22 set_install_information 23 23 show_info 24 24 read -p "Please confirm your install infomation: 1.Yes 2.No " confirm 25 25 if [ $confirm -eq 1 ]; then 26 # create_nutchuser_account27 #make_ssh_key28 26 creat_nutchuser_account $nutchuser_passwd 27 make_ssh_key 28 sleep 10 29 29 # 解壓縮 30 # tar -zxvf nutchez-0.2-20100524.tar.gz 31 # mv nutchez /opt/ 30 tar -zxvf nutchez-0.2-0531.tar.gz -C /opt/ 32 31 Install_Nutch 33 Install_Tomcat32 # Install_Tomcat 34 33 chown -R nutchuser:nutchuser /opt/nutchez 34 chown -R nutchuser:nutchuser /var/nutchez 35 35 # make_client_install 36 36 … … 38 38 format_HDFS 39 39 start_up_NutchEZ 40 start_up_tomcat 41 40 start_up_tomcat 42 41 # 安裝流程結束,並進入網頁管理頁面設定爬網網址...等 43 42 echo "Install Successfully!!" -
nutchez-0.2/src/test/install_func.sh
r137 r139 24 24 25 25 function 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 31 function set_nutchuser_passwd () { 26 32 read -p "Please enter nutchuser's password : " nutchuser_passwd 27 33 read -p "Please enter nutchuser's password again: " nutchuser_passwd_confirm 28 if [ $nutchuser_passwd != $nutchuser_passwd_confirm]29 set_ install_information34 if [ $nutchuser_passwd != $nutchuser_passwd_confirm ]; then 35 set_nutchuser_passwd 30 36 fi 31 read -p "Please enter Administrator's e-mail address: " Admin_email32 read -p "Please enter the Master DNS: " MasterDNS33 37 } 34 38 … … 41 45 read -p "Please confirm your install infomation: 1.Yes 2.No " confirm 42 46 } 47 48 function 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 43 53 44 54 function set_haoop-site () { … … 84 94 function format_HDFS () { 85 95 echo "format HDFS..." 86 $Nutch_HOME/bin/hadoop namenode -format96 su nutchuser -c "$Nutch_HOME/bin/hadoop namenode -format" 87 97 } 88 98 89 99 function start_up_NutchEZ (){ 90 100 echo "start up NutchEZ..." 91 $NutchE_HOME/bin/start-all.sh101 su nutchuser -c "$Nutch_HOME/bin/start-all.sh" 92 102 } 93 103 94 104 function Install_Nutch () { 95 set_hadoop-env96 105 set_haoop-site 97 106 set_nutch-site 98 107 } 99 108 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 110 function 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" 110 115 } 111 116 112 117 function start_up_tomcat () { 113 118 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" 115 122 }
Note: See TracChangeset
for help on using the changeset viewer.