您的位置:首页 > 其它

sink示例

2016-04-13 15:36 232 查看
7、hdfs实例
case8_hdfs.conf

#配置内容
#name the component on this agent
a1.sources = r1
a1.channels= c1
a1.sinks = k1

#describe/configure the source
a1.sources.r1.type = syslogtcp
a1.sources.r1.bind = 0.0.0.0
a1.sources.r1.port = 5140
a1.sources.r1.channels = c1

#decribe the sink
a1.sinks.k1.type = hdfs
a1.sinks.k1.channel = c1
a1.sinks.k1.hdfs.path = hdfs://hdpha/wyb
a1.sinks.k1.hdfs.filePrefix = Syslog
a1.sinks.k1.hdfs.round = true
a1.sinks.k1.hdfs.roundValue = 10
a1.sinks.k1.hdfs.roundUnit = minute

#use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

8、一个agent采集数据发送到另一个agent实例
case9_avro.conf case10_avro_sink.conf

#配置内容
#name the component on this agent
a1.sources = r1
a1.channels= c1
a1.sinks = k1

#describe/configure the source
a1.sources.r1.type = avro
a1.sources.r1.bind = 0.0.0.0
a1.sources.r1.port = 4545
a1.sources.r1.channels = c1

#decribe the sink
a1.sinks.k1.type = logger
a1.sinks.k1.channel = c1

#use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

case10_avro_sink.conf

#配置内容
#name the component on this agent
a2.sources = r1
a2.channels= c1
a2.sinks = k1

#describe/configure the source
a2.sources.r1.type = syslogtcp
a2.sources.r1.bind = localhost
a2.sources.r1.port = 5140
a2.sources.r1.channels = c1

#decribe the sink
a2.sinks.k1.type = avro
a2.sinks.k1.channel = c1
a2.sinks.k1.hostname= master-active
a2.sinks.k1.port= 4545

#use a channel which buffers events in memory
a2.channels.c1.type = memory
a2.channels.c1.capacity = 1000
a2.channels.c1.transactionCapacity = 100

9、file roll sink

#配置内容
#name the component on this agent
a2.sources = r1
a2.channels= c1
a2.sinks = k1

#describe/configure the source
a2.sources.r1.type = syslogtcp
a2.sources.r1.bind = localhost
a2.sources.r1.port = 5140
a2.sources.r1.channels = c1

#decribe the sink
a2.sinks.k1.type = file_roll
a2.sinks.k1.channel = c1
a2.sinks.k1.sink.directory= /var/logs/flume

#use a channel which buffers events in memory
a2.channels.c1.type = memory
a2.channels.c1.capacity = 1000
a2.channels.c1.transactionCapacity = 100
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: