初始化安装目录

mkdir -p /export/servers
mkdir -p /export/software
mkdir -p /export/data
mkdir -p /export/logs

关闭防火墙,编译时可以不需要

chkconfig iptables off
service iptables stop

设置免密登陆,可以不设置

ssh-keygen
ssh-copy-id cdh01
ssh-copy-id cdh02
ssh-copy-id cdh03

安装编译需要的各种包

yum install -y bzip2-devel
yum install -y openssh-clients
yum install -y wget
yum install -y gcc gcc-c++ libstdc++-devel tcl
yum install -y cmake
yum install -y ant
yum install -y openssl-devel

安装jdk1.7

source /etc/profile
java -version

java version "1.7.0_75"
Java(TM) SE Runtime Environment (build 1.7.0_75-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.75-b04, mixed mode)

安装protobuf

cd /export/servers/protobuf/
./configure --prefix=/usr/local/protoc/
make && make install

安装snappy1.1

cd /export/servers/snappy/
./configure
make && make install

安装mvn 版本有限制,不能使用太高

mvn -version

Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 08:51:28-0500)
Maven home: /export/servers/maven
Java version: 1.7.0_75, vendor: Oracle Corporation
Java home: /export/servers/jdk/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-573.el6.x86_64", arch: "amd64", family: "unix"

编译源码

wget http://archive.cloudera.com/cdh5/cdh/5/hadoop-2.6.0-cdh5.14.0-src.tar.gz
解压后重命名为cdh_src
cd /export/servers/cdh_src/
mvn package -DskipTests -Pdist,native -Dtar -Drequire.snappy -e -X

获取编译后的包

cd hadoop-dist/target/

标签: none

相关文章推荐

添加新评论,含*的栏目为必填