下载地址:https://archive.apache.org/dist/kafka/2.2.2/kafka_2.11-2.2.2.tgz
1.配置server.xml# 对外监听地址 listeners=PLAINTEXT://172.17.68.115:9092
2.创建启动脚本source /etc/profile cd /usr/local/kafka_2.11-2.2.2 bin/zookeeper-server-start.sh -daemon config/zookeeper.properties bin/kafka-server-start.sh -daemon config/server.properties
将脚本放到kafka目录下,运行即可 3.创建topicbin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
4.查询所有topicbin/kafka-topics.sh --list --bootstrap-server 172.17.68.115:9092
5.开启生产者bin/kafka-console-producer.sh --broker-list 172.17.68.115:9092 --topic test
6.开启消费者bin/kafka-console-consumer.sh --bootstrap-server 172.17.68.115:9092 --topic test --from-beginning
标签:bin,--,server,topic,sh,kafka,安装,节点 From: https://www.cnblogs.com/dabu/p/17129460.html