1.启动zookeeper,jps---> QuorumPeerMain即启动成功, 详见https://blog.csdn.net/haiziccc/article/details/99468831
2.download kafka from http://mirrors.hust.edu.cn/apache/kafka/;
3.将压缩文件上传至server目录,解压;
4.进入kafka目录,执行./bin/kafka-server-start.sh config/server.properties即可启动;
5../bin/kafka-topics.sh --list --zookeeper localhost:2181查看topic
6./bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test创建topic
7../bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic test查看topic
8../bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test 执行后发送消息
9../bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning执行后接收producer发送的消息
10.可以进入到/tmp/kafka-logs验证segment
注:
log.dirs=/tmp/kafka-logs,zookeeper.connect=localhost:2181,配置均位于config目录下server.properties;