1. 程式人生 > 其它 >記一次flume的排錯

記一次flume的排錯

背景介紹,使用flume讀取Kafka並落地資料到HDFS。

初始配置如下:

a1.sources = source1
a1.channels = channel1
a1.sinks = log

a1.sources.source1.channels = channel1
a1.sinks.log.channel = channel1

#sources
a1.sources.source1.type = org.apache.flume.source.kafka.KafkaSource
a1.sources.source1.batchSize = 5000
a1.sources.source1.batchDurationMillis = 2000
a1.sources.source1.kafka.bootstrap.servers = node2:6667
#a1.sources.source1.kafka.topics = new_user_test
a1.sources.source1.kafka.consumer.auto.offset.reset=earliest
a1.sources.source1.kafka.consumer.group.id = dev-ckafka-bigdata


# sinks
a1.sinks.log.type = logger

#channel1
a1.channels.channel1.type = memory
a1.channels.channel1.capacity = 1000
a1.channels.channel1.transactionCapacity=100
a1.channels.channel1.keep-alive = 60
View Code

使用命令提交程式

./bin/flume-ng agent -n agent -c conf -f conf/kafka-hdfs.properties

得不到正確結果。

修改後的命令提交:

./bin/flume-ng agent -n agent -c conf -f conf/ckafka-hdfs.properties -Dflume.root.logger=INFO,console

 

會看到錯誤提示。