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

Last change on this file since 194 was 194, checked in by rock, 14 years ago

新增 Work_Path

  • Property svn:executable set to *
File size: 2.3 KB
RevLine 
[117]1#!/bin/bash
[122]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
[117]8
[123]9# 正式版之後,記的將不必要 read 拿掉 (trace 用的 read)
[122]10
[132]11# 需要 master_install 設定的參數區
[140]12# Master IP here
[169]13Master_IP_Address=input.your.master.ip_address
[152]14# Master Hostname here
[169]15Master_Hostname=input_your_master_hostname
[119]16# 此檔自己用的參數區
17Linux_Distribution="";
18Linux_Version="";
[135]19Nutchuser_Passwd="xxxxxxxxxx";
[194]20Work_Path=$(echo $0 | sed 's/client_install//')
[119]21
[194]22# Source functions
23source $Work_Path/client_install_func.sh
24
[188]25# Language Choice
26choose_lang
27
[129]28# 參數詢問
[132]29yesno="no"
[188]30show_info "$par_echo_1 $Master_IP_Address"
31read -p "$par_echo_2" yesno
[129]32             
[132]33if [ "$yesno" == "yes" ] || [ "$yesno" == "y" ] ; then
[188]34    show_info "$par_echo_3"
[132]35else
[188]36    show_info "$par_echo_4"
[132]37    exit
[129]38fi
39
[119]40
41# 檢查執行這個程式的是否為root權限
[117]42check_root
[191]43read -p "continue.."
[117]44
[123]45# 查出此主機的作業系統,以及版本
[117]46check_systemInfo
[191]47read -p "continue.."
[117]48
[132]49# 安裝需要的套件 (目前只支援 deb 套件的系統自動安裝,yum或其他套件系統的則必須手動安裝)
50# 需要套件名稱 ssh, expect, dialog
51install_packages
[191]52read -p "continue.."
[132]53
[119]54# 檢查之前是否有安裝NutchEz
55# 目前先檢查是否有/opt/nutchez 這個資料夾即可
[117]56check_nez_installed
[191]57read -p "continue.."
[117]58
[119]59# 檢查是否有安裝sun java ,並檢查是否為jdk 1.6 以上版本
[135]60check_sunJava
[191]61read -p "continue.."
[117]62
[119]63# 檢查是否有安裝openssh, openssh-server
[123]64check_ssh
[191]65read -p "continue.."
[117]66
[123]67# 檢查是否有安裝dialog
68check_dialog
[191]69read -p "continue.."
[117]70
[142]71# 新增nutchuser 帳號時用 Nutchuser_Passwd 當密碼
72creat_nutchuser_account
[191]73read -p "continue.."
[142]74
[117]75# scp nutchuser@master_ip:~ 把.ssh/目錄複製下來
76# 當使用者輸入nutchuser 密碼時,將此密碼紀錄到Nutchuser_Passwd
77# 此步驟若無法連到 master 則跳出
[128]78scp_master_nutchuser_sshkey $Master_IP_Address
[191]79read -p "continue.."
[117]80
81# 用scp 複製 master 的設定與安裝資料
[119]82# 目前僅需做到能無礙的複製遠端的/opt/nutchez/到local的/opt/
[128]83scp_packages $Master_IP_Address
[191]84read -p "continue.."
[117]85
[146]86# 安裝及啟動
[144]87install_nutch_package
[191]88read -p "continue.."
[117]89
[147]90# 回覆 Hostname 和 IP 給 Master Server
91recall_hostname_ip $Master_IP_Address
[191]92read -p "continue.."
Note: See TracBrowser for help on using the repository browser.