Kafka Common configuration
Auto start
For Ambari managed Kafka, configure autostart from Console
http://[ambari-host]:8080/#/main/admin/serviceAutoStart
By default, the Kafka and zookeeper “autostart” function provided by Ambari is stopped. For any env other than DEV this is be modified to enabled.
Change Kafka configuration
To change kakfa configuration,
- For Ambari managed Kafka Cluster,
- Modify from Ambari Console
- For manually configured Kafka Cluster
- modify the kafka.properties file.
Configurations
- Allow Topic auto created
auto.create.topics.enable
Default is true. Should disable in PROD environment
- Allow Topic Deletion
delete.topic.enable
Default is false. Should disable in DEV environment.
Useful Commands
Assuming kafka is installed to default path by Hortonworks Ambari Pack.
- Create a topic
1 | /usr/hdf/current/kafka-broker/bin/kafka-topics.sh --create \ |
- List all existing Topics
1 | /usr/hdf/current/kafka-broker/bin/kafka-topics.sh --list \ |
- Delete a topic
1 | /usr/hdf/current/kafka-broker/bin/kafka-topics.sh --delete \ |
- Describe a topic
1 | /usr/hdf/current/kafka-broker/bin/kafka-topics.sh \ |
- Publish message to a topic
1 | kafka-console-producer.sh \ |
- Consume a topic
1 | /usr/hdf/current/kafka-broker/bin/kafka-console-consumer.sh \ |
- Change topic message retention time
1 | /usr/hdf/current/kafka-broker/bin/kafka-configs.sh \ |
Kafka Monitring Via Ambari
Definition of metrics
Bytes In