Hi,
log.cleanup.policy is the server-level parameter.
The per-topic parameter you are looking for is just cleanup.policy
See here - http://kafka.apache.org/documentation.html#topic-config
Also, it is listed in the help:
$ kafka-topics.sh
Create, delete, describe, or change a topic.
Option Description
------ -----------
--alter Alter the configuration for the
topic.
--config <name=value> A topic configuration override for
the
topic being created or altered.The
following is a list of valid
configurations:
unclean.leader.election.enable
delete.retention.ms
segment.jitter.ms
retention.ms
flush.ms
segment.bytes
flush.messages
segment.ms
retention.bytes
cleanup.policy
segment.index.bytes
min.cleanable.dirty.ratio
max.message.bytes
file.delete.delay.ms
min.insync.replicas
index.interval.bytes
See the Kafka documentation for full
details on the topic configs.
...
Ofir
On Mon, Dec 7, 2015 at 9:59 PM, Rakesh Vidyadharan <
[email protected]> wrote:
> Hello,
>
> I upgraded to the latest 0.8 release 0.8.2.2, and tried to set the log
> cleanup policy on some of our topics (I got same error with 0.8.1, but
> thought it may have been some issue with that release).
>
> /opt/kafka/bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic
> metamorphosis.team --config log.cleanup.policy=compact
>
> It gives me the following error (it looked identical on 0.8.1 as well)
>
> Error while executing topic command requirement failed: Unknown
> configuration "log.cleanup.policy".
> java.lang.IllegalArgumentException: requirement failed: Unknown
> configuration "log.cleanup.policy".
> at scala.Predef$.require(Predef.scala:233)
> at kafka.log.LogConfig$$anonfun$validateNames$1.apply(LogConfig.scala:183)
> at kafka.log.LogConfig$$anonfun$validateNames$1.apply(LogConfig.scala:182)
> at scala.collection.Iterator$class.foreach(Iterator.scala:727)
> at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
> at kafka.log.LogConfig$.validateNames(LogConfig.scala:182)
> at kafka.log.LogConfig$.validate(LogConfig.scala:190)
> at
> kafka.admin.TopicCommand$.parseTopicConfigsToBeAdded(TopicCommand.scala:205)
> at
> kafka.admin.TopicCommand$$anonfun$alterTopic$1.apply(TopicCommand.scala:103)
> at
> kafka.admin.TopicCommand$$anonfun$alterTopic$1.apply(TopicCommand.scala:100)
> at
> scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
> at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
> at kafka.admin.TopicCommand$.alterTopic(TopicCommand.scala:100)
> at kafka.admin.TopicCommand$.main(TopicCommand.scala:57)
> at kafka.admin.TopicCommand.main(TopicCommand.scala)
>
> The documentation indicates this can be modified after topic is created,
> not sure if that means we can modify the setting after messages have been
> posted to the topic, which is what we are trying to do.
>
> Thanks
> Rakesh
>