flume-1.8.0-window入门配置

下载地址
 http://flume.apache.org/download.html

解压文件

D:\Soft\apache-flume-1.8.0-bin

配置文件

D:\Soft\apache-flume-1.8.0-bin\conf 

将 flume-conf.properties.template 重新拷贝为 netcat.properties

编辑netcat.properties

# Name the components on this agent
# 给三个组件起名字
a1.sources = r1
a1.sinks = k1
a1.channels = c1

# Describe/configure the source
# 监听网络端口6666的数据
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 6666

# Describe the sink
a1.sinks.k1.type = logger

# Use a channel which buffers events in memory
#capacity:默认该通道中最大的可以存储的event数量
#trasactionCapacity:每次最大可以从source中拿到或者送到sink中的event数量
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

启动flume

在bin目录中启动cmd输入命令启动

flume-ng agent --conf conf --conf-file ../conf/netcat.properties --name a1

发送数据

telnet 127.0.0.1 6666

flume接收数据

flume-1.8.0-window入门配置_第1张图片

你可能感兴趣的:(flume,大数据)