我正在尝试将数据从 kafka(最终我们将使用在不同实例上运行的 kafka)发送到 hdfs。我认为 Flume 或某种摄取协议(protocol)对于将数据导入 hdfs 是必要的。所以我们使用cloudera的flume服务和hdfs。
这是我的水槽配置文件。另一个conf文件为空
tier1.sources=source1
tier1.channels=channel1
tier1.sinks=sink1
tier1.sources.source1.type=org.apache.flume.source.kafka.KafkaSource
tier1.sources.source1.zookeeperConnect=localhost:2181
tier1.sources.source1.topic=test
tier1.sources.source1.groupId=flume
tier1.sources.source1.channels=channel1
tier1.sources.source1.interceptors=i1
tier1.sources.source1.interceptors.i1.type=timestamp
tier1.sources.source1.kafka.consumer.timeout.ms=100
tier1.channels.channel1.type=memory
tier1.channels.channel1.capacity=10000
tier1.channels.channel1.transactionCapacity=1000
tier1.sinks.sink1.type=hdfs
tier1.sinks.sink1.hdfs.path=/tmp/kafka/test/data
tier1.sinks.sink1.hdfs.rollInterval=5
tier1.sinks.sink1.hdfs.rollSize=0
tier1.sinks.sink1.hdfs.rollCount=0
tier1.sinks.sink1.hdfs.fileType=DataStream
当我启动一个 kafka 消费者时,它可以在 localhost:2181 上从一个 kafka 生产者那里获取消息。但我没有看到来自水槽代理的任何错误,也没有任何东西被放入 hdfs。我也找不到任何日志文件。
这就是我启动代理的方式。
flume-ng agent --conf /opt/cloudera/parcels/CDH-5.7.0-1.cdh5.7.0.p0.45/lib/flume-ng/conf --conf-file flume-conf --name agent1 -Dflume.root.logger=DEBUG,INFO,console
请帮忙?
最佳答案
修复。
不得不改变
--名称代理1
至 --name tier1
关于hadoop - 需要帮助使用flume调试kafka源到hdfs sink,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37731292/