Flume-0.9.4源码编译依赖的thrift插件安装
关于如何编译Flume-ng 1.4.0可以参见本博客的《基于Hadoop-2.2.0编译flume-ng 1.4.0及错误解决》
在编译Flume-0.9.4源码的时候出现了以下的错误信息:
| 01 | [INFO] ------------------------------------------------------------------------ |
| 02 | [INFO] Reactor Summary: |
| 04 | [INFO] Flume ............................................. SUCCESS [0.003s] |
| 05 | [INFO] Flume Core ........................................ FAILURE [5.016s] |
| 06 | [INFO] Flume Master Config Web Application ............... SKIPPED |
| 07 | [INFO] Flume Node Web .................................... SKIPPED |
| 08 | [INFO] Flume Distribution Project ........................ SKIPPED |
| 09 | [INFO] A log4j appender for Flume ........................ SKIPPED |
| 10 | [INFO] Flume Hello World Plugin .......................... SKIPPED |
| 11 | [INFO] Flume HBase Plugin ................................ SKIPPED |
| 12 | [INFO] ------------------------------------------------------------------------ |
| 14 | [INFO] ------------------------------------------------------------------------ |
| 15 | [INFO] Total time: 5.798s |
| 16 | [INFO] Finished at: Wed Jan 22 16:35:13CST 2014 |
| 17 | [INFO] Final Memory: 15M/136M |
| 18 | [INFO] ------------------------------------------------------------------------ |
| 19 | [WARNING] The requested profile "dist" could not be activated because it does |
| 21 | [ERROR] Failed to execute goal org.apache.thrift.tools:maven-thrift-plugin: |
| 22 | 0.1.10:compile (default) on project flume-core: thrift did not exit cleanly. |
| 23 | Review output for more information. -> [Help 1] |
| 25 | [ERROR] To see the full stack trace of the errors,re-run Maven with the -e switch. |
| 26 | [ERROR] Re-run Maven using the -X switch to enable full debug logging. |
| 28 | [ERROR] For more information about the errors and possible solutions, please read |
| 29 | the following articles: |
| 32 | http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException |
| 35 | [ERROR] After correcting the problems, you can resume the build with the command |
| 36 | [ERROR] mvn <goals> -rf :flume-core |
这是因为编译Flume的时候需要用到thrift插件,可以参考flume-core/pom.xml文件里面的配置:
| 02 | <groupId>org.apache.thrift.tools</groupId> |
| 03 | <artifactId>maven-thrift-plugin</artifactId> |
| 04 | <version>0.1.10</version> |
| 06 | <thriftExecutable>${thrift.executable}</thriftExecutable> |
| 12 | <goal>testCompile</goal> |
如果你的电脑里面没有安装thrift插件的时候,就出出现错误,可以用下面的方法下载:
| 1 | [wyp@master Desktop]$ git clone \ |
| 2 | https://git-wip-us.apache.org/repos/asf/thrift.git thrift |
编译thrift的时候需要一些依赖,可以依次运行下面的命令解决:
| 1 | [wyp@master Desktop]$ sudo yum install automake libtool flex bison pkgconfig \ |
| 2 | gcc-c++ boost-devel libevent-devel zlib-devel python-devel ruby-devel |
下载的文件都放在thrift文件夹里面,进入thrift文件夹依次运行下面的命令
| 1 | [wyp@master Desktop]$ cd thrift |
| 2 | [wyp@master thrift]$ ./bootstrap.sh |
| 3 | [wyp@master thrift]$ ./configure |
| 4 | [wyp@master thrift]$ make |
| 5 | [wyp@master thrift]$ make install |
这样将会成功的将thrift安装在/usr/local/bin/thrift里面。这样就可以解决编译Flume-0.9.4出现上述的错误。
在执行./configure时可能会出错:Error: libcrypto required.
在fedora下应该安装:
| 1 | openssl-devel:yum install openssl-devel |
如果你在http://thrift.apache.org/网上下载thrift-0.9.1,在make的时候将会出现以下的错误:
| 01 | libtool: link: ar cru .libs/libtestgencpp.a .libs/ThriftTest_constants.o |
| 02 | .libs/ThriftTest_types.o |
| 03 | ar: .libs/ThriftTest_constants.o: No such file or directory |
| 04 | make[3]: *** [libtestgencpp.la] 错误 1 |
| 05 | make[3]: 离开目录“/home/wyp/Desktop/thrift-0.9.1/test/cpp” |
| 06 | make[2]: *** [all-recursive] 错误 1 |
| 07 | make[2]: 离开目录“/home/wyp/Desktop/thrift-0.9.1/test” |
| 08 | make[1]: *** [all-recursive] 错误 1 |
| 09 | make[1]: 离开目录“/home/wyp/Desktop/thrift-0.9.1” |
这是它源码的问题,不要用这种方法下载。
关注云帆教育微信公众号yfteach,第一时间获取公开课信息。