Flume 监听端口

1) 安装telnet工具

   yum -y install telnet

2) 创建Flume Agent配置文件flume-telnet.conf

#1.定义Agent ===> a1

a1.sources = r1

a1.sinks = k1

a1.channels = c1

 

#2.定义source

a1.sources.r1.type = netcat

a1.sources.r1.bind = bigdata112(一定要修改为自己的)

a1.sources.r1.port = 44445

 

#3.定义sink

a1.sinks.k1.type = logger

 

#4.定义channel

a1.channels.c1.type = memory

a1.channels.c1.capacity = 1000

a1.channels.c1.transactionCapacity = 100

 

#5.双向链接

a1.sources.r1.channels = c1

a1.sinks.k1.channel = c1

 

3) 判断44445端口是否被占用

netstat -tunlp | grep 44445

 

4) 启动flume配置文件

 

/opt/module/flume1.8.0/bin/flume-ng agent \

--conf /opt/module/flume1.8.0/conf/ \

--name a1 \

--conf-file /opt/module/flume1.8.0/jobconf/flume-telnet.conf \

-Dflume.root.logger==INFO,console


5) 使用telnet工具向本机的44445端口发送内容

     telnet bigdata112 44445

 

Flume 监听端口: 开两个bigdata112就好 

Flume 监听端口_第1张图片

Flume 监听端口_第2张图片

你可能感兴趣的:(Flume)