启动Eclipse,
- 右键点击 Project Explorer 窗口,选择 New -> Project.. 找到 Map/Reduce Project, 点Next ,输入名字。
- 点击下面的Config Hadoop Install Directiory,输入Hadoop的目录,如:C:/cygwin/home/User/hadoop-0.19.2
- 右键点击新创建的 Hadoop 工程,选择 New -> Other 转到 Map/Reduce 文件夹, 选择 MapReduceDriver 然后点击 Next ,输入名字,点击Finish。
- 新创建了一个文件,但是有错误,把
conf.setInputPath(new Path("src"));
conf.setOutputPath(new Path("out"));换为
conf.setInputFormat(TextInputFormat.class);
conf.setOutputFormat(TextOutputFormat.class);
FileInputFormat.setInputPaths(conf, new Path("In"));
FileOutputFormat.setOutputPath(conf, new Path("Out"));
右键点击文件,选择 Run As --> Run on Hadoop. 弹出以下窗口:
选择 "Choose existing hadoop location" , 然后选择刚才创建的localhost ,点Finish 就开始运行了.
结束了^_^
本文详细介绍了如何使用Eclipse IDE配置Hadoop开发环境的过程,包括创建Map/Reduce项目、设置Hadoop安装目录以及运行MapReduce任务的具体步骤。
&spm=1001.2101.3001.5002&articleId=4475004&d=1&t=3&u=43e219aa9c2f487ebbe7dbf11113f625)
1698

被折叠的 条评论
为什么被折叠?



