flume1.7源码编译及main方法启动
来源:互联网 发布:西安 人工智能 编辑:程序博客网 时间:2024/05/24 03:53
一、编译
首先下载flume1.7源码,导入eclipse
1.Maven依赖报错Missing artifact jdk.tools:jdk.tools:jar:1.7
添加依赖
<dependency> <groupId>jdk.tools</groupId> <artifactId>jdk.tools</artifactId> <version>1.7</version> <scope>system</scope> <systemPath>${JAVA_HOME}/lib/tools.jar</systemPath> </dependency>
2.eclipse校验提示错误
原因:AvroFlumeEvent类是编译生成的,eclipse依赖找不到正常,没影响
3.运行 mvn install -Dmaven.test.skip=true -Dtar
编译成功后会在flume-ng-dist/target下生成tar包
4.仓库不全的话有些包下不到需手动添加,也可以直接注释不需要的插件依赖
手动添加方法:
首先,到 http://mvnrepository.com/ 这个网,在搜索栏中输入你要搜索的 JAR 包关键字
运行 mvn install:install-file -Dfile=E:\xxx\xxx.jar -DgroupId=xxx
-DartifactId=xxx -Dversion=xxx -Dpackaging=jar
二、启动
1.flume-ng-node根目录下创建test.properties
# example.conf: A single-node Flume configuration# Name the components on this agenta1.sources = r1a1.sinks = k1a1.channels = c1# Describe/configure the sourcea1.sources.r1.type = netcata1.sources.r1.bind = localhosta1.sources.r1.port = 44444a1.sources.r1.channels = c1# Describe the sinka1.sinks.k1.type = loggera1.sinks.k1.channel = c1# Use a channel which buffers events in memorya1.channels.c1.type = memorya1.channels.c1.capacity = 1000a1.channels.c1.transactionCapacity = 100
2.创建src/main/resources资源文件夹,复制根目录conf下log4j文件放进去,修改日志级别
3.设置Application运行参数 -n a1 -f test.conf
4.启动Application
使用telnet命令就可以测试了
5.启动可能报错没有相关类
原因:flume-ng-node默认依赖可能不包括该插件
比如kafka sink需在pom.xml增加依赖
<dependency> <groupId>org.apache.flume.flume-ng-sinks</groupId> <artifactId>flume-ng-kafka-sink</artifactId> </dependency>
0 0
- flume1.7源码编译及main方法启动
- flume1.6.0源码编译
- MVN编译Flume1.7源码时出现下载ua-parses-1.3.0 jar包失败
- MySQL源码分析及核心内幕之4 -- 源码服务端main函数开始及启动流程
- MySQL源码分析及核心内幕之4 -- 源码服务端main函数开始及启动流程
- Android源码下载及编译方法
- flume1.6.0安装及测试
- dubbo的main方法启动
- ubuntu下编译运行tinyhttpd方法及源码解析
- HDP开发常用资源地址及源码编译方法
- flume1.4.0安装及简单使用
- APUE2作者提供的源码编译方法及单个源码编译的实现(转载)
- APUE2作者提供的源码编译方法及单个源码编译的实现(转载)
- Maven打包,并设置main方法启动
- main方法启动spring 打包成jar
- 使用dubbo的main方法启动服务
- 使用main方法启动一个tomcat
- Awesomium源码及编译
- qt 下log4cplus的使用
- Codeforces 764A-Taymyr is calling you
- 数值填空题
- 开源OSS.Social微信项目进阶介绍
- 【密码学】一万字带您走进密码学的世界(下)
- flume1.7源码编译及main方法启动
- 开源OSS.Social微信项目解析
- Objective-C中使用extern引用外部全局变量(如:创建全局可变字符串)
- Codeforces 764B-Timofey and cubes
- leecode 解题总结:29 Divide Two Integers
- 这个项目碉堡了
- 244 设计模式 -- 行为型 -- 依赖注入
- python eval
- UOJ279 题目交流通道