gpt4 book ai didi

hadoop - 在 Windows 7 上构建 Hadoop

转载 作者:可可西里 更新时间:2023-11-01 14:24:01 26 4
gpt4 key购买 nike

我关注了this tutorial用于在 Windows 7 环境中构建 Apache Hadoop。长话短说。我可以使用 mvn compile 命令编译 Hadoop,并可以使用 mvn -package -DskipTests

构建包

但是我无法mvn package -Pdist,native-win -DskipTests -Dtar我收到 I/O 异常并且无法解决这些异常。在没有 -Dtar 参数的情况下构建 Hadoop 时,我没有得到这些异常

有人可以帮我解决这些异常吗?

[INFO] Executing tasks
main:
[get] Destination already exists (skipping): C:\hadoop\hadoop-hdfs- project\hadoop-hdfs-httpfs\downloads\tomcat.tar.gz
[mkdir] Created dir: C:\hadoop\hadoop-hdfs-project\hadoop-hdfs-httpfs\target\tomcat.exp
[exec] tar (child): C\:hadoophadoop-hdfs-projecthadoop-hdfs-httpfs/downloads/tomcat.tar.gz: Cannot open: I/O error
[exec] tar (child): Error is not recoverable: exiting now
[exec]
[exec] gzip: stdin: unexpected end of file
[exec] tar: Child returned status 2
[exec] tar: Error exit delayed from previous errors
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Hadoop Main ................................ SUCCESS [ 1.018 s]
[INFO] Apache Hadoop Project POM ......................... SUCCESS [ 1.653 s]
[INFO] Apache Hadoop Annotations ......................... SUCCESS [ 2.181 s]
[INFO] Apache Hadoop Assemblies .......................... SUCCESS [ 0.200 s]
[INFO] Apache Hadoop Project Dist POM .................... SUCCESS [ 2.889 s]
[INFO] Apache Hadoop Auth ................................ SUCCESS [ 1.957 s]
[INFO] Apache Hadoop Auth Examples ....................... SUCCESS [ 1.570 s]
[INFO] Apache Hadoop Common .............................. SUCCESS [ 50.085 s]
[INFO] Apache Hadoop Common Project ...................... SUCCESS [ 0.090 s]
[INFO] Apache Hadoop HDFS ................................ SUCCESS [ 35.510 s]
[INFO] Apache Hadoop HttpFS .............................. FAILURE [ 5.155 s]
[INFO] Apache Hadoop HDFS Project ........................ SKIPPED
[INFO] hadoop-yarn ....................................... SKIPPED
[INFO] hadoop-yarn-api ................................... SKIPPED
[INFO] hadoop-yarn-common ................................ SKIPPED
[INFO] hadoop-yarn-server ................................ SKIPPED
[INFO] hadoop-yarn-server-common ......................... SKIPPED
[INFO] hadoop-yarn-server-nodemanager .................... SKIPPED
[INFO] hadoop-yarn-server-web-proxy ...................... SKIPPED
[INFO] hadoop-yarn-server-resourcemanager ................ SKIPPED
[INFO] hadoop-yarn-server-tests .......................... SKIPPED
[INFO] hadoop-yarn-client ................................ SKIPPED
[INFO] hadoop-mapreduce-client ........................... SKIPPED
[INFO] hadoop-mapreduce-client-core ...................... SKIPPED
[INFO] hadoop-yarn-applications .......................... SKIPPED
[INFO] hadoop-yarn-applications-distributedshell ......... SKIPPED
[INFO] hadoop-yarn-site .................................. SKIPPED
[INFO] hadoop-yarn-project ............................... SKIPPED
[INFO] hadoop-mapreduce-client-common .................... SKIPPED
[INFO] hadoop-mapreduce-client-shuffle ................... SKIPPED
[INFO] hadoop-mapreduce-client-app ....................... SKIPPED
[INFO] hadoop-mapreduce-client-hs ........................ SKIPPED
[INFO] hadoop-mapreduce-client-jobclient ................. SKIPPED
[INFO] hadoop-mapreduce-client-hs-plugins ................ SKIPPED
[INFO] Apache Hadoop MapReduce Examples .................. SKIPPED
[INFO] hadoop-mapreduce .................................. SKIPPED
[INFO] Apache Hadoop MapReduce Streaming ................. SKIPPED
[INFO] Apache Hadoop Distributed Copy .................... SKIPPED
[INFO] Apache Hadoop Archives ............................ SKIPPED
[INFO] Apache Hadoop Rumen ............................... SKIPPED
[INFO] Apache Hadoop Gridmix ............................. SKIPPED
[INFO] Apache Hadoop Data Join ........................... SKIPPED
[INFO] Apache Hadoop Extras .............................. SKIPPED
[INFO] Apache Hadoop Pipes ............................... SKIPPED
[INFO] Apache Hadoop Tools Dist .......................... SKIPPED
[INFO] Apache Hadoop Tools ............................... SKIPPED
[INFO] Apache Hadoop Distribution ........................ SKIPPED
[INFO] Apache Hadoop Client .............................. SKIPPED
[INFO] Apache Hadoop Mini-Cluster ........................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:43 min
[INFO] Finished at: 2014-05-19T11:24:25+00:00
[INFO] Final Memory: 49M/179M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "native-win" could not be activated because it does not
exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run dist) on project hadoop-hdfs-httpfs: An Ant BuildExcept ion has occured: exec returned: 2 - > [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[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 read the
following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

[ERROR]

[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :hadoop-hdfs-httpfs
c:\hadoop>

最佳答案

如果您使用的是更高版本的 Hadoop,即 Hadoop-2.6、2.7 或 2.8,则无需构建 Hadoop-src 来获取 Windows 原生 Hadoop。这是一个 GitHub 链接,其中包含适用于最新版本的 Hadoop 的 winutils。

我在使用 maven 构建 Hadoop-src 时也遇到了类似的问题,这些步骤对我有用。

Download & 在 c:/java/

中安装 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 二进制分发。

(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.

但如果您不想这样做,请下载预构建的 Hadoop 发行版的 winutils。这是一个 GitHub link ,其中包含某些版本的 Hadoop 的 winutils。

(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

希望这对您有所帮助。

关于hadoop - 在 Windows 7 上构建 Hadoop,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23735504/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com