首页 文章

Flume不会将数据存储到hbase

提问于
浏览
1

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

我的水槽是:

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放入DEBUG中,但我看到没有错误也没有警告 . 我可以看到Flume用户在Hbase中获取连接并检查表的存在 . HBase上没有Kerberos身份验证 . Kafka主题确实有数据,因为我刚用控制台消费者和hdfs接收器进行了双重检查 .

我只是想知道是否有人能在这里看到错误或指出我正确的方向 . 我想我在这里做的并不奇怪 .

谢谢!

1 回答

  • 2

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

相关问题