a1.sources = r1
a1.channels = c1
a1.sinks=k3
a1.sources.r1.type = TAILDIR
a1.sources.r1.channels = c1
a1.sources.r1.positionFile = /opt/flume/test/taildir_position.json
a1.sources.r1.filegroups = f1
a1.sources.r1.filegroups.f1 = /data/user_log.log
a1.sources.r1.fileHeader = true
a1.sources.ri.maxBatchCount = 1000
a1.channels = c1
a1.channels.c1.type = memory
a1.channels.c1.capacity = 10000
a1.channels.c1.transactionCapacity = 10000
a1.channels.c1.byteCapacityBufferPercentage = 20
a1.channels.c1.byteCapacity = 800000
a1.sinks.k3.channel = c1
a1.sinks.k3.type = hbase2
a1.sinks.k3.zookeeperQuorum=henghe-022:2181
a1.sinks.k3.znodeParent=/hbase1
a1.sinks.k3.table = user_log
a1.sinks.k3.columnFamily = cf1
a1.sinks.k3.serializer = org.apache.flume.sink.hbase2.RegexHBase2EventSerializer
a1.sinks.k3.serializer.regex =正则匹配
a1.sinks.k3.serializer.colNames = user_id,name,sex
a1.sinks.k3.serializer.rowKeyIndex = 1
a1.sinks.k3.kerberosPrincipal = test@HENGHE.COM
a1.sinks.k3.kerberosKeytab =/opt/test.keytab
错误总结:
- hbase2.x要用hbase2,RegexHBase2EventSerializer
- 正则匹配出错,hbase中会没有数据,但是flume不会报错
|