是在虛擬機上配置搭建的服務,flume部署在172.235.10.10上,
kafka部署在172.235.10.11上。配置文件如下:
flume:
a1.sources = r1
a1.sinks = k1
a1.channels = c1
a1.sources.r1.type = http
a1.sources.r1.channels = c1
a1.sources.r1.bind = 0.0.0.0
a1.sources.r1.port = 8000
a1.sinks.k1.type = file_roll
a1.sinks.k1.channel=c1
a1.sinks.k1.directory=/usr/log/flume
a1.channels.c1.type = org.apache.flume.channel.kafka.KafkaChannel
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
a1.channels.c1.brokerList=172.235.10.11:9002
a1.channels.c1.topic=test2
a1.channels.c1.zookeeperConnect=172.235.10.11:2181
zookeeper是使用了kafka自帶的,配置文件沒做修改
kafka配置server.properties修改:
host.name=172.235.10.11
zookeeper.connect=172.235.10.11:2181
kafka啟動正常,生產者和消費者也是可以通話的
但在啟動flume的時候卻報這樣的一個錯誤:
Error while getting events from Kafka. This is usually caused by trying to read a non-flume event. Ensure the setting for parseAsFlumeEvent is correct
求大神幫忙
檢查下你的Kafka,配置多個Kafka源以從同一主題讀取,試一下。或者去http://blog.csdn.net/high2011/article/details/53282128上看下,不知道有沒有幫助,沒有勿噴