gpt4 book ai didi

hadoop - Flume 不存储数据到 hbase

转载 作者:可可西里 更新时间:2023-11-01 15:10:10 26 4
gpt4 key购买 nike

虽然我能够将 Flume 数据(来自 Kafka)正确地存储在 HDFS 中,但我没有运气将它们存储在 HBase 中......平台是 Cloudera 5.10.1。

我的 flume conf 是:

tier1.sources  = source1
tier1.channels = channel1
#tier1.sinks = hdfs1
tier1.sinks = hbase1

tier1.sources.source1.type = org.apache.flume.source.kafka.KafkaSource
tier1.sources.source1.zookeeperConnect = master3d.localdomain:2181
tier1.sources.source1.topics.regex = application.data.*
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.sources.source1.kafka.consumer.group.id = flume

tier1.channels.channel1.type = memory
tier1.channels.channel1.capacity = 10000
tier1.channels.channel1.transactionCapacity = 1000

tier1.sinks.hbase1.type = hbase
tier1.sinks.hbase1.table = application_data
tier1.sinks.hbase1.columnFamily = json
tier1.sinks.hbase1.serializer = org.apache.flume.sink.hbase.SimpleHbaseEventSerializer
tier1.sinks.hbase1.channel = channel1

#tier1.sinks.hdfs1.type = hdfs
#tier1.sinks.hdfs1.hdfs.path = /tmp/kafka/%{topic}/%y-%m-%d
#tier1.sinks.hdfs1.hdfs.rollInterval = 5
#tier1.sinks.hdfs1.hdfs.rollSize = 0
#tier1.sinks.hdfs1.hdfs.rollCount = 0
#tier1.sinks.hdfs1.hdfs.fileType = DataStream
#tier1.sinks.hdfs1.channel = channel1

我通过以下方式创建了 Hbase 表:

hbase(main):005:0> create 'application_data', 'json'
0 row(s) in 1.2250 seconds

但是这个表上的扫描命令总是返回

hbase(main):021:0> scan 'application_data'
ROW COLUMN+CELL
0 row(s) in 0.0100 seconds

我已将 Flume 和 Hbase Master 置于 DEBUG 状态,但我没有看到任何错误或警告。我可以看到 Flume 用户在 Hbase 中获得连接并检查表的存在。 HBase 上没有 Kerberos 身份验证。Kafka 主题确实有数据,因为我刚刚与控制台消费者和 hdfs 接收器进行了双重检查。

我只是想知道是否有人可以在这里看到错误或指出正确的方向。我想我在这里没有做任何奇怪的事情。

谢谢!

最佳答案

由于您的水槽日志中没有错误,请确保所有接收器、源和 channel 都已初始化。有时您可能会错过日志中的消息,在这种情况下不会报告任何异常或错误。

关于hadoop - Flume 不存储数据到 hbase,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44738450/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com