wget https://www.apache.org/dyn/closer.cgi?path=/kafka/0.8.2-beta/kafka_2.9.1-0.8.2-beta.tgz 解压后 cd config vim server.properties
############################# Zookeeper ############################# # Zookeeper connection string (see zookeeper docs for details). # This is a comma separated host:port pairs, each corresponding to a zk # server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002". # You can also append an optional chroot string to the urls to specify the # root directory for all kafka znodes. zookeeper.connect=master:2181,slave1:2181,slave2:2181
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test This is a message This is another message bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning This is a message This is another message