温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

centos7.0如何编译hadoop2.6

发布时间:2021-11-15 16:02:34 来源:亿速云 阅读:122 作者:小新 栏目:云计算

小编给大家分享一下centos7.0如何编译hadoop2.6,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

hadoop编译&集群

centos7.0  

将所有的需要的软件拷贝到/usr/local/softs目录下

所有软件都安装在/usr/lib

1.安装jdk1.7,配置环境变量

2.安装maven,配置环境变量

在conf/setting.xml找到

<localRepository>/path/to/local/repo</localRepository>

取消注释改为

<localRepository>/usr/lib/apache-maven-3.3.3/repo</localRepository>

在maven目录下创建repo/setting.xml

mkdir repo cp /usr/lib/apache-maven-3.3.3/conf/setting.xml setting.xml

删除<localRepository>/usr/lib/apache-maven-3.3.3/repo</localRepository>

响应的地方加入内容

<mirrors></mirros>中加入

<mirror>         <id>nexus-osc</id>          <mirrorOf>*</mirrorOf>      <name>Nexusosc</name>      <url>http://maven.oschina.net/content/groups/public/</url>    </mirror> <profiles></profiles>加入 <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>

3.安装ant,配置环境变量

4.安装protobuf

在softs目录下解压protobuf-2.5.0.tar.gz

tar -zxvf protobuf-2.5.0.tar.gz

cd protobuf-2.5.0

./configure --prefix=/usr/lib/protobuf

安装protobuf的时候会有依赖需要手动安装

yum -y install gcc-c++ glibc-headers glibc-devel yum -y install gcc make &&make install ldconfig

查看安装目录(就是前面configure配置的目录)

whereis protobuf

配置protobuf环境变量

vim /etc/profile export JAVA_HOME=/usr/lib/jdk1.7.0_79 export MAVEN_HOME=/usr/lib/apache-maven-3.3.3 export LD_LIBRARY_PATH=/usr/lib/protobuf export ANT_HOME=/usr/lib/apache-ant-1.9.4 export PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$LD_LIBRARY_PATH/bin:$ANT_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

检测protoc安装是否成功

[root@hadoop1 protobuf-2.5.0]# protoc --version libprotoc 2.5.0

5.安装openssl

yum install libssl-dev

6.安装cmake

yum install cmake yum install openssl-devel yum install zlib1g-dev yum install libssl-dev

7.开始编译啦

进入src目录下

cd hadoop-2.6.0-src

mvn package -Pdist,native -DskipTests -Dtar 

等时间吧

hadoop-2.6.0-src/hadoop-dist/target目录下有hadoop-2.6.0.tar.gz

如果编译失败就是依赖库没有 google一下了

以上是“centos7.0如何编译hadoop2.6”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI