1.环境
CentOS release 6.5 (Final) x86_64
java version "1.7.0_79"
hadoop-2.5.0-src.tar.gz
apache-maven-3.3.9
protobuf-2.5.0
2.配置yum
yum代理配置:/etc/yum.conf
proxy=http://user1:userpass1@IP:端口
yum -y install svn ncurses-devel gcc*
yum -y install lzo-devel zlib-devel autoconf automake libtool cmake openssl–devel
3.配置Maven
3.1环境变量/etc/profile
export MAVEN_HOME=/opt/apache-maven-3.3.9
export PATH=$PATH:$MAVEN_HOME/bin
3.2内网Maven代理$MAVEN_HOME/conf/setting.xml
<proxy>
<id>myProxy</id>
<active>true</active>
<protocol>http</protocol>
<host>IP</host>
<port>端口</port>
<username>user1</username>
<password>userpass1</password>
<nonProxyHosts></nonProxyHosts>
</proxy>
3.3配置Maven中央仓库
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
4.安装protobuf
链接: https://pan.baidu.com/s/1pL2e6jp 密码: hybu
cd protobuf-2.5.0
./configure
make && make install
5.编译 hadoop-2.5.0-src
链接: https://archive.apache.org/dist/hadoop/common/hadoop-2.5.0/hadoop-2.5.0-src.tar.gz
cd hadoop-2.5.0-src
mvn package -Pdist,native -DskipTests -Dtar
6.错误处理
6.1配置Ant代理.相应错误的pom.xml的target下增加代理
<target name="proxy" >
<setproxy
proxyhost="IP"
proxyport="端口"
proxyuser="user1"
proxypassword="userpass1"
/>
</target>
6.2Could NOT find OpenSSL, try to set the path to OpenSSL root folder
export OPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2j
export OPENSSL_INCLUDE_DIR=/usr/local/Cellar/openssl/1.0.2j/include/openssl
export OPENSSL_LIBRARIES=/usr/local/Cellar/openssl/1.0.2j/lib