Flume不存数据到hbase

Flume does not store data to hbase

虽然我能够在 HDFS 中正确存储 Flume 数据(来自 Kafka),但我没有运气将它们存储在 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 table:

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

但是这个 table returns 上的扫描命令总是

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

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

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

谢谢!

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