Giriş
alter seçeneğinden sonra --add-config veya --delete-config kullanılır
1.  --add-config seçeneği
Örnek - cleanup.policy Değiştirme
Şöyle yaparız. Burada cleanup.policy değeri değiştiriliyor
kafka-configs.sh 
  --zookeeper localhost:2181 
  --entity-type topics 
  --entity-name my_topic 
  --alter 
  --add-config cleanup.policy=compactÖrnek - min.insync.replicas
Şöyle yaparız
kafka-configs \
  --bootstrap-server localhost:9092 \
  --entity-type topics *
  --entity-name my-topic \
  --alter \
  --add-config min.insync.replicas=2Örnek - retention.ms Değiştirme
Açıklaması şöyle
Use the kafka-configs command line tool to alter the retention policy for the topic to a very short period of time. Once the retention period has expired, the messages will be deleted automatically.
Şöyle yaparız. Burada retention.ms değeri değiştiriliyor
2. --delete-config seçeneği./bin/kafka-configs.sh \--alter \--entity-type topics \--entity-name my-topic \--add-config retention.ms=1000
Örnek - min.insync.replicas
Şöyle yaparız
kafka-configs \
  --bootstrap-server localhost:9092 \
  --entity-type topics \
  --entity-name my-topic \
  --alter \
  --delete-config min.insync.replicas
No comments:
Post a Comment