Kafka how to reset number of partitions in a topics

I wanted to figure out how to reset number of partitions in my topic in Kafka and I followed these steps
  1. I did create a sample topic called my-topic with single partition
    
    spatil$ bin/kafka-topics.sh --create --zookeeper localhost:2181 --topic my-topic --replication-factor 1 --partitions 1
    Created topic "my-topic".
    
  2. I used describe command to verify that my topic has actually single partition
    
    spatil$ bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic my-topic
    Topic:my-topic PartitionCount:1 ReplicationFactor:1 Configs:
     Topic: my-topic Partition: 0 Leader: 0 Replicas: 0 Isr: 0
    
  3. Then I did execute alter command on my partition and changed number of partitions from 1 to 3
    
    spatil$ bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic my-topic --partitions 3
    WARNING: If partitions are increased for a topic that has a key, the partition logic or ordering of the messages will be affected
    Adding partitions succeeded!
    
  4. I did execute describe command on my topic to verify that it actually has 3 topics
    
    spatil$ bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic my-topic
    Topic:my-topic PartitionCount:3 ReplicationFactor:1 Configs:
     Topic: my-topic Partition: 0 Leader: 0 Replicas: 0 Isr: 0
     Topic: my-topic Partition: 1 Leader: 0 Replicas: 0 Isr: 0
     Topic: my-topic Partition: 2 Leader: 0 Replicas: 0 Isr: 0
    

36 comments:

  1. very informative blog and useful article thank you for sharing with us, keep posting Big data hadoop online Course Hyderabad

    ReplyDelete
  2. Thank You! For sharing such a great article, It’s been an amazing article.It provides lot’s of information, I really enjoyed to read this, I hope, I will get these kinds of information on a regular basis from your side.
    apps development company in bangalore
    mobile application development companies in India
    Blockchain application development in Bangalore
    React native apps development companies

    ReplyDelete
  3. Thanks for sharing Information.Must visit at top android mobile app development company with best quality work.

    ReplyDelete
  4. i am a mobile app creator Australia i love to learn about Tech it helps me to grow my skills.

    ReplyDelete
  5. We at Strive 2 drive,driving school In Melbourne. Driving School in Melbourne!
    Driving School in Melbourne!
    is one of the best & safe driving school where you have an ease of access
    to a wide array of special driving features. We are focused at your
    comfort and so we have put together facilities within the site to ensure
    that you get the very best. Driving School in Melbourne!

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. Thanks for sharing this blog. This is really amazing information.

    Arkon Web Solutions is one of the best website design company in himatnagar. As stated we have the best in-house team to take complete responsibility of your Web designing services needs and that too in the best possible way with the use of latest technology.

    ReplyDelete
  8. Nowadays all business find for seo company who provides seo service that can target various types of searches, including image search, video search, educational search, news search, and vertical search engines relevant to the industry.
    -------------------------

    ReplyDelete
  9. Thank you for sharing your thoughts and knowledge on this topic. This is really helpful and informative.

    If you want to make custom website & application you can contact us on our Web Design Company and Ecommerce Web Design Company anytime.

    ReplyDelete
  10. "Nice post! Thanks for sharing valuable article.
    Please Visit our Website supply chain"

    ReplyDelete
  11. "Nice post! Thanks for sharing valuable article.
    Please Visit our Website Incoterms"

    ReplyDelete
  12. This comment has been removed by the author.

    ReplyDelete
  13. This is a great post I saw thanks to sharing. I really want to hope that you will continue to share great posts in the future.
    data science course

    ReplyDelete
  14. I see the best substance on your blog and I unbelievably love getting them. 360DigiTMG

    ReplyDelete
  15. Here at this site actually the particular material assortment with the goal that everyone can appreciate a great deal.
    360DigiTMG big data training

    ReplyDelete
  16. Bayzat is redefining the work life experience,
    health insurance dubai
    medical insurance dubai
    making automated HR, payroll, employee benefits and insurance a possibility for all businesses in UAE.

    ReplyDelete
  17. Thanks for provide great informatic and looking beautiful blog Get Best Plumbing Services Singapore near you within 90 minutes with 30-day post-service According to superstition, a leaking pipe or tap means your finances will flow out of the house.

    ReplyDelete
  18. Excellence blog! Thanks For Sharing, The information provided by you is really a worthy. I read this blog and I got the more information about
    data scientist courses aurangabad

    ReplyDelete
  19. I like digestible content but Google like SEO oriented content. Really amazing!

    ReplyDelete
  20. Awesome. This blog is very impressive and very helpful. If you are searching for the fastest and cheap USA Dedicated Server, you can ask us for more details and services.. USA Dedicated Server

    ReplyDelete