flume简单案例

从指定网络端口输出数据到控制台:

编写example.conf文件在flume的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 = hadoop102
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
#Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

启动flume:

flume-ng agent --name a1 --conf /opt/module/apache-flume-1.9.0-bin/conf -f /opt/module/apache-flume-1.9.0-bin/conf/example.conf -Dflume.root.logger=INFO,console

 

访问hadoop102的44444端口测试:

下载telnet  yum install telnet

使用telnet hadoop102 44444测试

但是没有成功,尝试了很多方法,花费了很多时间,只能先放一放,进行下一个。

posted @ 2022-03-16 10:28  风吹过半夏  阅读(44)  评论(0编辑  收藏  举报