转:http://blog.chinaunix.net/uid-25135004-id-4172954.html

 

测试kafka    producer发送消息 和  consumer 接受消息报错 ,kafka版本kafka_2.9.2-0.8.1

[root@master ~]#  /export/kafka/bin/kafka-console-producer.sh  --broker-list 10.14.2.201:9092,10.14.2.202:9092,10.14.2.203:9092,10.14.2.204:9092    --topic test 
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

# /export/kafka/bin/kafka-console-consumer.sh  --zookeeper   10.14.2.201:2181,10.14.2.202:2181,10.14.2.203:2181,10.14.2.204:2181  --topic test --from-beginning
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.



解决方法:

下载slf4j-1.7.6.zip
http://www.slf4j.org/dist/slf4j-1.7.6.zip

解压
unzip slf4j-1.7.6.zip

把slf4j-nop-1.7.6.jar 包复制到kafka libs目录下面
cd  slf4j-1.7.6
cp slf4j-nop-1.7.6.jar  /export/kafka/libs/

posted on 2014-10-11 16:46  懒懒的呐喊  阅读(1146)  评论(0编辑  收藏  举报