Some of the broker and topic configurations can be updated without restarting the broker.

从 kafka 1.1 开始,kafka 开始支持动态改变一些配置。

修改 Broker 配置

截屏2021-08-12 上午10.46.22.png
如图,官网提供的 Broker 配置中 https://kafka.apache.org/documentation/#brokerconfigs,Update Mode 为
per-broker 和 cluster-wide 模式的配置,都可以动态的修改,前者针对个 broker,后者针对整个集群。
截屏2021-08-12 上午10.48.09.png

  • Dynamic per-broker config stored in ZooKeeper
  • Dynamic cluster-wide default config stored in ZooKeeper
  • Static broker config from server.properties

也就是我们动态修改的配置,会保存在 zk 里面。

each change is persistent and remains through broker restarts.
每一个更改都是持久化的,就算 broker 重启,这些配置依然生效。(因为保存在 zk 里面了)

官方文档