分布式消息服务器kafka
##搭建过程:
步骤:
1:下载代码,解压
2:启动zookeeper服务器:bin/zookeeper-server-start.sh config/zookeeper.properties
3:启动kafka服务器:bin/kafka-server-start.sh config/server.properties
4:创建一个topic:bin/kafka-topics.sh –create –zookeeper localhost:2181 –replication-factor 1 –partitions 1 –topic mytopic
查看是否创建成功:bin/kafka-topics.sh –list –zookeeper localhost:2181
5:发送消息:bin/kafka-console-producer.sh –broker-list localhost:9092 –topic mytopic
6:启动一个消费者:bin/kafka-console-consumer.sh –bootstrap-server localhost:9092 –topic mytopic –from-begining
原创文章,作者:3628473679,如若转载,请注明出处:https://blog.ytso.com/192065.html