如何编译Apache Hadoop2.6.0源代码 (3)

clip_image010

如果对linux不熟悉,一定使用我们推荐的centos6.5 64位操作系统。因为本文介绍的各种操作都是针对该版本的操作系统。

编译过程中需要的jar依赖,我已经全部下载了,并且打包,大家可以使用我的把内容替换。Maven仓库的默认位置在~/.m2/repository中,大家解压我的repository替换自己的就行。

重要提示:一定要保证虚拟机的网络畅通

a) 伪分布配置

1.把从文件夹“编译成功的hadoop2.6.0的64位版本”中解压hadoop-dist-2.6.0-binary-64.tar.gz 得到的hadoop-2.6.0放到/usr/local目录下。放好后,完整的目录结构是/usr/local/hadoop-2.6.0

如果是源代码编译的话,这里的路径指的是

clip_image012

2.文件夹“hadoop2.6.0伪分布配置文件”中的配置内容是伪分布设置。把这个目录中的所有内容复制到/usr/local/hadoop-2.6.0/etc/hadoop目录下,覆盖原有文件。

3.修改core-site.xml中的hdfs://crxy213.crxy:9000的值,改成自己的ip或者主机名

4.格式化,执行命令/usr/local/hadoop-2.6.0/sbin/hdfs namenode -format

5.启动,执行脚本/usr/local/hadoop-2.6.0/sbin/start-hadoop.sh

----------------------------bug

ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.0:descriptor (default-descriptor) on project hadoop-maven-plugins: The API of the mojo scanner is not compatible with this plugin version. Please check the plugin dependencies configured in the POM and ensure the versions match. /usr/java/jdk1.7.0_79/jre/lib/i386/xawt/libmawt.so: libXext.so.6: cannot open shared object file: No such file or directory -> [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]

%W@GJ$ACOF(TYDYECOKVDYB


[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command

yum list | grep libXext
yum  install   libXext.i686  来安装。
试过之后,不行,朋友过来说了下是不是环境变量有问题
我检查了下jdk 是32位的。
之后安装了64的,等了1个小时,成功!!!

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zwgyxj.html