测试专用Demo
修改Flume 的配置文件 我用的CDH 版本的 CM (Clouder Manager) 来修改的配置进行的测试:
1、打开 Flume
2、点击配置修改配置文件
3、粘贴测试Demo内容到
Agent Default Group
# example.conf: A single-node Flume configuration
# Name the components on this agent 组件命名
a1.sources = r1
a1.sinks = k1
a1.channels = c1
# Describe/configure the source source 配置
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444
# Describe the sink sink 类型配置
a1.sinks.k1.type = logger
# Use a channel which buffers events in memory channel 类型配置
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
# Bind the source and sink to the channel 绑定source 和 sink 给 channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
4、上agent 节点执行
查看agnet 通过 Flume 下的 实例 查看
yum -y install telnet-0.17-64.el7.x86_64
telnet localhost 44444
5、观察Hdfs 是否有 Flume 文件生成