Flume怎么采集发送消息到kafka
发表于:2024-10-14 作者:千家信息网编辑
千家信息网最后更新 2024年10月14日,这篇文章主要讲解了"Flume怎么采集发送消息到kafka",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"Flume怎么采集发送消息到kafka"吧!F
千家信息网最后更新 2024年10月14日Flume怎么采集发送消息到kafka
这篇文章主要讲解了"Flume怎么采集发送消息到kafka",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"Flume怎么采集发送消息到kafka"吧!
Flume agent脚本及配置如下
Mac
安装:
brew install flume
启动脚本:
nohup /usr/local/Cellar/flume/1.9.0/bin/flume-ng agent --conf /data/flume/run/flume/conf/conf.d/ --conf-file /data/flume/run/flume/conf/conf.d/mg-res_test.conf --name mg-res_test -Dflume.codeadmin.logger=INFO,console &
linux
安装:
http://flume.apache.org/download.html
启动脚本:
nohup /data/flume/run/flume/bin/flume-ng agent --conf /data/flume/run/flume/conf/conf.d/ --conf-file /data/flume/run/flume/conf/conf.d/mg-res_test.conf --name mg-res_test -Dflume.codeadmin.logger=INFO,console &
配置说明
/data/flume/run/flume/conf/conf.d/mg-res_test.conf
flume主要配置信息,关注中文描述的部分即可
# Name the components on this agentmg-res_test.sources = mg-res_testmg-res_test.sinks = mg-res_testmg-res_test.channels = mg-res_test# Describe/configure the sourcemg-res_test.sources.mg-res_test.type = TAILDIR# flume 记录偏移量文件mg-res_test.sources.mg-res_test.positionFile=/data/logs/test/res-test/mg-res_test.jsonmg-res_test.sources.mg-res_test.filegroups=f1# 待采集的日志文件mg-res_test.sources.mg-res_test.filegroups.f1=/data/logs/test/res-test/app.logmg-res_test.sources.mg-res_test.fileHeader=true# Describe the sinkmg-res_test.sinks.mg-res_test.channel = mg-res_testmg-res_test.sinks.mg-res_test.type = org.apache.flume.sink.kafka.KafkaSink# kafka topic配置 以实际为准mg-res_test.sinks.mg-res_test.kafka.topic = res-test# kafka 配置信息 以实际为准mg-res_test.sinks.mg-res_test.kafka.bootstrap.servers = localhost:9092mg-res_test.sinks.mg-res_test.kafka.flumeBatchSize = 2mg-res_test.sinks.mg-res_test.kafka.producer.acks = 1mg-res_test.sinks.mg-res_test.kafka.producer.linger.ms = 1mg-res_test.sinks.mg-res_test.kafka.producer.compression.type = snappy# Use a channel which buffers events in memorymg-res_test.channels.mg-res_test.type = memorymg-res_test.channels.mg-res_test.capacity = 100000mg-res_test.channels.mg-res_test.transactionCapacity = 10000# Bind the source and sink to the channelmg-res_test.sources.mg-res_test.channels = mg-res_testmg-res_test.sinks.mg-res_test.channel = mg-res_test
/data/flume/run/flume/conf/conf.d/flume-env.sh
配置java home即可
export JAVA_OPTS="-Xms128m -Xmx128m -Dcom.sun.management.jmxremote"JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home
验证
本地环境可以直接启动kafka消费看有没有消息进入,测试环境请查询kafka消息增量或业务系统实际消费情况
kafka-console-consumer --bootstrap-server localhost:9092 --topic res-test --from-beginning
感谢各位的阅读,以上就是"Flume怎么采集发送消息到kafka"的内容了,经过本文的学习后,相信大家对Flume怎么采集发送消息到kafka这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是,小编将为大家推送更多相关知识点的文章,欢迎关注!
消息
配置
实际
脚本
学习
信息
内容
情况
文件
环境
消费
验证
业务
增量
就是
思路
文章
日志
更多
知识
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
普洱高密度存储服务器经销商
大华平台管理服务器
零售行业网络安全ppt
网络安全绘画设计说明
word协同编辑 服务器搭建
2021网络安全博士
软件开发不知道报价怎么办
苏州极川互联网科技有限公司
服务器怎么搭建流量卡
用struts2连接数据库
工业网络技术问题
通信达是用什么软件开发的
数据库开发专业有哪些
vs2022 数据库应用
华为网络技术教材
人大金仓数据库怎么计算时间差
韩国网络安全水平
经营范围 软件开发服务费
地下城服务器喇叭图片
目前常用的数据库是什么类型
河南 网络安全与
国内互联网科技公司有哪些
重庆net软件开发价钱是多少
linux网络服务器
服务器安全狗怎么卸
网络安全宣传亮点法院
明日之后服务器信息
服务器怎么开远程桌面
柳林网络安全保卫大队
海康视频服务器logo