标签:classes share 错误 oge pac yum url intern comm
os:centos 6.7 x64
WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
hadoop的cache和短路读(Short-Circuit Local Reads)都需要native library的支持
编译方法是
http://hadoop.apache.org/docs/r2.3.0/hadoop-project-dist/hadoop-common/NativeLibraries.html
编译过程中可能出现
[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:2.3.0:protoc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecutionException: ‘protoc --version‘ did not return a version -> [Help 1]
这时需要在系统中安装protobuf
从https://github.com/google/protobuf/archive/v3.2.0.tar.gz下载3.2.0源码3.3.0编译有问题,
1、 下载工具:
$ sudo yum install autoconf automake libtool curl make g++ unzip
2、 首先生成configure script
$ ./autogen.sh
3、 编译和安装
$ ./configure
出错:configure: error: C++ preprocessor "/lib/cpp" fails sanity check
解决:这是缺少相应的库导致的,安装相应的库也可。
# yum install glibc-headers
# yum install gcc-c++
再执行$ ./configure 就OK了。
4、 继续编译
$ make
出错:
./google/protobuf/metadata.h:175: 错误:类‘google::protobuf::internal::InternalMetadataWithArena’ 没有名为‘InternalMetadataWithArenaBase’ 的字段
./google/protobuf/metadata.h:204: 错误:类‘google::protobuf::internal::InternalMetadataWithArenaLite’ 没有名为‘InternalMetadataWithArenaBase’ 的字段
解决:把src/google/protobuf/metadata.h:175和204:的代码改一下(参考https://github.com/google/protobuf/pull/2599/commits/141a1dac6ca572056c6a8b989e41f6ee213f8445#diff-4842737ed3a65a110689915a0540b272L175)
再make,OK
5、 继续make check,时间确实好长
$ make check
$ sudo make install
$ sudo ldconfig # refresh shared library cache.
即可.
6、 测试一下
protoc –version
返回libprotoc 3.2.0
安装OK
标签:classes share 错误 oge pac yum url intern comm
原文地址:http://www.cnblogs.com/rushwoo/p/7147844.html