2015-02-09 12 views
1

我想在我的windows機器上安裝hadoop。 我下面這個指南:https://wiki.apache.org/hadoop/Hadoop2OnWindows 但是當我必須執行這一行:hadoop windows org.codehaus.mojo:exec-maven-plugin

mvn package -Pdist,native-win -DskipTests -Dtar 

我有這樣的錯誤:

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec (com 
 
pile-ms-winutils) on project hadoop-common: Command execution failed. Process ex 
 
ited with an error: 1(Exit value: 1) -> [Help 1] 
 
[ERROR] 
 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit 
 
ch. 
 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
 
[ERROR] 
 
[ERROR] For more information about the errors and possible solutions, please rea 
 
d the following articles: 
 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE 
 
xception
我已經閱讀這篇文章 build hadoop 2.2 on windows 但我無法理解如何解決。

非常感謝您的幫助。

Alex

回答

-1

如果您使用的是最新版本的Hadoop,即Hadoop-2.8或2.7,那麼不需要使用Maven構建Hadoop-src,而是在Windows中配置(更高版本)Hadoop的簡單方法。

Download &在c:/java/

make sure the path is this way, if java is installed in program files, then hadoop-env.cmd will not recognize java path

Download Hadoop的二進制分發安裝Java。

I am using binary distribution Hadoop-2.8.1

設置環境變量:

JAVA_HOME = "c:/Java" 
HADOOP_HOME="<your hadoop home>" 
Path= "JAVA_HOME/bin" 
Path = "HADOOP_HOME/bin" 

Hadoop will work on windows if Hadoop-src is built using maven in your windows machine. Building the Hadoop-src (distribution) will create a Hadoop binary distribution, which will work as windows native version.

但是,如果你不想這樣做,那麼下載預先builted winutils of Hadoop distribution. 這裏是一個GitHub link,其中有一些版本的winutils的Hadoop。

if the version you are using is not in the list, the follow the conventional method for setting up Hadoop on windows - link

如果你找到你的版本,然後複製粘貼文件夾的所有內容轉換成路徑:/ bin中/

Set all the .xml configuration files - Link & set JAVA_HOME path in hadoop-env.cmd file

從CMD去:

<HADOOP_HOME>/bin/> hdfs namenode -format 
<HADOOP_HOME>/sbin> start-all.cmd 

希望這有助於。

+0

儘管此鏈接可能會回答問題,但最好在此處包含答案的基本部分,並提供供參考的鏈接。如果鏈接頁面更改,則僅鏈接答案可能會失效。 – pirho 2017-12-05 09:11:36

+0

謝謝提及。該鏈接有我自己的答案,但我仍然會發布原始答案。 – 2017-12-05 09:19:01

+1

好吧,它可能不會從SO刪除。我仍然不確定複製是否是最佳解決方案,而是考慮將問題標記爲與已經回答的問題相同的問題。 – pirho 2017-12-05 09:21:52