常见疑问
1、生产者无法产生消息
kafka.common.FailedToSendMessageException: Failed to send messages after 3 tries.
将slf4j-nop-1.7.21.jar上传到kafka的lib包下
参考文章:http://stackoverflow.com/questions/23903843/apache-kafka-example-error-failed-to-send-message-after-3-tries
常用命令
zk启动
[root@localhost bin]# ./zkServer.sh start
kafka启动
[root@localhost bin]# ./kafka-server-start.sh -daemon ../config/server.properties
创建topic
[root@localhost bin]# ./kafka-topics.sh –create –zookeeper 192.168.21.49:12181 –replication-factor 1 –partitions 1 –topic test
查看当前集群的可用topic
[root@localhost bin]# ./kafka-topics.sh –list –zookeeper 192.168.21.14:12181
SLF4J: Class path conta