下载官方编译好的包安装老是报错:Unable to load native-hadoop library for your platform
用file命令查看发现官方包里的libhadoop.so.1.0.0文件竟然是64位的。
假设应该安装了jdk,教程:http://blog.csdn.net/ggz631047367/article/details/42366687
1.安装maven
sudo apt-get install maven
mvn --version
2.安装依赖库
sudo apt-get install g++ autoconf automake libtool cmake zlib1g-dev pkg-config libssl-dev
3.安装openssh
sudo apt-get install openssh-server
4.安装protoc
sudo apt-get install protobuf-compiler
protoc --version
5.OK开始编译,cd进入HADOOP源代码目录 hadoop-2.6.0-src,执行:
mvn clean package -Pdist,native -DskipTests -Dtar
成功会显示:BUILD SUCCESS
编译好的文件就在:hadoop-2.6.0-src/hadoop-dist/target
错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.8.1:jar (module-javadocs)
on project hadoop-maven-plugins: MavenReportException: Error while creating archive:
解决方法:把jdk1.8.0会有这个错误,切换其它版本。
sudo update-alternatives --config java
sudo update-alternatives --config javac