配置avro-memory-kafka

#me the components on this agent

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




# Describe/configure the source
a1.sources.r1.type = avro
a1.sources.r1.bind = hadoop02
a1.sources.r1.port = 44444


# Describe the sink
a1.sinks.k1.type = org.apache.flume.sink.kafka.KafkaSink
a1.sinks.k1.brokerList= hadoop02:9092 //这里也要注意配置的细节
a1.sinks.k1.batchSize = 5
a1.sinks.k1.topic= hellotopic
a1.sinks.k1.requiredAcks= 1

a1.sinks.k1.batchSize =
# 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

运行命令:

flume-ng agent \
--name a1 \
--conf $FLUME_HOME/conf \
--conf-file $FLUME_HOME/conf/avro-memory-kafka.conf \

-Dflume.root.logger=INFO,console


整合Flume和Kafka的综合使用


相关文章: