1:解压 2:在config中配置server.properties broker.id=1 port=9092 host.name=Master socket.send.buffer.bytes=1048576 socket.receive.buffer.bytes=1048576 socket.request.max.bytes=104857600 log.dir=./kafka-logs num.partitions=10 zookeeper.connect=Master:2181 3:启动zookeeper: 在bin下执行:zkServer.sh start 4:在kafka目录下; 1):启动kafka服务 bin/kafka-server-start.sh config/server.properties 2) :创建主题: bin/kafka-topics.sh --create --zookeeper Master:2181 --replication-factor 1 --partitions 1 --topic test 3): 发送主题:bin/kafka-console-producer.sh --broker-list Master:9092 --topic test 4): 接受主题: bin/kafka-console-consumer.sh --zookeeper Master:2181 --topic test --from-beginning