How to change min insync replica for multiple topics at once using kafka-config.sh (or any other kafka cli script)

huangapple go评论49阅读模式
英文:

How to change min insync replica for multiple topics at once using kafka-config.sh (or any other kafka cli script)

问题

我想要修改多个Kafka主题的最小同步副本属性。
对于单个主题,我知道我们可以使用以下命令:

kafka-configs --alter --entity-type topics --entity-name <topic name> --add-config min.insync.replicas=2 --zookeeper <zookeeper node:port>

如何将多个实体名称传递给此命令?或者是否有其他通过shell来完成的方法,还是我需要编写一个自定义脚本来实现?

英文:

I want to change the min insync replica property for multiple kafka topics.
For individual topics, I know we can use this:

kafka-configs --alter --entity-type topics --entity-name &lt;topic name&gt; --add-config min.insync.replicas=2 --zookeeper &lt;zookeeper node:port&gt;

How do I pass multiple entity names to this command? Or is there any other way to do it via shell, or will I have to write a custom script to do so?

答案1

得分: 2

The command doesn't accept mutiple topics. You'll need to use bash, awk, or other language you're familiar with.

英文:

The command doesn't accept mutiple topics. You'll need to use bash, awk, or other language you're familiar with

huangapple
  • 本文由 发表于 2023年7月6日 21:36:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/76629438.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定