使用flume ng 写数据到hbase,使用org.apache.flume.sink.hbase.SimpleHbaseEventSerializer可以写成功,只是写到一个列里面,这不是我想要的。所以使用 org.apache.flume.sink.hbase.RegexHbaseEventSerializer,使用正则写入。flume没有错误日志,但是hbase中也没有收到数据。
flume版本1.6.0 HBASE版本1.2.0
原始数据:
one,two,three,four,five
tier1.sources.source1.channels = channel1
tier1.sinks.sink1.channel = channel1
tier1.sinks.sink1.type = hbase
tier1.sinks.sink1.table = host_table
tier1.sinks.sink1.columnFamily = host_info
tier1.sinks.sink1.serializer = org.apache.flume.sink.hbase.RegexHbaseEventSerializer
tier1.sinks.sink1.serializer.regex= ^(w+),(w+),(w+),(w+),(w+)$
tier1.sinks.sink1.serializer.rowKeyIndex = 0
tier1.sinks.sink1.serializer.colNames= ROW_KEY,o,z,w,d
tier1.sinks.sink1.batchSize = 50
tier1.sinks.sink1.zookeeperQuorum = 127.0.0.1:2181
正则表达式不正确,匹配不了数据,才导致hbase数据无法写入