1、運行生產者、消費者html
啓動消費者: [root@s0 kafka-0.8.1-src]# bin/kafka-console-consumer.sh --zookeeper localhost: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.
2、報錯解決方案shell
從http://www.slf4j.org/download.html下載slf4j-1.7.6.tar.gzcode
[root@s0 Soft]# axel http://www.slf4j.org/dist/slf4j-1.7.6.tar.gz Initializing download: http://www.slf4j.org/dist/slf4j-1.7.6.tar.gz File size: 3051903 bytes Opening output file slf4j-1.7.6.tar.gz Starting download [ 0%] .......... .......... .......... .......... .......... [ 54.5KB/s] [ 1%] .......... .......... .......... .......... .......... [ 86.7KB/s] [ 3%] .......... .......... .......... .......... .......... [ 116.7KB/s] [ 97%] .......... .......... .......... .......... .......... [ 379.2KB/s] [ 98%] .......... .......... .......... Downloaded 2980.4 kilobytes in 8 seconds. (372.19 KB/s)
3、解壓並將slf4j-nop-1.7.6.jar複製到kafka的libs裏(若是沒有新建一個)
htm
[root@s0 Soft]# tar -zxvf slf4j-1.7.6.tar.gz [root@s0 Soft]# cd slf4j-1.7.6 [root@s0 slf4j-1.7.6]# ls [root@s0 slf4j-1.7.6]# mkdir -p /Soft/kafka-0.8.1-src/libs [root@s0 slf4j-1.7.6]# cp slf4j-nop-1.7.6.jar /Soft/kafka-0.8.1-src/libs/ [root@s0 slf4j-1.7.6]#
暫時先這樣吧get