2-MapReduce使用

2015-05-08  本文已影响175人  一只小青鸟

WordCount —— MapReduce的Hello World

$ wget http://www.gutenberg.org/cache/epub/20417/pg20417.txt
$ hdfs dfs -mkdir /tmp
$ hdfs dfs -copyFromLocal /home/zhy/pg20417.txt /tmp
$ hadoop jar /usr/hadoop-2.2.0/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.2.0.jar wordcount /tmp/ /tmp-output

开发环境配置

配置Map/Reduce Location
hdfs://172.20.10.6:8020/input/1.txt
hdfs://172.20.10.6:8020/output

TweetTrend分布式算法

问题及解决方案

#连接成功
$ hdfs dfs -ls hdfs://localhost:8020/

#连接拒绝
$ hdfs dfs -ls hdfs://node:8020/
修改JDK windows
* 解决方案 —— 将hadoop.dll复制到C:\Windows\System32路径下,成功解决

  1. 在Eclipse中运行Map/Reduce程序时出现该问题导致程序无法在Hadoop集群中运行

  2. JDK1.6到JDK1.8

上一篇 下一篇

猜你喜欢

热点阅读