下載: hadoop2x-eclipse-pluginjava
Hadoop-2.5.2和hadoop-2.6.4版本選擇hadoop-eclipse-plugin-2.6.0.jar(親測可用)
將hadoop-eclipse-plugin-2.6.0.jar拷貝到eclipse\plugins下
重啓eclipsegit
eclipse.exe -cleangithub
這時,在eclipse Project Explorer視圖下,能看到,多出了DFS Locations apache
Windows -> Preferences windows
Windows -> Perspective -> Open Perspective -> Other… 選中 Map/Reduce eclipse
進入Map/Reduce視圖,新建 Hadoop location… oop
設置集羣地址 測試
下載64位的hadoop2.6版本插件,放在某一目錄的bin目錄下(必定要爲bin目錄) spa
下載: hadoop2.6-x64.net
將其中的hadoop.dll 拷貝至 C:\Windows\System32目錄下
新建MapReduce工程
將集羣中hadoop-2.6.4/etc/hadoop下的配置文件拷貝到工程下
利用hadoop-wiki例子:WordCount
測試:
代碼添加設置系統屬性」hadoop.home.dir」,value值爲第三步設置bin目錄的父目錄。
System.setProperty("hadoop.home.dir", "D:\\hadoop\\hadoop2.6-x64" );