kafka的基本安装与使用
1、上官网下载tar包
2、解压
3、运行zookeeper
4、运行kafka服务器
5、创建topic
6、发送消息
7、监听消息
1、上官网下载tar包
https://www.apache.org/dyn/closer.cgi?path=/kafka/2.2.0/kafka_2.12-2.2.0.tgz
2、tar包上传到服务器
tar -zxvf kafka_2.12-2.2.0.tgz
3、运行zookeeper
切换到解压目录
运行
bin
/zookeeper-server-start
.sh config
/zookeeper
.properties &
4、运行kafka服务器
vim config/server.properties
bin/kafka-server-start.sh config/server.properties &
5、创建topic
创建名为 test的topic
bin
/kafka-topics
.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic
test
bin
/kafka-topics
.sh --list --bootstrap-server localhost:9092
6、发送消息
bin
/kafka-console-producer
.sh --broker-list localhost:9092 --topic
test
this is a message;
7、监听消息
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。