侧边栏壁纸

Flume学习笔记

2019年04月03日 7阅读 0评论 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
0

—— 评论区 ——

昵称
邮箱
网址
取消
博主栏壁纸
28 文章数
0 标签数
0 评论量