flume不将数据存储到hbase

3zwjbxry  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(317)

虽然我能够将flume数据(来自kafka)正确地存储在hdfs中,但我没有运气将它们存储在hbase中。。。该平台是cloudera 5.10.1。
我的Flume形态是:

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

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

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

我已经将flume和hbase master置于调试中,但我没有看到任何错误或警告。我可以看到flume用户在hbase中获得连接并检查表的存在。hbase上没有kerberos身份验证。kafka主题确实有数据,因为我刚刚与console consumer和hdfs sink进行了双重检查。
我只是想知道是否有人能看到这里的错误或者给我指出正确的方向。我想我在这里没有做什么奇怪的事。
谢谢您!

bhmjp9jg

bhmjp9jg1#

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

相关问题