• 通过tarball形式安装HBASE Cluster(CDH5.0.2)——重新编译CDH5.0.2 HADOOP点滴


    本文参考博文Hadoop2.2.0遇到64位操作系统平台报错,重新编译Hadoop

    由于我采用的tarball方式安装hadoop,其lib/native下根本没有内容,启动hdfs时报这个经典的native 库转载失败警告

    WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
    

     所以,需要重新编译hadoop项目。

    注意我的系统是CentOS 6.5  CDH5.0.2 ,需要下载maven3.1.1版本

    一、下载maven 3.1.1并展开

    #下载maven tar包
    wget http://apache.fayea.com/apache-mirror/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz #展开到/usr/lib目录 tar -C /usr/lib -zxvf apache-maven-3.0.5-bin.tar.gz
    #在usr下面建立软链接
    cd /usr
    sudo ln -s /usr/lib/apache-maven-3.1.1/ maven
    #编辑/etc/profile
    sudo vim /etc/profile
    #添加如下变量
    export MAVEN_HOME=/usr/maven
    PATH=$PATH:$MAVEN_HOME/bin

    二、编译Hadoop

    mvn package -DskipTests -Pdist,native -Dtar
    

     maven需要下载一大堆文件,网络必须畅通。开始一切顺利,当编译到hadoop-common的时候总是Error,编译过不去,我确信需要的包都已安装了,于是我进入hadoop-common-project子目录,单独编译这个子项目,发现如下错误:

    CMake Error: The current CMakeCache.txt directory /var/hadoop/hadoop-2.3.0-cdh5.0.2/src/hadoop-common-project/hadoop-common/target/native/CMakeCache.txt is different than the directory 
    /usr/hadoop/hadoop-2.3.0-cdh5.0.2/src/hadoop-common-project/hadoop-common/target/native where CMackeCache.txt was created. This may result in binaries being created in the wrong place.
    If you are not sure, reedit the CMakeCache.txt

     看来是以前编译残留文件不一致导致的,于是我清除编译缓存,重新编译,终于编译成功了,见到了久违的BUILD SUCCESS

    mvn clean -DskipTests
    mvn compile -DskipTests
    mvn package -DskipTests -Dtar -Pdist,native
    ##BUILD SUCCESS

    ##COPY native libraries to the lib/native directory
    cp ~/hadoop/src/hadoop-dist/lib/native/* ~/hadoop/lib/native
    start-dfs.sh

    编译完成后,复制src/hadoop-dist/lib/native中的文件到~/hadoop/lib/native目录下,重新启动dfs集群,ok警告没有了,问题解决。

  • 相关阅读:
    asp.net 使用urlrewrite之后的form postback
    WebService来获取Context.User.Identity.Name为空的问题?
    求救:C#的一个绘图问题
    flex 使用webservice的域访问问题
    请教大家一个问题,有关于数据库的设计
    C# 中使用结构体
    Discuz Nt 3.0开启Memcached 以及二次开发监控Memcached状态
    Flex 中对xml数据的处理
    Oracle alert log 按天 存放 脚本
    Asktom Oracle:On Caching and Evangelizing SQL
  • 原文地址:https://www.cnblogs.com/dajianshi/p/3844289.html
Copyright © 2020-2023  润新知