org.apache.flume.conf.ConfigurationException: brokerList must contain at least one Kafka broker

对flume进行自定义Source和Kafka Channel,以下是我的flume配置

a0.sources = r1
a0.channels = c1

a0.sources.r1.type = com.bw.flume.source.TailFileSource
a0.sources.r1.filePath = /home/data/exerData/he.txt
a0.sources.r1.posiFile = /home/data/exerData/posi.txt
a0.sources.r1.interval = 2000
a0.sources.r1.charset = UTF-8


a0.channels.c1.type = org.apache.flume.channel.kafka.KafkaChannel
a0.channels.c1.kafka.bootstrap.servers = 192.168.23.21:9091,192.168.23.22:9092,192.168.23.23:9093
a0.channels.c1.kafka.topic = test
a0.channels.c1.parseAsFlumeEvent = false

a0.sources.r1.channels = c1

启动flume时报如下错误:

org.apache.flume.conf.ConfigurationException: brokerList must contain at least one Kafka broker

        at org.apache.flume.sink.kafka.KafkaSinkUtil.addDocumentedKafkaProps(KafkaSinkUtil.java:55)

        at org.apache.flume.sink.kafka.KafkaSinkUtil.getKafkaProperties(KafkaSinkUtil.java:37)

        at org.apache.flume.sink.kafka.KafkaSink.configure(KafkaSink.java:211)

        at org.apache.flume.conf.Configurables.configure(Configurables.java:41)

        at org.apache.flume.node.AbstractConfigurationProvider.loadSinks(AbstractConfigurationProvider.java:413)

        at org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(AbstractConfigurationProvider.java:98)

然后在官网上发现,这里要求flume版本是1.8以上,kafka版本是0.9以上,如图所示,而我用的flume是1.6版本,所以报错

org.apache.flume.conf.ConfigurationException: brokerList must contain at least one Kafka broker_第1张图片

 

org.apache.flume.conf.ConfigurationException: brokerList must contain at least one Kafka broker_第2张图片

然后换了1.8版本的flume,问题解决..

你可能感兴趣的:(org.apache.flume.conf.ConfigurationException: brokerList must contain at least one Kafka broker)