标签:64位 centos hadoop bigdata maven
[bigdata001@Yuxi software]$ tar -xvzf jdk-7u60-linux-x64.tar.gz
PATH=$PATH:$HOME/bin export JAVA_HOME=/home/bigdata001/BigDataPlatform/jdk1.7.0_60 export JAVA_BIN=$JAVA_HOME/bin export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export JRE_HOME=$JAVA_HOME/jre export PATH=$PATH:$JAVA_HOME/bin export PATH
[bigdata001@Yuxi ~]$ source .bash_profile
[bigdata001@Yuxi ~]$ java -version
java version "1.7.0_60" Java(TM) SE Runtime Environment (build 1.7.0_60-b19) Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)
[bigdata001@Yuxi software]$ tar -xvzf apache-maven-3.2.3-bin.tar.gz
修改系统环境变量有两种方式,修改/etc/profile,或者在/etc/profile.d/下添加定制的shell文件,鉴于profile文件的重要性,尽量不要在profile文件里添加内容,官方建议采用第二种,以保证profile文件的绝对安全。
下面采用第二种方式:
[root@Yuxi etc]# cd /etc/profile.d/ [root@Yuxi profile.d]# touch maven.sh
向maven.sh中添加如下内容
export MAVEN_HOME='/home/bigdata001/BigDataPlatform/apache-maven-3.2.3' export PATH=$MAVEN_HOME/bin:$PATH
[root@Yuxi profile.d]# source /etc/profile
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-12T04:58:10+08:00) Maven home: /home/bigdata001/BigDataPlatform/apache-maven-3.2.3 Java version: 1.7.0_60, vendor: Oracle Corporation Java home: /home/bigdata001/BigDataPlatform/jdk1.7.0_60/jre Default locale: zh_CN, platform encoding: UTF-8 OS name: "linux", version: "2.6.32-431.el6.x86_64", arch: "amd64", family: "unix"
[root@Yuxi ~]# yum install gcc*
[bigdata001@Yuxi software]$ tar -xvf protobuf-2.5.0.tar.bz2
[bigdata001@Yuxi BigDataPlatform]$ cd protobuf-2.5.0/ [bigdata001@Yuxi protobuf-2.5.0]$ ./configure [bigdata001@Yuxi protobuf-2.5.0]$ make [bigdata001@Yuxi protobuf-2.5.0]$ make check [root@Yuxi protobuf-2.5.0]# make install
[root@Yuxi protobuf-2.5.0]# protoc --version
libprotoc 2.5.0
[bigdata001@Yuxi software]$ tar -xvzf hadoop-2.4.1-src.tar.gz
切换为root权限并修改文件
[root@Yuxi BigDataPlatform]# gedit apache-maven-3.2.3/conf/settings.xml
增加profile内容
<profile> <id>jdk-1.7</id> <activation> <jdk>1.7</jdk> </activation> <repositories> <repository> <id>nexus</id> <name>local private nexus</name> <url>http://maven.oschina.net/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>nexus</id> <name>local private nexus</name> <url>http://maven.oschina.net/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile>
[root@Yuxi hadoop-2.4.1-src]# yum install ncurses-devel [root@Yuxi hadoop-2.4.1-src]# yum install openssl-devel [root@Yuxi hadoop-2.4.1-src]# yum install cmake
[root@Yuxi hadoop-2.4.1-src]# mvn package -Pdist,native -DskipTests -Dtar经过的漫长等待,hadoop编译结束,效果如图
/home/bigdata001/BigDataPlatform/hadoop-2.4.1-src/hadoop-dist/target
[bigdata001@Yuxi hadoop-2.4.1]$ bin/hadoop version
Hadoop 2.4.1 Subversion Unknown -r Unknown Compiled by root on 2014-08-18T10:51Z Compiled with protoc 2.5.0 From source with checksum bb7ac0a3c73dc131f4844b873c74b630 This command was run using /home/bigdata001/BigDataPlatform/hadoop-2.4.1-src/hadoop-dist/target/hadoop-2.4.1/share/hadoop/common/hadoop-common-2.4.1.jar
[bigdata001@Yuxi hadoop-2.4.1]$ file lib//native/*
lib//native/libhadoop.a: current ar archive lib//native/libhadooppipes.a: current ar archive lib//native/libhadoop.so: symbolic link to `libhadoop.so.1.0.0' lib//native/libhadoop.so.1.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped lib//native/libhadooputils.a: current ar archive lib//native/libhdfs.a: current ar archive lib//native/libhdfs.so: symbolic link to `libhdfs.so.0.0.0' lib//native/libhdfs.so.0.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
centOS 64位下编译hadoop2.4.1,布布扣,bubuko.com
标签:64位 centos hadoop bigdata maven
原文地址:http://blog.csdn.net/zyxesc/article/details/38687249