Changes between Version 16 and Version 17 of waue/Hadoop_DRBL


Ignore:
Timestamp:
Feb 27, 2009, 11:04:00 AM (15 years ago)
Author:
waue
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • waue/Hadoop_DRBL

    v16 v17  
    2626因此,只要先在drbl server上完成了'''一、安裝''','''二、設定'''之後,在將其他的client開機然後依照'''三、操作''' 就可以了。
    2727
    28 == 一、安裝 ==
    29 
    30  === 安裝drbl ===
     28= 一、安裝 =
     29
     30 == 1.1 安裝drbl ==
    3131 * 詳見 [http://drbl.nchc.org.tw/one4all/desktop/ DRBL的安裝]
    3232
    33  === 安裝 java 6 ===
     33 == 1.2 安裝 java 6 ==
    3434 
    3535 * 在套件庫裡 /etc/apt/sources.list 加入 non-free 庫以及 backports 網址才能安裝 sun-java6
     
    5050}}}
    5151
    52  === 安裝 Hadoop 0.18.3 ===
     52 == 1.3 安裝 Hadoop 0.18.3 ==
    5353
    5454{{{
     
    5959}}}
    6060
    61  = 二、設定 Hadoop = 
     61 = 二、設定 Hadoop =
    6262
    6363 * 在 /etc/bash.bashrc 的最末加入 以下資訊
     
    108108@@ -4,5 +4,31 @@
    109109 <!-- Put site-specific property overrides in this file. -->
    110 
    111110 <configuration>
    112111-
     
    132131
    133132 * 編輯 /opt/hadoop/conf/slaves
    134  {{{
     133{{{
    135134hadoop102
    136135hadoop103
     
    140139hadoop107
    141140hadoop
    142 
    143  }}}
    144 
    145  = 三、DRBL 操作 =
     141}}}
     142
     143 = 三、操作 =
    146144 
    147  == 開啟client ==
     145 == 3.1 開啟DRBL Client ==
    148146 * 將所有的 client 開啟,並且如下
    149147{{{
     
    163161}}}
    164162
    165  == ssh ==
     163 == 3.2 設定ssh ==
    166164
    167165 * 編寫 /etc/ssh/ssh_config
     
    169167StrictHostKeyChecking no
    170168}}}
    171 
    172169
    173170 * 執行
     
    175172$ ssh-keygen -t rsa -b 1024 -N "" -f ~/.ssh/id_rsa
    176173$ cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
     174$ /etc/init.d/ssh restart
    177175}}}
    178176
     
    192190 * 正確無誤則可免密碼登入
    193191
    194  ==== dsh ====
    195  * 此節非必要可不做
    196 
     192 === 3.2.1 dsh ===
     193 
    197194{{{
    198195$ sudo apt-get install dsh
     
    202199並執行
    203200{{{
     201$ dsh -a scp hadoop:/etc/hosts /etc/
    204202$ dsh -a source /etc/bash.bashrc
    205203}}}
    206204
    207  == DRBL Server as Hadoop namenode ==
     205 == 3.3 啟動 Hadoop ==
    208206 * 啟動
    209207{{{
    210 bin/hadoop namenode -format
    211 bin/start-all
    212 }}}
    213  * 測試
    214 {{{
    215 mkdir input
    216 cp *.txt input/
    217 bin/hadoop dfs -put input input
    218 bin/hadoop jar hadoop-*-examples.jar wordcount input ouput
    219 }}}
    220 
    221  * browse http://gm2.nchc.org.tw:50070 for DFS status
    222 
     208$ cd /opt/hadoop
     209$ bin/hadoop namenode -format
     210$ bin/start-all.sh
     211}}}
     212 == 3.4 Hadoop 測試範例 ==
     213 * 運作WordCount以測試
     214{{{
     215$ mkdir input
     216$ cp *.txt input/
     217$ bin/hadoop dfs -put input input
     218$ bin/hadoop jar hadoop-*-examples.jar wordcount input ouput
     219}}}
     220 * 執行畫面:
     221{{{
     222hadoop:/opt/hadoop# bin/hadoop jar hadoop-*-examples.jar wordcount input ouput
     22309/02/26 06:16:34 INFO mapred.FileInputFormat: Total input paths to process : 4
     22409/02/26 06:16:34 INFO mapred.FileInputFormat: Total input paths to process : 4
     22509/02/26 06:16:35 INFO mapred.JobClient: Running job: job_200902260615_0001
     22609/02/26 06:16:36 INFO mapred.JobClient:  map 0% reduce 0%
     22709/02/26 06:16:39 INFO mapred.JobClient:  map 80% reduce 0%
     22809/02/26 06:16:40 INFO mapred.JobClient:  map 100% reduce 0%
     22909/02/26 06:16:50 INFO mapred.JobClient: Job complete: job_200902260615_0001
     23009/02/26 06:16:50 INFO mapred.JobClient: Counters: 16
     23109/02/26 06:16:50 INFO mapred.JobClient:   File Systems
     23209/02/26 06:16:50 INFO mapred.JobClient:     HDFS bytes read=267854
     23309/02/26 06:16:50 INFO mapred.JobClient:     HDFS bytes written=100895
     23409/02/26 06:16:50 INFO mapred.JobClient:     Local bytes read=133897
     23509/02/26 06:16:50 INFO mapred.JobClient:     Local bytes written=292260
     23609/02/26 06:16:50 INFO mapred.JobClient:   Job Counters
     23709/02/26 06:16:50 INFO mapred.JobClient:     Launched reduce tasks=1
     23809/02/26 06:16:50 INFO mapred.JobClient:     Rack-local map tasks=5
     23909/02/26 06:16:50 INFO mapred.JobClient:     Launched map tasks=5
     24009/02/26 06:16:50 INFO mapred.JobClient:   Map-Reduce Framework
     24109/02/26 06:16:50 INFO mapred.JobClient:     Reduce input groups=8123
     24209/02/26 06:16:50 INFO mapred.JobClient:     Combine output records=17996
     24309/02/26 06:16:50 INFO mapred.JobClient:     Map input records=6515
     24409/02/26 06:16:50 INFO mapred.JobClient:     Reduce output records=8123
     24509/02/26 06:16:50 INFO mapred.JobClient:     Map output bytes=385233
     24609/02/26 06:16:50 INFO mapred.JobClient:     Map input bytes=265370
     24709/02/26 06:16:50 INFO mapred.JobClient:     Combine input records=44786
     24809/02/26 06:16:50 INFO mapred.JobClient:     Map output records=34913
     24909/02/26 06:16:50 INFO mapred.JobClient:     Reduce input records=8123
     250hadoop:/opt/hadoop#
     251}}}
     252
     253 * http://gm2.nchc.org.tw:50030/
     254   * 網頁中可以看到node數為7則代表所有的節點都有加入
     255 * http://gm2.nchc.org.tw:50075/browseDirectory.jsp?dir=%2Fuser%2Froot&namenodeInfoPort=50070
     256   * 可以看到輸出結果
     257   
     258== 3.5 停止hadoop ==
     259{{{
     260$ bin/stop-all.sh
     261}}}
     262== 3.6 重新建立 hadoop ==
     263{{{
     264$ bin/stop-all.sh
     265$ dsh -a rm -rf /root/hadoop/* /tmp/hadoop-root*
     266$ bin/hadoop namenode -format
     267$ bin/start-all.sh
     268}}}
    223269== 參考 ==
    224270
    225 [http://trac.nchc.org.tw/grid/wiki/jazz/DRBL_Hadoop Jazz: DRBL_Hadoop ]
    226 
    227 [http://trac.nchc.org.tw/cloud/wiki/MR_manual Hadoop手冊]
     271 * [http://trac.nchc.org.tw/grid/wiki/jazz/DRBL_Hadoop Jazz: DRBL_Hadoop ]
     272 * [http://trac.nchc.org.tw/cloud/wiki/MR_manual Hadoop手冊]
    228273
    229274== 問題排解 ==