我是Hadoop的新手。我尝试通过linux终端运行wordcount和PI等示例程序。现在想尝试使用eclipse.Can任何人请分享如何为Hadoop开发配置Eclipse?我在Ubuntu 14.04 LTS Vm上使用hadoop 2.6.0。
答案 0 :(得分:1)
您只需要在Eclipse项目中引用这些库,您将在其中使用Hadoop。这就是全部。
$HADOOP_HOME/libexec/share/hadoop/common/hadoop-common-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/hdfs/hadoop-hdfs-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/mapreduce/hadoop-mapreduce-client-common-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-plugins-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/mapreduce/hadoop-mapreduce-client-shuffle-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/mapreduce/hadoop-mapreduce-client-app-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/yarn/hadoop-yarn-api-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/yarn/hadoop-yarn-client-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/yarn/hadoop-yarn-common-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/yarn/hadoop-yarn-registry-2.6.0.jar
$HADOOP_HOME/libexec/share/hadoop/yarn/hadoop-yarn-server-common-2.6.0.jar
答案 1 :(得分:0)
您可以在Eclipse中创建Maven项目,并将以下依赖项添加到pom.xml并保存文件。它将构建工作区并将所有hadoop jar添加到库中。
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>1.2.1</version>
</dependency>
答案 2 :(得分:0)
感谢您的回复!。
我在后面的dirs中发现了类似的罐子:
$ HADOOP_HOME /股/的Hadoop /普通/
$ HADOOP_HOME /股/的Hadoop / HDFS
$ HADOOP_HOME /股/的Hadoop / MapReduce的
$ HADOOP_HOME /共享/ hadoop的/纱线
我创建了一个用户库并将其添加到我的eclipse项目的java bulid路径中并成功执行了该程序! 此外,我发现此链接很有用:http://www.kishorer.in/2014/10/running-wordcount-mapreduce-example-in.html