Help Center>
Distributed Message Service for Kafka>
User Guide (Kuala Lumpur Region)>
FAQs>
Topics and Partitions>
How Do I Create a Topic?
Updated on 2022-08-12 GMT+08:00
How Do I Create a Topic?
You can create a topic by using one the following three methods:
- By using the Kafka console
- By using Kafka Manager
Log in to Kafka Manager, choose Topic > Create, and set parameters as prompted.
- By using Kafka CLI
If your client is v2.2 or later, you can use kafka-topics.sh to create topics and manage topic parameters.
- If SASL is not enabled for the Kafka instance, run the following command to create a topic:
./kafka-topics.sh --create --topic {topic_name} --bootstrap-server {broker_ip}:{port} --partitions {partition_num} --replication-factor {replication_num}
- If SASL has been enabled for the Kafka instance, perform the following steps to create a topic:
- Create the ssl-user-config.properties file in the /config directory of the Kafka client and add the SSL certificate configurations by referring to Accessing a Kafka Instance with SASL.
- Run the following command to create a topic:
./kafka-topics.sh --create --topic {topic_name} --bootstrap-server {broker_ip}:{port} --partitions {partition_num} --replication-factor {replication_num} --command-config ./config/ssl-user-config.properties
- If SASL is not enabled for the Kafka instance, run the following command to create a topic:
Parent topic: Topics and Partitions
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot