set config retention.ms=3600000 still data not delete from Kafka












0















I have set the retention.ms=3600000 by below command but still there is lots of data on disk after 1 hour. My disk got full due to huge data coming to Kafka.



./bin/kafka-topics.sh --zookeeper zookeeper:2181 --alter --topic topic_1 --config retention.ms=3600000


Describe command



 ./bin/kafka-topics.sh --zookeeper zookeeper:2181 --describe --topics-with-overrides
Topic:__consumer_offsets PartitionCount:50 ReplicationFactor:3 Configs:segment.bytes=104857600,cleanup.policy=compact,compression.type=producer
Topic:topic_1 PartitionCount:3 ReplicationFactor:3 Configs:retention.ms=3600000
Topic:topic_2 PartitionCount:3 ReplicationFactor:3 Configs:retention.ms=3600000
Topic:topic_3 PartitionCount:3 ReplicationFactor:3 Configs:retention.ms=3600000,retention.bytes=104857600


Can anyone give advice why kafka not delete the data after 1 hours.?










share|improve this question



























    0















    I have set the retention.ms=3600000 by below command but still there is lots of data on disk after 1 hour. My disk got full due to huge data coming to Kafka.



    ./bin/kafka-topics.sh --zookeeper zookeeper:2181 --alter --topic topic_1 --config retention.ms=3600000


    Describe command



     ./bin/kafka-topics.sh --zookeeper zookeeper:2181 --describe --topics-with-overrides
    Topic:__consumer_offsets PartitionCount:50 ReplicationFactor:3 Configs:segment.bytes=104857600,cleanup.policy=compact,compression.type=producer
    Topic:topic_1 PartitionCount:3 ReplicationFactor:3 Configs:retention.ms=3600000
    Topic:topic_2 PartitionCount:3 ReplicationFactor:3 Configs:retention.ms=3600000
    Topic:topic_3 PartitionCount:3 ReplicationFactor:3 Configs:retention.ms=3600000,retention.bytes=104857600


    Can anyone give advice why kafka not delete the data after 1 hours.?










    share|improve this question

























      0












      0








      0








      I have set the retention.ms=3600000 by below command but still there is lots of data on disk after 1 hour. My disk got full due to huge data coming to Kafka.



      ./bin/kafka-topics.sh --zookeeper zookeeper:2181 --alter --topic topic_1 --config retention.ms=3600000


      Describe command



       ./bin/kafka-topics.sh --zookeeper zookeeper:2181 --describe --topics-with-overrides
      Topic:__consumer_offsets PartitionCount:50 ReplicationFactor:3 Configs:segment.bytes=104857600,cleanup.policy=compact,compression.type=producer
      Topic:topic_1 PartitionCount:3 ReplicationFactor:3 Configs:retention.ms=3600000
      Topic:topic_2 PartitionCount:3 ReplicationFactor:3 Configs:retention.ms=3600000
      Topic:topic_3 PartitionCount:3 ReplicationFactor:3 Configs:retention.ms=3600000,retention.bytes=104857600


      Can anyone give advice why kafka not delete the data after 1 hours.?










      share|improve this question














      I have set the retention.ms=3600000 by below command but still there is lots of data on disk after 1 hour. My disk got full due to huge data coming to Kafka.



      ./bin/kafka-topics.sh --zookeeper zookeeper:2181 --alter --topic topic_1 --config retention.ms=3600000


      Describe command



       ./bin/kafka-topics.sh --zookeeper zookeeper:2181 --describe --topics-with-overrides
      Topic:__consumer_offsets PartitionCount:50 ReplicationFactor:3 Configs:segment.bytes=104857600,cleanup.policy=compact,compression.type=producer
      Topic:topic_1 PartitionCount:3 ReplicationFactor:3 Configs:retention.ms=3600000
      Topic:topic_2 PartitionCount:3 ReplicationFactor:3 Configs:retention.ms=3600000
      Topic:topic_3 PartitionCount:3 ReplicationFactor:3 Configs:retention.ms=3600000,retention.bytes=104857600


      Can anyone give advice why kafka not delete the data after 1 hours.?







      apache apache-kafka retention






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 15 '18 at 16:55









      lucylucy

      4962824




      4962824
























          3 Answers
          3






          active

          oldest

          votes


















          1














          From the describe command result, topic retention policy is set to compact which will enable log compaction instead of deleting and will keep the latest data for each key. To delete all the data older than the retention period, you need to set retention policy to delete.



          ./bin/kafka-topics.sh --zookeeper zookeeper:2181 --alter --topic topic_1 --config cleanup.policy=delete





          share|improve this answer































            1














            Check the value of log.retention.check.interval.ms.

            This value affects the Log cleaner. It will check whether any log is eligible for deletion with this interval.






            share|improve this answer































              1














              As the documentation suggests, retention.ms controls the maximum time kafka will retain a log before it will discard old log segments to free up space if we are using the "delete" retention policy.
              Looks like your cleanup.policy is set to compact instead of delete



              bin/kafka-configs.sh --zookeeper 2181 --entity-type topics 
              --entity-name topic_1 --alter --add-config cleanup.policy=delete


              PS:Altering topic configuration from the kafka-topics.sh script (kafka.admin.TopicCommand) has been deprecated. Going forward, please use the kafka-configs.sh script (kafka.admin.ConfigCommand) for this functionality.






              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%2f53324381%2fset-config-retention-ms-3600000-still-data-not-delete-from-kafka%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                1














                From the describe command result, topic retention policy is set to compact which will enable log compaction instead of deleting and will keep the latest data for each key. To delete all the data older than the retention period, you need to set retention policy to delete.



                ./bin/kafka-topics.sh --zookeeper zookeeper:2181 --alter --topic topic_1 --config cleanup.policy=delete





                share|improve this answer




























                  1














                  From the describe command result, topic retention policy is set to compact which will enable log compaction instead of deleting and will keep the latest data for each key. To delete all the data older than the retention period, you need to set retention policy to delete.



                  ./bin/kafka-topics.sh --zookeeper zookeeper:2181 --alter --topic topic_1 --config cleanup.policy=delete





                  share|improve this answer


























                    1












                    1








                    1







                    From the describe command result, topic retention policy is set to compact which will enable log compaction instead of deleting and will keep the latest data for each key. To delete all the data older than the retention period, you need to set retention policy to delete.



                    ./bin/kafka-topics.sh --zookeeper zookeeper:2181 --alter --topic topic_1 --config cleanup.policy=delete





                    share|improve this answer













                    From the describe command result, topic retention policy is set to compact which will enable log compaction instead of deleting and will keep the latest data for each key. To delete all the data older than the retention period, you need to set retention policy to delete.



                    ./bin/kafka-topics.sh --zookeeper zookeeper:2181 --alter --topic topic_1 --config cleanup.policy=delete






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 15 '18 at 18:27









                    Monzurul Haque ShimulMonzurul Haque Shimul

                    5,21321028




                    5,21321028

























                        1














                        Check the value of log.retention.check.interval.ms.

                        This value affects the Log cleaner. It will check whether any log is eligible for deletion with this interval.






                        share|improve this answer




























                          1














                          Check the value of log.retention.check.interval.ms.

                          This value affects the Log cleaner. It will check whether any log is eligible for deletion with this interval.






                          share|improve this answer


























                            1












                            1








                            1







                            Check the value of log.retention.check.interval.ms.

                            This value affects the Log cleaner. It will check whether any log is eligible for deletion with this interval.






                            share|improve this answer













                            Check the value of log.retention.check.interval.ms.

                            This value affects the Log cleaner. It will check whether any log is eligible for deletion with this interval.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 15 '18 at 17:43









                            Nishu TayalNishu Tayal

                            12.8k73483




                            12.8k73483























                                1














                                As the documentation suggests, retention.ms controls the maximum time kafka will retain a log before it will discard old log segments to free up space if we are using the "delete" retention policy.
                                Looks like your cleanup.policy is set to compact instead of delete



                                bin/kafka-configs.sh --zookeeper 2181 --entity-type topics 
                                --entity-name topic_1 --alter --add-config cleanup.policy=delete


                                PS:Altering topic configuration from the kafka-topics.sh script (kafka.admin.TopicCommand) has been deprecated. Going forward, please use the kafka-configs.sh script (kafka.admin.ConfigCommand) for this functionality.






                                share|improve this answer




























                                  1














                                  As the documentation suggests, retention.ms controls the maximum time kafka will retain a log before it will discard old log segments to free up space if we are using the "delete" retention policy.
                                  Looks like your cleanup.policy is set to compact instead of delete



                                  bin/kafka-configs.sh --zookeeper 2181 --entity-type topics 
                                  --entity-name topic_1 --alter --add-config cleanup.policy=delete


                                  PS:Altering topic configuration from the kafka-topics.sh script (kafka.admin.TopicCommand) has been deprecated. Going forward, please use the kafka-configs.sh script (kafka.admin.ConfigCommand) for this functionality.






                                  share|improve this answer


























                                    1












                                    1








                                    1







                                    As the documentation suggests, retention.ms controls the maximum time kafka will retain a log before it will discard old log segments to free up space if we are using the "delete" retention policy.
                                    Looks like your cleanup.policy is set to compact instead of delete



                                    bin/kafka-configs.sh --zookeeper 2181 --entity-type topics 
                                    --entity-name topic_1 --alter --add-config cleanup.policy=delete


                                    PS:Altering topic configuration from the kafka-topics.sh script (kafka.admin.TopicCommand) has been deprecated. Going forward, please use the kafka-configs.sh script (kafka.admin.ConfigCommand) for this functionality.






                                    share|improve this answer













                                    As the documentation suggests, retention.ms controls the maximum time kafka will retain a log before it will discard old log segments to free up space if we are using the "delete" retention policy.
                                    Looks like your cleanup.policy is set to compact instead of delete



                                    bin/kafka-configs.sh --zookeeper 2181 --entity-type topics 
                                    --entity-name topic_1 --alter --add-config cleanup.policy=delete


                                    PS:Altering topic configuration from the kafka-topics.sh script (kafka.admin.TopicCommand) has been deprecated. Going forward, please use the kafka-configs.sh script (kafka.admin.ConfigCommand) for this functionality.







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Nov 16 '18 at 8:12









                                    AchilleusAchilleus

                                    688418




                                    688418






























                                        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%2f53324381%2fset-config-retention-ms-3600000-still-data-not-delete-from-kafka%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

                                        Florida Star v. B. J. F.

                                        Danny Elfman

                                        Retrieve a Users Dashboard in Tumblr with R and TumblR. Oauth Issues