上传解压:
在conf下的server-properties文件中,分别设置id为0,1,2
kafka启动时需要修改权限:
chmod +x startkafka.sh
启动:
./startkafka.sh
创建topic:
./kafka-topics.sh --zookeeper node01:2181,node02:2181,node03:2181 --create --topic t0730 --partitions 2 --replicat
ion-factor 2
查看有多少个topic:
./kafka-topics.sh --zookeeper node01:2181,node02:2181,node03:2181 --list
描述:
./kafka-topics.sh --zookeeper node01:2181,node02:2181,node03:2181 --describe --topic t0730
启动producer生产者:
./kafka-console-producer.sh --broker-list node01:9092,
node02:9092,node03:9092 --topic t0729
启动消费者