提示:最好在64位操作系统下编译。虚拟机内存不低于2G,硬盘空间不低于10G
首先安装google的protobuf
yum install glibc-headers
yum install gcc yum install gcc-c++ yum install make
yum install cmake yum install openssl-devel yum install ncurses-devel
tar zxvf protobuf-2.5.0.tar.gz
cd protobuf-2.5.0 && ./configure && make && make check && make install
然后安装maven-3.0.5
配置环境变量M2_HOME为maven路径
然后PATH加:$M2_HOME/bin
下载hadoop-2.4.1-src
解压后,执行mvn clean package -DskipTests -Pdist,native
编译。
备注:clean 清空编译环境,package编译后打包,DskipTests跳过测试,
编译完后在hadoop-dist下,target目录里~