source: nutchez-0.2/src/test/client_install @ 167

Last change on this file since 167 was 167, checked in by shunfa, 14 years ago
  1. 新增function: debug_info(目的為列印訊息給開發者)
  2. 新增function: show_info(目的為列印訊息給使用者)
  3. 新增寫入mac至master:/home/nutchuser/nutchez/nutch_node
  • Property svn:executable set to *
File size: 2.1 KB
Line 
1#!/bin/bash
2# Program:
3#   Check root identity and change root to exectue client_install.sh
4# Author:
5#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
6# History:
7#   2010/05/20  Rock    First release
8
9# 正式版之後,記的將不必要 read 拿掉 (trace 用的 read)
10
11# 設定 functions
12. ./client_install_func.sh
13
14# 需要 master_install 設定的參數區
15# Master IP here
16Master_IP_Address=192.168.56.101
17# Master Hostname here
18Master_Hostname=shunfa-VBox1
19# 此檔自己用的參數區
20Linux_Distribution="";
21Linux_Version="";
22Nutchuser_Passwd="xxxxxxxxxx";
23
24# 參數詢問
25yesno="no"
26show_info "Your master IP: $Master_IP_Address"
27read -p "Is this data cooect? (yes/no): " yesno
28             
29if [ "$yesno" == "yes" ] || [ "$yesno" == "y" ] ; then
30    show_info "These parameters are correct."
31else
32    show_info "Please edit these parameters in this file."
33    exit
34fi
35
36# 功能邏輯區
37
38
39# 程式邏輯區
40
41# 檢查執行這個程式的是否為root權限
42check_root
43read
44
45# 查出此主機的作業系統,以及版本
46check_systemInfo
47read
48
49# 安裝需要的套件 (目前只支援 deb 套件的系統自動安裝,yum或其他套件系統的則必須手動安裝)
50# 需要套件名稱 ssh, expect, dialog
51install_packages
52read
53
54# 檢查之前是否有安裝NutchEz
55# 目前先檢查是否有/opt/nutchez 這個資料夾即可
56check_nez_installed
57read
58
59# 檢查是否有安裝sun java ,並檢查是否為jdk 1.6 以上版本
60check_sunJava
61read
62
63# 檢查是否有安裝openssh, openssh-server
64check_ssh
65read
66
67# 檢查是否有安裝dialog
68check_dialog
69read
70
71
72# 新增nutchuser 帳號時用 Nutchuser_Passwd 當密碼
73creat_nutchuser_account
74read
75
76
77# scp nutchuser@master_ip:~ 把.ssh/目錄複製下來
78# 當使用者輸入nutchuser 密碼時,將此密碼紀錄到Nutchuser_Passwd
79# 此步驟若無法連到 master 則跳出
80scp_master_nutchuser_sshkey $Master_IP_Address
81read
82
83
84# 用scp 複製 master 的設定與安裝資料
85# 目前僅需做到能無礙的複製遠端的/opt/nutchez/到local的/opt/
86scp_packages $Master_IP_Address
87read
88
89# 安裝及啟動
90install_nutch_package
91read
92
93# 回覆 Hostname 和 IP 給 Master Server
94recall_hostname_ip $Master_IP_Address
Note: See TracBrowser for help on using the repository browser.