flume 配置和启动

1.   Flume 运行实例

参考  https://blog.csdn.net/u012373815/article/details/54025112

1.1   创建spool配置文件

在配置文件夹conf 下创建:

$  vim spool.conf

a1.sources = r1

a1.sinks = k1

a1.channels = c1

 

# Describe/configure the source

a1.sources.r1.type = spooldir

a1.sources.r1.channels = c1

a1.sources.r1.spoolDir =/root/logs

a1.sources.r1.fileHeader = true

 

# Describe the sink

a1.sinks.k1.type = logger

 

# Use a channel which buffers events inmemory

a1.channels.c1.type = memory

a1.channels.c1.capacity = 1000

a1.channels.c1.transactionCapacity = 100

 

# Bind the source and sink to thechannel

a1.sources.r1.channels = c1

a1.sinks.k1.channel = c1

 

 linux    启动flume  agent :

 ./bin/flume-ng agent -cconf -f conf/spool.conf -n a1

-Dflume.root.logger=INFO,console

Windows 命令如下:

参考如下:

https://blog.csdn.net/maoyuanming0806/article/details/79367607

1.  flume-ng.cmd  agent -conf ../conf  -conf-file ../conf/example.conf  -name a1  -property flume.root.logger=INFO,console  

  另开窗口 追加文件到文件夹/root/logs下:

 vimtest.log

  mvtest.log /root/logs

则会看到flume控制台有如下输出:

 

1.2             Syslogtcp 例子

Syslogtcp 监听tcp 端口作为数据源

猜你喜欢

转载自blog.csdn.net/qq_33124081/article/details/80804809