欢迎关注大数据技术架构与案例微信公众号:过往记忆大数据
过往记忆博客公众号iteblog_hadoop
欢迎关注微信公众号:
过往记忆大数据

Flume-0.9.4源码编译依赖的thrift插件安装

  关于如何编译Flume-ng 1.4.0可以参见本博客的《基于Hadoop-2.2.0编译flume-ng 1.4.0及错误解决》
  在编译Flume-0.9.4源码的时候出现了以下的错误信息:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Flume ............................................. SUCCESS [0.003s]
[INFO] Flume Core ........................................ FAILURE [5.016s]
[INFO] Flume Master Config Web Application ............... SKIPPED
[INFO] Flume Node Web .................................... SKIPPED
[INFO] Flume Distribution Project ........................ SKIPPED
[INFO] A log4j appender for Flume ........................ SKIPPED
[INFO] Flume Hello World Plugin .......................... SKIPPED
[INFO] Flume HBase Plugin ................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.798s
[INFO] Finished at: Wed Jan 22 16:35:13 CST 2014
[INFO] Final Memory: 15M/136M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "dist" could not be activated because it does 
not exist.
[ERROR] Failed to execute goal org.apache.thrift.tools:maven-thrift-plugin:
0.1.10:compile (default) on project flume-core: thrift did not exit cleanly. 
Review output for more information. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors,re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read 
the following articles:
[ERROR] [Help 1] 
 http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :flume-core

这是因为编译Flume的时候需要用到thrift插件,可以参考flume-core/pom.xml文件里面的配置:

<plugin>
    <groupId>org.apache.thrift.tools</groupId>
    <artifactId>maven-thrift-plugin</artifactId>
    <version>0.1.10</version>
    <configuration>
      <thriftExecutable>${thrift.executable}</thriftExecutable>
    </configuration>
    <executions>
      <execution>
        <goals>
          <goal>compile</goal>
          <goal>testCompile</goal>
        </goals>
      </execution>
    </executions>
</plugin>

  如果你的电脑里面没有安装thrift插件的时候,就出出现错误,可以用下面的方法下载:

[wyp@master Desktop]$ git clone     \
               https://git-wip-us.apache.org/repos/asf/thrift.git thrift

  编译thrift的时候需要一些依赖,可以依次运行下面的命令解决:

[wyp@master Desktop]$  sudo yum install automake libtool flex bison pkgconfig \
           gcc-c++ boost-devel libevent-devel zlib-devel python-devel ruby-devel

下载的文件都放在thrift文件夹里面,进入thrift文件夹依次运行下面的命令

[wyp@master Desktop]$ cd thrift
[wyp@master thrift]$ ./bootstrap.sh
[wyp@master thrift]$ ./configure
[wyp@master thrift]$ make
[wyp@master thrift]$ make install

这样将会成功的将thrift安装在/usr/local/bin/thrift里面。这样就可以解决编译Flume-0.9.4出现上述的错误。
在执行./configure时可能会出错:Error: libcrypto required.
在fedora下应该安装:

openssl-devel:yum install openssl-devel
  如果你在http://thrift.apache.org/网上下载thrift-0.9.1,在make的时候将会出现以下的错误:

libtool: link: ar cru .libs/libtestgencpp.a .libs/ThriftTest_constants.o 
.libs/ThriftTest_types.o
ar: .libs/ThriftTest_constants.o: No such file or directory
make[3]: *** [libtestgencpp.la] 错误 1
make[3]: 离开目录“/home/wyp/Desktop/thrift-0.9.1/test/cpp”
make[2]: *** [all-recursive] 错误 1
make[2]: 离开目录“/home/wyp/Desktop/thrift-0.9.1/test”
make[1]: *** [all-recursive] 错误 1
make[1]: 离开目录“/home/wyp/Desktop/thrift-0.9.1”
make: *** [all] 错误 2

这是它源码的问题,不要用这种方法下载。

本博客文章除特别声明,全部都是原创!
原创文章版权归过往记忆大数据(过往记忆)所有,未经许可不得转载。
本文链接: 【Flume-0.9.4源码编译依赖的thrift插件安装】(https://www.iteblog.com/archives/910.html)
喜欢 (2)
分享 (0)
发表我的评论
取消评论

表情
本博客评论系统带有自动识别垃圾评论功能,请写一些有意义的评论,谢谢!