文章目录

暂无目录

Flume学习笔记


2 观看次数
17 字数
0 评论

示例1

# 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 = hadoop000
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

文件监控

a1.sources = r1
a1.sinks = k1
a1.channels = c1

# Describe/configure the source
a1.sources.r1.type = exec
a1.sources.r1.command = tail -F /home/hadoop/data/data.log
a1.sources.r1.shell = /bin/sh -c

# 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

A服务器日志采集到B服务启

#1

a1.sources = r1
a1.sinks = k1
a1.channels = c1

a1.sources.r1.type = exec
a1.sources.r1.command = tail -f /home/hadoop/data/data.log
a1.sources.r1.shell = /bin/sh -c

a1.sinks.k1.type = avro
a1.sinks.k1.hostname = hadoop000
a1.sinks.k1.port = 44444

a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1




#2

a2.sources = r2
a2.sinks = k2
a2.channels = c2

a2.sources.r2.type = avro
a2.sources.r2.hostname = hadoop000
a2.sources.r2.port = 44444

a2.sinks.k2.type = logger

a2.sources.r2.channels = c2
a2.sinks.k2.channel = c2
flume-ng agent 
--conf $FLUME_HOME/conf 
--conf-file $FLUME_HOME/conf/test-1.conf 
--name a1 
-Dflume.root.logger=INFO,console

评论区

还没有人评论

添加新评论