Changeset 152


Ignore:
Timestamp:
Jun 4, 2010, 10:49:32 AM (15 years ago)
Author:
shunfa
Message:

新增"將master IP address及hostname寫至slave的hosts"

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

Legend:

Unmodified
Added
Removed
  • nutchez-0.2/src/test/client_install

    r151 r152  
    1515# Master IP here
    1616Master_IP_Address="a.a.a.a";
    17 
     17# Master Hostname here
     18Master_Hostname="Master_Hostname";
    1819# 此檔自己用的參數區
    1920Linux_Distribution="";
  • nutchez-0.2/src/test/client_install_func.sh

    r151 r152  
    250250  echo -e "\n\033[31m= install_nutch_package (debug) =\033[0m"
    251251  tar -zxvf /opt/nutchez/NutchezForClientOf_$Master_IP_Address.tar.gz -C /
    252   /opt/nutchez/nutch/bin/hadoop-daemon.sh start datanode
    253   /opt/nutchez/nutch/bin/hadoop-daemon.sh start tasktracker
     252  sed -i.bak '1a '$Master_IP_Address' '$Master_Hostname'' /etc/hosts
     253  #/opt/nutchez/nutch/bin/hadoop-daemon.sh start datanode
     254  #/opt/nutchez/nutch/bin/hadoop-daemon.sh start tasktracker
    254255}
    255256
  • nutchez-0.2/src/test/install_func.sh

    r150 r152  
    155155}
    156156
     157function client_PassMaster_Hostname () {
     158  Line_NO=`cat client_install | grep -n '# Master Hostname here' | sed 's/:.*//g'`
     159  echo "debug...Master hostname here line number = $Line_NO..."
     160  sed -i ''$((Line_NO+1))'d' client_install
     161  echo "debug...edit Master Hostname at line $((Line_NO+1))..."
     162  sed -i ''$Line_NO'a Master_Hostname='$(hostname)'' client_install
     163  echo "edit client_install done..."
     164}
     165
    157166function make_client_install () {
    158167  # 將Master_IP_Address給client
     
    160169  echo "function make_client_install..."
    161170  client_PassMasterIPAddr
     171  client_PassMaster_Hostname
    162172  su nutchuser -c "tar -cvzf /opt/nutchez/NutchezForClientOf_$Master_IP_Address.tar.gz  /home/nutchuser/nutchez/"
    163173}
Note: See TracChangeset for help on using the changeset viewer.