是否可以在 Cloudera-Quickstart-CDH-VM 中使用 Avro Sink/Source 设置 Flume Client-Collector-Structure?我知道没有实际用途,但是我想了解 Flume 如何与 Avro 文件一起使用,以及我以后如何将它们与 PIG 等一起使用。
它尝试了几种配置,但都没有奏效。对我来说,我似乎需要几个代理,但是虚拟机中只能有一个。
我最后尝试的:
agent.sources = reader avro-collection-source
agent.channels = memoryChannel memoryChannel2
agent.sinks = avro-forward-sink hdfs-sink
#Client
agent.sources.reader.type = exec
agent.sources.reader.command = tail -f /home/flume/avro/source.txt
agent.sources.reader.logStdErr = true
agent.sources.reader.restart = true
agent.sources.reader.channels = memoryChannel
agent.sinks.avro-forward-sink.type = avro
agent.sinks.avro-forward-sink.hostname = 127.0.0.1
agent.sinks.avro-forward-sink.port = 80
agent.sinks.avro-forward-sink.channel = memoryChannel
agent.channels.memoryChannel.type = memory
agent.channels.memoryChannel.capacity = 10000
agent.channels.memoryChannel.transactionCapacity = 100
# Collector
agent.sources.avro-collection-source.type = avro
agent.sources.avro-collection-source.bind = 127.0.0.1
agent.sources.avro-collection-source.port = 80
agent.sources.avro-collection-source.channels = memoryChannel2
agent.sinks.hdfs-sink.type = hdfs
agent.sinks.hdfs-sink.hdfs.path = /var/flume/avro
agent.sinks.hdfs-sink.channel = memoryChannel2
agent.channels.memoryChannel2.type = memory
agent.channels.memoryChannel2.capacity = 20000
agent.channels.memoryChannel2.transactionCapacity = 2000
感谢您的任何建议!