1.实现功能:
监控日志增加,并且将日志信息存储到hdfs上
2.配置文件
#a1是代理
# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1
# Describe/configure the source
a1.sources.r1.type = exec
a1.sources.r1.command = tail -f /var/log/httpd/access_log
a1.sources.r1.channels = c1
# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
# Describe the sink
a1.sinks.k1.type=hdfs
a1.sinks.k1.hdfs.path=hdfs://bigdata.ibeifeng.com:8020/flume02
a1.sinks.k1.channel = c1
3.启动命令
bin/flume-ng agent --name a1 --conf conf --conf-file conf/apache-sink-hdfs.conf