分享

FLume整合Kafka出现java.lang.NoSuchMethodError: scala.Predef$.augmentString(Lj...


flume和kafka都已经独立的部分先搭建好了。
FLume conf
[mw_shl_code=xml,true]#agent section
producer.sources = s
producer.channels = c
producer.sinks = r

#source section
producer.sources.s.type = exec
producer.sources.s.command = tail -f -n+1 /home/hadoop/hadoop/data/server1.log
producer.sources.s.channels = c

# Each sink's type must be defined
producer.sinks.r.type = org.apache.flume.plugins.KafkaSink
producer.sinks.r.metadata.broker.list=nameNode:9092
producer.sinks.r.partition.key=0
producer.sinks.r.partitioner.class=org.apache.flume.plugins.SinglePartition
producer.sinks.r.serializer.class=kafka.serializer.StringEncoder
producer.sinks.r.request.required.acks=0
producer.sinks.r.max.message.size=1000000
producer.sinks.r.producer.type=sync
producer.sinks.r.custom.encoding=UTF-8
#producer.sinks.r.custom.topic.name=kafkaToptic
producer.sinks.r.custom.topic.name=test

#Specify the channel the sink should use
producer.sinks.r.channel = c

# Each channel's type is defined.
producer.channels.c.type = memory
producer.channels.c.capacity = 1000

############################################
#   consumer config
###########################################

consumer.sources = s
consumer.channels = c
consumer.sinks = r

consumer.sources.s.type = seq
consumer.sources.s.channels = c
consumer.sinks.r.type = logger

consumer.sinks.r.channel = c
consumer.channels.c.type = memory
consumer.channels.c.capacity = 100

consumer.sources.s.type = org.apache.flume.plugins.KafkaSource
consumer.sources.s.zookeeper.connect=127.0.0.1:2181
consumer.sources.s.group.id=testGroup
consumer.sources.s.zookeeper.session.timeout.ms=400
consumer.sources.s.zookeeper.sync.time.ms=200
consumer.sources.s.auto.commit.interval.ms=1000
#consumer.sources.s.custom.topic.name=kafkaToptic
consumer.sources.s.custom.topic.name=test
consumer.sources.s.custom.thread.per.consumer=4[/mw_shl_code]

QQ截图20160418180132.png


提示缺少依赖,可是:


都已经放进去了

已有(1)人评论

跳转到指定楼层
easthome001 发表于 2016-4-18 20:37:50
建议参考官网。
是否自定义jar包了
kafka下的/libs/* .都复制到FLUME_HOME/libs,如果自定义了,也复制过去。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条