測試專用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 文件生成