clone the latest kafka source code: git clone https://github.com/apache/kafka.git kafka-trunk
step 2: build the source code.
./gradlew clean build -x test
step 3: check the bin folder
.
Step 4: start zookeeper
Step 5: verify if the 2181 port is used by zookeeper
lsof -i:2181
Step 6: start kafka server
bin/kafka-server-start.sh config/server.properties
Step 7: create topic
bin/kafka-topics.sh --zookeeper localhost:2181 --create --topic lz1 --partitions 3 --replication-factor 1
Step 8: describe topic
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic lz1
start 9: start he consume
./bin/kafka-console-consumer.sh --topic lz1 --bootstrap-server=localhost:9092
start 10: start the procedure
./bin/kafka-console-producer.sh --topic lz1 --bootstrap-server=localhost:9092
the message we input in producer.
The message showing in consumer:
Now it is end of kafka usage
Comments
Post a Comment