Changes between Version 14 and Version 15 of MR_manual


Ignore:
Timestamp:
Jun 13, 2008, 5:05:18 PM (16 years ago)
Author:
waue
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MR_manual

    v14 v15  
    179179 = 四、效能測試 =
    180180 = 五、開發程式 =
     181 == 5.1 install IBM mapReduce tool ==
     182 1. Download the IBM MapReduce Tools zip file and extract to /tmp/. [[br]]
     183 2. Make sure Eclipse is closed and ... [[br]]
     184{{{
     185 $ cd /tmp/
     186 $ unzip mapreduce_tools.zip
     187 $ mv plugins/com.ibm.hipods.mapreduce* /usr/lib/eclipse/plugins/
     188}}}
     189 3. Restart Eclipse  [[br]]
     190 Check IBM MapReduce Tools plugin installing well [[br]]
     191{{{
     192Eclipse
     193 File > New > Project
     194see MapReduce category
     195}}}
     196 == 5.2 Eclipse configure ==
     197{{{
     198Eclipse
     199Window > Preferences > java> compiler
     200set compiler compliance level to 5.0
     201}}}
     202 * Some eclipse-plugin may exhaust much resource, you may happen to “out of
     203
     204memory error”. We suggest to execute eclipse with some parameters as that :
     205{{{
     206 $  eclipse -vmargs -Xmx 512m
     207}}}
     208
     209 == 5.3. Run on Eclipse ==
     210 === 5.3.1 map-reduce sample code ===
     211{{{
     212Eclipse
     213 File > new > project >  map-reduce project > next >
     214project name : sample
     215use default location : V
     216use default Hadoop : V
     217 > Finish
     218}}}
     219 * at “Project explorer”, you will see “sample” tree. Now, you should
     220
     221create a sample code.
     222{{{
     223Eclipse
     224right click sample > new > file >
     225file name :  WordCount.java
     226}}}
     227 * the sample code is here
     228
     229[http://trac.nchc.org.tw/cloud/attachment/wiki/hadoop-sample-
     230
     231code/WordCount.java]
     232
     233 * paste the contents to your new adding file “WordCount.java”
     234 === 5.3.2. Connect to Hadoop File System ===
     235
     236 * Enable the MapReduce servers window
     237{{{
     238Eclipse
     239 Window > Show View > Other... > MapReduce Tools > MapReduce Servers
     240}}}
     241
     242 * At the bottom of your window, you should have a "MapReduce Servers" tab.
     243
     244If not, see second bullet above. Switch to that tab.
     245
     246 * At the top right edge of the tab, you should see a little blue elephant
     247
     248icons.
     249{{{
     250Eclipse
     251Click blue elephant to add a new MapReduce server location.
     252Server name : any_you_want
     253Hostname : localhost
     254Installation directory: /home/waue/workspace/nutch/
     255Username : waue
     256}}}
     257 * If any password prompt, please input the password which you login to
     258
     259local
     260
     261 * It should show up under a little elephant icon in the Project Explorer
     262
     263(on the left side of Eclipse).
     264
     265 * ps  :  Pleast make sure your Hadoop is working on local system. If not,
     266
     267please refer “session 2 Hadoop Setup” for debuging, or you can not pass
     268
     269through.
     270
     271 $ cd /home/waue/workspace/hadoop/ [[br]]
     272 $ wget http://www.gutenberg.org/etext/132/132.txt   [[br]]
     273 $ bin/hadoop dfs -mkdir input [[br]]
     274 $ bin/hadoop dfs -ls [[br]]
     275{{{
     276Found 1 items
     277/user/waue/input        <dir>           2008-05-23 15:15        rwxr-xr-x   
     278
     279  waue     supergroup
     280}}}
     281 $ bin/hadoop dfs -put 132.txt input [[br]]
     282
     283 === 5.3.3 Run ===
     284{{{
     285Eclipse
     286sample >  right click WordCount.java > run as ... > run on Hadoop > choose
     287
     288an existing server from the list below > finish
     289}}}
     290 * A “console” tag will show beside “MapReduce Server” tag.
     291
     292 * While Map Reduce is running, you can visit http://localhost:50030/ to
     293
     294view that Hadoop is dispatching jobs by Map Reduce.
     295
     296 * After finish, you can go to http://localhost:50060/ to see the result.
     297
     298
    181299 = 六、範例教學 =
    182300 = Reference =