是在虚拟机上配置搭建的服务,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
求大神帮忙