You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by "haitao .yao" <ya...@gmail.com> on 2017/08/07 02:33:51 UTC

do i need to restart the brokers if I changed the retention time for a specific topic

Hi, I want to change the retention time for a specific topic with the
following command:

$ bin/kafka-topics.sh --zookeeper zk_address --alter --topic
test-topic --config retention.ms=86400000

Is that correct? Do I have to restart the brokers?
I read the source code and thought the configuration values about retention
time in LogManager are static:
https://github.com/apache/kafka/blob/0.10.0/core/src/main/scala/kafka/server/KafkaServer.scala#L597-L620

Kafka version: kafka_2.11-0.10.0.1

Thanks
-- 
haitao.yao

Re: do i need to restart the brokers if I changed the retention time for a specific topic

Posted by "Thakrar, Jayesh" <jt...@conversantmedia.com>.
Just to make it clear Haitao, in your case you do not have to restart brokers (since you are changing at the topic level).

On 8/6/17, 11:37 PM, "Kaufman Ng" <ka...@confluent.io> wrote:

    Hi Haitao,
    
    The retention time (retention.ms) configuration can exist as a broker-level
    and/or topic-level config. For the latter, changing it does NOT require
    broker restarts.
    
    
    On Sun, Aug 6, 2017 at 10:33 PM, haitao .yao <ya...@gmail.com> wrote:
    
    > Hi, I want to change the retention time for a specific topic with the
    > following command:
    >
    > $ bin/kafka-topics.sh --zookeeper zk_address --alter --topic
    > test-topic --config retention.ms=86400000
    >
    > Is that correct? Do I have to restart the brokers?
    > I read the source code and thought the configuration values about retention
    > time in LogManager are static:
    > https://github.com/apache/kafka/blob/0.10.0/core/src/
    > main/scala/kafka/server/KafkaServer.scala#L597-L620
    >
    > Kafka version: kafka_2.11-0.10.0.1
    >
    > Thanks
    > --
    > haitao.yao
    >
    
    
    
    -- 
    Kaufman Ng
    +1 646 961 8063
    Solutions Architect | Confluent | www.confluent.io
    


Re: do i need to restart the brokers if I changed the retention time for a specific topic

Posted by Kaufman Ng <ka...@confluent.io>.
Hi Haitao,

The retention time (retention.ms) configuration can exist as a broker-level
and/or topic-level config. For the latter, changing it does NOT require
broker restarts.


On Sun, Aug 6, 2017 at 10:33 PM, haitao .yao <ya...@gmail.com> wrote:

> Hi, I want to change the retention time for a specific topic with the
> following command:
>
> $ bin/kafka-topics.sh --zookeeper zk_address --alter --topic
> test-topic --config retention.ms=86400000
>
> Is that correct? Do I have to restart the brokers?
> I read the source code and thought the configuration values about retention
> time in LogManager are static:
> https://github.com/apache/kafka/blob/0.10.0/core/src/
> main/scala/kafka/server/KafkaServer.scala#L597-L620
>
> Kafka version: kafka_2.11-0.10.0.1
>
> Thanks
> --
> haitao.yao
>



-- 
Kaufman Ng
+1 646 961 8063
Solutions Architect | Confluent | www.confluent.io