当前位置:首页 > 服务端 > macbook 下 hadoop 源码开发环境搭建问题

macbook 下 hadoop 源码开发环境搭建问题

首先按照3.2.2-rc5 BUILDING.txt 说明安装指定包
git clone 源码
git checkout 到对应版本

然后执行:
mvn package -Pdist,native -DskipTests -Dmaven.javadoc.skip


issue 1:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.276 s
[INFO] Finished at: 2021-04-30T11:43:55+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:native-maven-plugin:1.0-alpha-8:javah (default) on project hadoop-common: Error running javah command: Error executing command line. Exit code:127 -> [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 -rf :hadoop-common

需要设置java环境变量:
vi ~/.bash_profile
//添加下面代码 export JAVA_HOME=\((/usr/libexec/java_home) export PATH=\)JAVA_HOME/bin:\(PATH export CLASS_PATH=\)JAVA_HOME/lib
source ~/.bash_profile


issue 2:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33.046 s
[INFO] Finished at: 2021-04-30T11:54:35+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.2.1:cmake-compile (cmake-compile) on project hadoop-hdfs-native-client: CMake failed with error code 1 -> [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 -rf :hadoop-hdfs-native-client

尝试过设置OPENSSL环境变量 无用;暂时无解


issue 3:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:46 min
[INFO] Finished at: 2021-04-30T18:33:54+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.2.2:cmake-compile (cmake-compile) on project hadoop-mapreduce-client-nativetask: make failed with error code 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 -rf :hadoop-mapreduce-client-nativetask

暂时无解;
更换成 2.10.1 版本后编译成功;编译后会生成 hadoop 可执行目录,需要按参考内容修改配置文件后启动服务;
配置文件:
core-site.xml
hdfs-site.xml
mapred-site.xml
yarn-site.xml

启动指令:
start-dfs.sh start-yarn.sh

启动进程:
SecondaryNameNode
NameNode
DataNode
ResourceManager
NodeManager


issue 4:

start-dfs.sh
启动报错 ssh: connect to host localhost port 22: Connection refused
原因:mac未开启ssh服务
解决:系统偏好设置--》共享--》设置远程登录


issue 5:

hdfs指令报错
hdfs dfs -ls
ls: Failed on local exception: java.io.IOException: Couldn't set up IO streams: java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V; Host Details : local host is: "C02F60CBMD6T/192.168.0.110"; destination host is: "localhost":9000;
安装包版本不对,
mvn clean 后重新下载源解决

其他:

启动后默认地址:
hdfs:
http://localhost:50070/dfshealth.html#tab-overview

yarn:
http://localhost:8088/cluster/apps

参考:

https://github.com/apache/hadoop/blob/release-3.2.2-RC5/BUILDING.txt
https://github.com/apache/hadoop/blob/release-2.10.1-RC0/BUILDING.txt
https://zhuanlan.zhihu.com/p/33117305
https://blog.csdn.net/Hu_wen/article/details/73481296

作者:heaventouch
来源链接:https://www.cnblogs.com/GO-NO-1/p/14737297.html

版权声明:
1、Java侠(https://www.javaxia.com)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。

2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。





本文链接:https://www.javaxia.com/server/125584.html

分享给朋友:

“macbook 下 hadoop 源码开发环境搭建问题” 的相关文章