Last active
April 16, 2025 01:04
-
-
Save chadmcrowell/0fd333251037b1bb57e0df223b4ac90b to your computer and use it in GitHub Desktop.
Topic Tools
This file contains hidden or 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
# Create a topic if a topic with the same name does NOT exist | |
bin/kafka-topics.sh --zookeeper zookeeper1:2181/kafka \ | |
--create \ | |
--topic topic-1 \ | |
--replication-factor 1 \ | |
--partitions 3 \ | |
--if-not-exists | |
# Alter the number of partitions (can only go up) | |
bin/kafka-topics.sh --zookeeper zookeeper1:2181/kafka \ | |
--alter \ | |
--topic topic-1 \ | |
--partitions 7 | |
# Delete a topic (this is irreversible) | |
bin/kafka-topics.sh --zookeeper zookeeper1:2181/kafka \ | |
--delete \ | |
--topic topic-1 | |
# List all topics | |
bin/kafka-topics.sh --zookeeper zookeeper1:2181/kafka \ | |
--list | |
# Describe all the topics at once | |
bin/kafka-topics.sh --zookeeper zookeeper1:2181/kafka \ | |
--describe | |
# Identify any overrides to topics (configs added to the defaults) | |
bin/kafka-topics.sh --zookeeper zookeeper1:2181/kafka \ | |
--describe \ | |
--topics-with-overrides | |
# Topics that are not in-sync with all replicas | |
bin/kafka-topics.sh --zookeeper zookeeper1:2181/kafka \ | |
--describe \ | |
--under-replicated-partitions | |
# Topics without a leader replica | |
bin/kafka-topics.sh --zookeeper zookeeper1:2181/kafka \ | |
--describe \ | |
--unavailable-partitions | |
# Describe the configurations for all topics (only in addition to the defaults) | |
bin/kafka-configs.sh --zookeeper zookeeper1:2181/kafka \ | |
--describe \ | |
--entity-type topics | |
# Describe the configurations for a specific topic (defaults will not show) | |
bin/kafka-configs.sh --zookeeper zookeeper1:2181/kafka \ | |
--describe \ | |
--entity-type topics \ | |
--entity-name topic-1 | |
# Change the topics message retention | |
bin/kafka-configs.sh --zookeeper zookeeper1:2181/kafka \ | |
--alter \ | |
--entity-type topics \ | |
--entity-name connect-test \ | |
--add-config retention.ms=3600000 | |
# Describe the configurations for all brokers (defaults will not show) | |
bin/kafka-configs.sh --zookeeper zookeeper1:2181/kafka \ | |
--entity-type brokers \ | |
--entity-default \ | |
--describe | |
# Describe the configuration for broker 0 (defaults will not show) | |
bin/kafka-configs.sh --zookeeper zookeeper1:2181/kafka \ | |
--entity-type brokers \ | |
--entity-name 0 \ | |
--describe | |
# Add a custom config to broker 0 that will change it's log cleaner thread count | |
bin/kafka-configs.sh --zookeeper zookeeper1:2181/kafka \ | |
--entity-type brokers \ | |
--entity-name 0 \ | |
--alter \ | |
--add-config log.cleaner.threads=2 | |
# Remove all custom configs (not including defaults) from broker 0 | |
bin/kafka-configs.sh --zookeeper zookeeper1:2181/kafka \ | |
--entity-type brokers \ | |
--entity-name 0 \ | |
--alter \ | |
--delete-config log.cleaner.threads |
Diagram is incomplete
some pages are missing, or the next button fails
for example Section2 /Data Delivery stops on page integrity
@bridany so sorry about this. The diagram has been relocated. here's the link: https://lucid.app/lucidchart/556d9075-a316-4d40-b5dc-225c4353d1e8/view
thanks for the fast feedback
unfortunately the issue remains
@bridany unfortunately I am unable to edit the diagram. Can you reach out to [email protected] or go to https://help.acloud.guru/hc/en-us/requests/new and let them know that this diagram needs maintenance? Thanks!
@bridany I have also done this on your behalf
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Click here to go back to the Kafka Deep Dive Interactive Diagram: https://lucid.app/lucidchart/556d9075-a316-4d40-b5dc-225c4353d1e8/view