企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 1. 创建Flume配置文件 在node1节点的Flume的job目录下创建file_to_kafka.conf ``` mkdir job vim job/file_to_kafka.conf ``` # 2. 配置文件内容如下 ``` #定义组件 a1.sources = r1 a1.channels = c1 #配置source a1.sources.r1.type = TAILDIR a1.sources.r1.filegroups = f1 a1.sources.r1.filegroups.f1 = /opt/module/applog/log/app.* a1.sources.r1.positionFile = /opt/module/flume/taildir_position.json a1.sources.r1.interceptors = i1 a1.sources.r1.interceptors.i1.type = com.atguigu.gmall.flume.interceptor.ETLInterceptor$Builder #配置channel a1.channels.c1.type = org.apache.flume.channel.kafka.KafkaChannel a1.channels.c1.kafka.bootstrap.servers = node1:9092,node2:9092 a1.channels.c1.kafka.topic = topic_log a1.channels.c1.parseAsFlumeEvent = false #组装 a1.sources.r1.channels = c1 ``` # 3. 项目打包 ![](https://img.kancloud.cn/ac/12/ac12ec0d4ea1afe1059d87893be2f95a_776x99.png) # 4. 需要先将打好的包放入到hadoop102的/opt/module/flume/lib文件夹下面