Last active
May 23, 2017 03:29
-
-
Save jayhuang75/7fb7ae9ba3f59399d3a6f0dc34e8b986 to your computer and use it in GitHub Desktop.
Kafka create topic, publish and listen Hortonworks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /usr/hdp/current/kafka-broker/ | |
## create topic | |
./kafka-topics --create --zookeeper sandbox.hortonworks.com:2181 --replication-factor 1 --partitions 1 --topic TOPIC_NAME | |
## list topics | |
./kafka-topics.sh --list --zookeeper sandbox.hortonworks.com:2181 | |
## pub | |
./kafka-console-producer.sh --broker-list sandbox.hortonworks.com:6667 --topic TOPIC_NAME | |
### pub with connector | |
./connect-standalone.sh ~/connect-standalone.properties ~/connect-file-source.properties ~/connect-file-sink.properties | |
## sub | |
./kafka-console-consumer.sh --zookeeper localhost:2181 --from-beginning --topic TOPIC_NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment