kafka-topics.sh ---delete --topic ''testTopic'' is not working for kafka V 0.10.1












1















I try to delete a existing topic (I checked using kafka management console) using following command;



#./kafka-topics.sh --zookeeper zookeeper.xx.com:2181/chroot --delete --topic testTopic



But it says topic not available in zookeeper.[1]



I create those topics at runtime . (I use Highlevel Client APIs.I think it is created in kafka clusters? )



How can I delete the topic using this bash script?



[1]



Error while executing topic command : Topic targettopic does not exist on ZK path zookeeper.xx.com:2181/chroot

[2016-10-14 11:58:59,919] ERROR java.lang.IllegalArgumentException: Topic streamtargettopic does not exist on ZK path zookeeper.xx.com:2181/chroot

at kafka.admin.TopicCommand$.deleteTopic(TopicCommand.scala:169)

at kafka.admin.TopicCommand$.main(TopicCommand.scala:69)

at kafka.admin.TopicCommand.main(TopicCommand.scala)









share|improve this question























  • Does the topic exist? ./bin/kafka-topics.sh --zookeeper 127.0.0.1:2181/chroot --topic testTopci --describe

    – louxiu
    Oct 14 '16 at 2:50













  • @louxiu No output for the above command. Means my topic is not in zookeeper? So, where the topics are created in kafka 0.10?

    – Ratha
    Oct 14 '16 at 2:52











  • Not sure for 0.10.1, I tried this in 0.9.0.1 ./bin/kafka-topics.sh --create --zookeeper 127.0.0.1:2181 --topic test_kafka123 --replication-factor 1 --partitions 1. The topic is under /brokers/topics in zk and command above can be printed. I think you can try to create topic using command if you have not tried.

    – louxiu
    Oct 14 '16 at 2:59











  • @louxiu Issue was I had "/chroot" at the end of the zookeeper parameter. Now working fine without that.

    – Ratha
    Oct 14 '16 at 5:17
















1















I try to delete a existing topic (I checked using kafka management console) using following command;



#./kafka-topics.sh --zookeeper zookeeper.xx.com:2181/chroot --delete --topic testTopic



But it says topic not available in zookeeper.[1]



I create those topics at runtime . (I use Highlevel Client APIs.I think it is created in kafka clusters? )



How can I delete the topic using this bash script?



[1]



Error while executing topic command : Topic targettopic does not exist on ZK path zookeeper.xx.com:2181/chroot

[2016-10-14 11:58:59,919] ERROR java.lang.IllegalArgumentException: Topic streamtargettopic does not exist on ZK path zookeeper.xx.com:2181/chroot

at kafka.admin.TopicCommand$.deleteTopic(TopicCommand.scala:169)

at kafka.admin.TopicCommand$.main(TopicCommand.scala:69)

at kafka.admin.TopicCommand.main(TopicCommand.scala)









share|improve this question























  • Does the topic exist? ./bin/kafka-topics.sh --zookeeper 127.0.0.1:2181/chroot --topic testTopci --describe

    – louxiu
    Oct 14 '16 at 2:50













  • @louxiu No output for the above command. Means my topic is not in zookeeper? So, where the topics are created in kafka 0.10?

    – Ratha
    Oct 14 '16 at 2:52











  • Not sure for 0.10.1, I tried this in 0.9.0.1 ./bin/kafka-topics.sh --create --zookeeper 127.0.0.1:2181 --topic test_kafka123 --replication-factor 1 --partitions 1. The topic is under /brokers/topics in zk and command above can be printed. I think you can try to create topic using command if you have not tried.

    – louxiu
    Oct 14 '16 at 2:59











  • @louxiu Issue was I had "/chroot" at the end of the zookeeper parameter. Now working fine without that.

    – Ratha
    Oct 14 '16 at 5:17














1












1








1








I try to delete a existing topic (I checked using kafka management console) using following command;



#./kafka-topics.sh --zookeeper zookeeper.xx.com:2181/chroot --delete --topic testTopic



But it says topic not available in zookeeper.[1]



I create those topics at runtime . (I use Highlevel Client APIs.I think it is created in kafka clusters? )



How can I delete the topic using this bash script?



[1]



Error while executing topic command : Topic targettopic does not exist on ZK path zookeeper.xx.com:2181/chroot

[2016-10-14 11:58:59,919] ERROR java.lang.IllegalArgumentException: Topic streamtargettopic does not exist on ZK path zookeeper.xx.com:2181/chroot

at kafka.admin.TopicCommand$.deleteTopic(TopicCommand.scala:169)

at kafka.admin.TopicCommand$.main(TopicCommand.scala:69)

at kafka.admin.TopicCommand.main(TopicCommand.scala)









share|improve this question














I try to delete a existing topic (I checked using kafka management console) using following command;



#./kafka-topics.sh --zookeeper zookeeper.xx.com:2181/chroot --delete --topic testTopic



But it says topic not available in zookeeper.[1]



I create those topics at runtime . (I use Highlevel Client APIs.I think it is created in kafka clusters? )



How can I delete the topic using this bash script?



[1]



Error while executing topic command : Topic targettopic does not exist on ZK path zookeeper.xx.com:2181/chroot

[2016-10-14 11:58:59,919] ERROR java.lang.IllegalArgumentException: Topic streamtargettopic does not exist on ZK path zookeeper.xx.com:2181/chroot

at kafka.admin.TopicCommand$.deleteTopic(TopicCommand.scala:169)

at kafka.admin.TopicCommand$.main(TopicCommand.scala:69)

at kafka.admin.TopicCommand.main(TopicCommand.scala)






apache-kafka






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 14 '16 at 2:39









RathaRatha

5,26573678




5,26573678













  • Does the topic exist? ./bin/kafka-topics.sh --zookeeper 127.0.0.1:2181/chroot --topic testTopci --describe

    – louxiu
    Oct 14 '16 at 2:50













  • @louxiu No output for the above command. Means my topic is not in zookeeper? So, where the topics are created in kafka 0.10?

    – Ratha
    Oct 14 '16 at 2:52











  • Not sure for 0.10.1, I tried this in 0.9.0.1 ./bin/kafka-topics.sh --create --zookeeper 127.0.0.1:2181 --topic test_kafka123 --replication-factor 1 --partitions 1. The topic is under /brokers/topics in zk and command above can be printed. I think you can try to create topic using command if you have not tried.

    – louxiu
    Oct 14 '16 at 2:59











  • @louxiu Issue was I had "/chroot" at the end of the zookeeper parameter. Now working fine without that.

    – Ratha
    Oct 14 '16 at 5:17



















  • Does the topic exist? ./bin/kafka-topics.sh --zookeeper 127.0.0.1:2181/chroot --topic testTopci --describe

    – louxiu
    Oct 14 '16 at 2:50













  • @louxiu No output for the above command. Means my topic is not in zookeeper? So, where the topics are created in kafka 0.10?

    – Ratha
    Oct 14 '16 at 2:52











  • Not sure for 0.10.1, I tried this in 0.9.0.1 ./bin/kafka-topics.sh --create --zookeeper 127.0.0.1:2181 --topic test_kafka123 --replication-factor 1 --partitions 1. The topic is under /brokers/topics in zk and command above can be printed. I think you can try to create topic using command if you have not tried.

    – louxiu
    Oct 14 '16 at 2:59











  • @louxiu Issue was I had "/chroot" at the end of the zookeeper parameter. Now working fine without that.

    – Ratha
    Oct 14 '16 at 5:17

















Does the topic exist? ./bin/kafka-topics.sh --zookeeper 127.0.0.1:2181/chroot --topic testTopci --describe

– louxiu
Oct 14 '16 at 2:50







Does the topic exist? ./bin/kafka-topics.sh --zookeeper 127.0.0.1:2181/chroot --topic testTopci --describe

– louxiu
Oct 14 '16 at 2:50















@louxiu No output for the above command. Means my topic is not in zookeeper? So, where the topics are created in kafka 0.10?

– Ratha
Oct 14 '16 at 2:52





@louxiu No output for the above command. Means my topic is not in zookeeper? So, where the topics are created in kafka 0.10?

– Ratha
Oct 14 '16 at 2:52













Not sure for 0.10.1, I tried this in 0.9.0.1 ./bin/kafka-topics.sh --create --zookeeper 127.0.0.1:2181 --topic test_kafka123 --replication-factor 1 --partitions 1. The topic is under /brokers/topics in zk and command above can be printed. I think you can try to create topic using command if you have not tried.

– louxiu
Oct 14 '16 at 2:59





Not sure for 0.10.1, I tried this in 0.9.0.1 ./bin/kafka-topics.sh --create --zookeeper 127.0.0.1:2181 --topic test_kafka123 --replication-factor 1 --partitions 1. The topic is under /brokers/topics in zk and command above can be printed. I think you can try to create topic using command if you have not tried.

– louxiu
Oct 14 '16 at 2:59













@louxiu Issue was I had "/chroot" at the end of the zookeeper parameter. Now working fine without that.

– Ratha
Oct 14 '16 at 5:17





@louxiu Issue was I had "/chroot" at the end of the zookeeper parameter. Now working fine without that.

– Ratha
Oct 14 '16 at 5:17












