1
2
|
tar
xf kafka_2.11-0.10.0.1.tgz
cd
kafka_2.11-0.10.0.1
|
1
2
3
|
bin
/zookeeper-server-start
.sh config
/zookeeper
.properties
# 启动zookeeper服务端实例
bin
/kafka-server-start
.sh config
/server
.properties
# 启动kafka服务端实例
|
1
|
bin
/kafka-topics
.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic
test
|
1
|
bin
/kafka-topics
.sh --list --zookeeper localhost:2181
|
1
2
3
|
bin
/kafka-console-producer
.sh --broker-list localhost:9092 --topic
test
This is a message
This is another message
|
1
2
3
|
bin
/kafka-console-consumer
.sh --zookeeper localhost:2181 --topic
test
--from-beginning
This is a message
This is another message
|