在下载官网上的binary包安装之后发现,在启动HDFS的时候总会出现无法加载 NATIVE 本地库的错误。无奈只好重新编译一份。
- 官网下载3.0.0源码。
- 使用MAVEN 进行编译。MAC上如果没有安装,使用命令
brew install maven
进行安装
- 编译前的准备
编译过程
hadoop的编译需要依赖cmake、openssl等相关依赖环境, 必要服务列表为:
- Unix System ## Unix类型的操作系统
- JDK 1.8+ ## JDK至少1.8版本
- Maven 3.0 or later ## Maven环境3.x版本以上,最好将maven的源修改为国内源,默认国外源可能连接不上
- Findbugs 1.3.9 (if running findbugs) ## 可选
- ProtocolBuffer 2.5.0 ## 必须,版本不要选择错误了
- CMake 2.6 or newer (if compiling native code), must be 3.0 or newer on Mac ## 进行native编译过程中必须服务
- Zlib devel (if compiling native code) ## cmake服务需要
- openssl devel (if compiling native hadoop-pipes and to get the best HDFS encryption performance) ## cmake服务需要
- Linux FUSE (Filesystem in Userspace) version 2.6 or above (if compiling fuse_dfs)
- Internet connection for first build (to fetch all Maven and Hadoop dependencies)
- python (for releasedocs)
- bats (for shell code testing)
- Node.js / bower / Ember-cli (for YARN UI v2 building)