Skip to content

Instantly share code, notes, and snippets.

@jayhuang75
Last active May 23, 2017 03:29
Show Gist options
  • Save jayhuang75/7fb7ae9ba3f59399d3a6f0dc34e8b986 to your computer and use it in GitHub Desktop.
Save jayhuang75/7fb7ae9ba3f59399d3a6f0dc34e8b986 to your computer and use it in GitHub Desktop.
Kafka create topic, publish and listen Hortonworks
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