2 Answers
2






active

oldest

votes


















5














You can use below command to check the list of topics available in Zookeeper.



bin/kafka-topics.sh --list --zookeeper localhost:2181


Also set the below properties in server.properties



delete.topic.enable=true 


Then try to delete the topic using



bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic test





share|improve this answer
























  • This works. Thanks. Issue was i had "/chroot" at the end. That is how mentioned in the documentation kafka.apache.org/documentation.html#basic_ops_modify_topic

    – Ratha
    Oct 14 '16 at 5:15



















0














If the below command didn't work for you



bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic test


You can do the delete manually by connecting to zookeeper and delete the path.



./zookeeper-shell.sh


Manually delete the topic



rmr /brokers/topics/<topic>





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f40034074%2fkafka-topics-sh-delete-topic-testtopic-is-not-working-for-kafka-v-0-10%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    5














    You can use below command to check the list of topics available in Zookeeper.



    bin/kafka-topics.sh --list --zookeeper localhost:2181


    Also set the below properties in server.properties



    delete.topic.enable=true 


    Then try to delete the topic using



    bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic test





    share|improve this answer
























    • This works. Thanks. Issue was i had "/chroot" at the end. That is how mentioned in the documentation kafka.apache.org/documentation.html#basic_ops_modify_topic

      – Ratha
      Oct 14 '16 at 5:15
















    5














    You can use below command to check the list of topics available in Zookeeper.



    bin/kafka-topics.sh --list --zookeeper localhost:2181


    Also set the below properties in server.properties



    delete.topic.enable=true 


    Then try to delete the topic using



    bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic test





    share|improve this answer
























    • This works. Thanks. Issue was i had "/chroot" at the end. That is how mentioned in the documentation kafka.apache.org/documentation.html#basic_ops_modify_topic

      – Ratha
      Oct 14 '16 at 5:15














    5












    5








    5







    You can use below command to check the list of topics available in Zookeeper.



    bin/kafka-topics.sh --list --zookeeper localhost:2181


    Also set the below properties in server.properties



    delete.topic.enable=true 


    Then try to delete the topic using



    bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic test





    share|improve this answer













    You can use below command to check the list of topics available in Zookeeper.



    bin/kafka-topics.sh --list --zookeeper localhost:2181


    Also set the below properties in server.properties



    delete.topic.enable=true 


    Then try to delete the topic using



    bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic test






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Oct 14 '16 at 5:05









    ShankarShankar

    2,534114085




    2,534114085













    • This works. Thanks. Issue was i had "/chroot" at the end. That is how mentioned in the documentation kafka.apache.org/documentation.html#basic_ops_modify_topic

      – Ratha
      Oct 14 '16 at 5:15



















    • This works. Thanks. Issue was i had "/chroot" at the end. That is how mentioned in the documentation kafka.apache.org/documentation.html#basic_ops_modify_topic

      – Ratha
      Oct 14 '16 at 5:15

















    This works. Thanks. Issue was i had "/chroot" at the end. That is how mentioned in the documentation kafka.apache.org/documentation.html#basic_ops_modify_topic

    – Ratha
    Oct 14 '16 at 5:15





    This works. Thanks. Issue was i had "/chroot" at the end. That is how mentioned in the documentation kafka.apache.org/documentation.html#basic_ops_modify_topic

    – Ratha
    Oct 14 '16 at 5:15













    0














    If the below command didn't work for you



    bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic test


    You can do the delete manually by connecting to zookeeper and delete the path.



    ./zookeeper-shell.sh


    Manually delete the topic



    rmr /brokers/topics/<topic>





    share|improve this answer




























      0














      If the below command didn't work for you



      bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic test


      You can do the delete manually by connecting to zookeeper and delete the path.



      ./zookeeper-shell.sh


      Manually delete the topic



      rmr /brokers/topics/<topic>





      share|improve this answer


























        0












        0








        0







        If the below command didn't work for you



        bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic test


        You can do the delete manually by connecting to zookeeper and delete the path.



        ./zookeeper-shell.sh


        Manually delete the topic



        rmr /brokers/topics/<topic>





        share|improve this answer













        If the below command didn't work for you



        bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic test


        You can do the delete manually by connecting to zookeeper and delete the path.



        ./zookeeper-shell.sh


        Manually delete the topic



        rmr /brokers/topics/<topic>






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 23 '18 at 11:55









        VishnuVRVishnuVR

        194




        194






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f40034074%2fkafka-topics-sh-delete-topic-testtopic-is-not-working-for-kafka-v-0-10%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Berounka

            Fiat S.p.A.

            Type 'String' is not a subtype of type 'int' of 'index'