Flume入门案例

Flume入门案例,第1张

Flume入门案例

1)创建netcat-logger.conf

# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1
​
# Describe/configure the source
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444
​
# Describe the sink
a1.sinks.k1.type = logger
​
# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
​
# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

2)启动 agent 去采集数据

bin/flume-ng agent -c conf -f conf/netcat-logger.conf -n a1 -Dflume.root.logger=INFO,console -c conf 指定 flume 自身的配置文件所在目录 -f conf/netcat-logger.con 指定我们所描述的采集方案 -n a1 指定我们这个 agent 的名字

3)测试

先要往 agent 采集监听的端口上发送数据,让 agent 有数据可采。 随便在一个能跟 agent 节点联网的机器上: telnet anget-hostname port (telnet localhost 44444)

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5677879.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存