source: nutchez-0.2/src/shell/install @ 235

Last change on this file since 235 was 224, checked in by waue, 15 years ago

更改檢查work_path 的路徑設定方法
檢查更新流程

  • Property svn:executable set to *
File size: 2.4 KB
RevLine 
[116]1#!/bin/bash
[199]2#
[195]3
[199]4# 變數宣告
[220]5
[224]6Work_Path=`dirname "$0"`
[195]7
[224]8if [ -f $Work_Path/install_func.sh ];then
9  Work_Path=`cd "$Work_Path"; pwd`
[220]10elif [ -f $Work_Path/bin/install_func.sh ];then
[224]11  Work_Path=`cd "$Work_Path/bin"; pwd`;
[220]12else
13  echo "Import install-function-library error !!! ";
14  exit 1;
15fi
16
[224]17#Work_Path=./
18#Work_Path_J=0
19# Work Path setup
20#echo $0 | grep '/' || Work_Path_J=1
21#if [ "$Work_Path_J" == "0"  ]; then
22#    Work_Path=$(echo $0 | sed 's/install//')
23#fi
24
25# Source functions
26  source $Work_Path/install_func.sh;
[220]27  source $Work_Path/lang_link;
[117]28### real code #####
[137]29
[150]30# 前置作業
31# *.sh及nutchez-0.2-0531.tar.gz均在同一目錄下
32
[164]33function show_info () {
34  if [ $? -eq 0 ]; then
35    echo -e "\033[1;32;40m $1 \033[0m"
36  fi
37}
[125]38
[137]39main () {
[160]40  check_info
[213]41  show_info "$MI_main_echo_1"
[195]42# show_info "歡迎使用NutchEZ, 此安裝程序會為您新建一個nutchuser帳號並協助您設定密碼"
[117]43  set_install_information
[206]44  show_master_info
[213]45  read -p "$MI_main_echo_2" confirm
[195]46# read -p "Please confirm your install infomation: 1.Yes 2.No  " confirm
[117]47  if [ $confirm -eq 1 ]; then
[161]48    creat_nutchuser_account $Nutchuser_Passwd
[139]49    make_ssh_key
[136]50    # 解壓縮
[218]51    # tar -zxvf nutchezV2-current.tar.gz -C /opt/
52    unzip_nV2_pack
[206]53
[140]54    su nutchuser -c "mkdir /home/nutchuser/nutchez"
55    su nutchuser -c "mkdir /home/nutchuser/nutchez/urls"
56    su nutchuser -c "touch /home/nutchuser/nutchez/urls/urls.txt"
57    su nutchuser -c "mkdir /home/nutchuser/nutchez/search"
[158]58    su nutchuser -c "mkdir /home/nutchuser/nutchez/source"
[213]59    su nutchuser -c "mkdir /home/nutchuser/nutchez/system"   
[206]60
[213]61    Install_Nutch
62
63    mkdir /var/nutchez
[219]64    # 建立 nutch 與 tomcat 的 logs 資料夾
65    mkdir /var/nutchez/tomcat-logs
66    ln -sf /var/nutchez/tomcat-logs /opt/nutchez/tomcat/logs
67    mkdir /var/nutchez/logs
68    ln -sf /var/nutchez/logs /opt/nutchez/nutch/logs
69
[213]70    chown -R nutchuser:nutchuser /opt/nutchez
71    chown -R nutchuser:nutchuser /var/nutchez
[219]72   
73    # 系統路徑鍊結
[224]74    ln -sf /home/nutchuser/nutchez/system/nutchez /usr/local/bin/nutchez
[213]75
[144]76    make_client_install
[137]77    # 啟動系統
[117]78    format_HDFS
79    start_up_NutchEZ
[139]80    start_up_tomcat   
[125]81    # 安裝流程結束,並進入網頁管理頁面設定爬網網址...等 
[213]82    show_info "$MI_main_echo_3"
[195]83#   show_info "Install Successfully!!"
[213]84    show_info "$MI_main_echo_4"
[195]85#   show_info "Visit http://$MasterIP_Address:8080"
86    client_install_commands
[117]87  elif [ $confirm -eq 2 ]; then
88    main
89  fi
90}
91
92main
Note: See TracBrowser for help on using the repository browser.