官网文档:
修改config/server.properties文件如下:
集群后还要修改broker id和主机名
启动kafka(后台进程):
$ bin/kafka-server-start.sh -daemon config/server.properties
CREATE
$ bin/kafka-topics.sh --create --zookeeper bigdata-hpsk01.ziboit.com:2181 --replication-factor 1 --partitions 1 --topic testTopic
LIST
$ bin/kafka-topics.sh --list --zookeeper bigdata-hpsk01.ziboit.com:2181/kafka
SEND
$ bin/kafka-console-producer.sh --broker-list bigdata-hpsk01.ziboit.com:9092 --topic testTopic
$ bin/kafka-console-consumer.sh --zookeeper bigdata-hpsk01.ziboit.com:2181 --topic testTopic --from-beginning