|
启动Eclipse,
右键点击 ProjectExplorer窗口,选择 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就开始运行了.
结束了^_^ |
|
|
|
|
|
|