hbase_kafka.propertiesvim hbase_kafka.propertiesagent.sources = kafka_sourceagent.channels = mem_channelagent.sinks = hbase_sink# 以下配置 sourceagent.sources.kafka_source.type = org.apache.flume.source.kafka.KafkaSourceagent.sources.kafka_source.channels = mem_channelagent.sources.kafka_source.batchSize = 5000agent.sources.kafka_source.kafka.bootstrap.servers = $kafkaIP:9092agent.sources.kafka_source.kafka.topics = kafka_test# 以下配置 sinkagent.sinks.hbase_sink.channel = mem_channelagent.sinks.hbase_sink.table = foo_tableagent.sinks.hbase_sink.columnFamily = cfagent.sinks.hbase_sink.serializer = org.apache.flume.sink.hbase.RegexHbaseEventSerializer# 以下配置 channelagent.channels.mem_channel.type = memoryagent.channels.mem_channel.capacity = 100000agent.channels.mem_channel.transactionCapacity = 10000
hbase shellcreate 'foo_table','cf'
./bin/flume-ng agent --conf ./conf/ -f hbase_kafka.properties -n agent -Dflume.root.logger=INFO,console
[hadoop@172 kafka]$ ./bin/kafka-console-producer.sh --broker-list $kafkaIP:9092 --topic kafka_testhellohbase_test
文档反馈