• Dynamic Kafka Configurations


    Some of the Apache Kafka® broker and topic configurations can be updated without restarting the broker. This section talks about updating these configuration options dynamically and securing password configurations by storing them in encrypted form in ZooKeeper.

    Changing Broker Configurations Dynamically

    Some of the broker configurations can be updated without restarting the broker. See the Dynamic Update Mode option in Broker Configurations for the update mode of each broker configuration.

    • read-only: Requires a broker restart for update.
    • per-broker: May be updated dynamically for each broker.
    • cluster-wide: May be updated dynamically as a cluster-wide default. May also be updated as a per-broker value for testing.

    To alter the current broker configurations for broker ID 0 (for example, the number of log cleaner threads):

    bin/kafka-configs --bootstrap-server localhost:9092 --entity-type brokers --entity-name 0 --alter --add-config log.cleaner.threads=2
    

    To alter several configurations at the same time, or to alter configurations with complex values (for example, the Router config for Audit Logs), create a file with the desired values in .properties format and use --add-config-file. If you have the new configurations in a file named new.properties:

    bin/kafka-configs --bootstrap-server localhost:9092 --entity-type brokers --entity-default --alter --add-config-file new.properties
    

    To describe the current dynamic broker configs for broker ID 0:

    bin/kafka-configs --bootstrap-server localhost:9092 --entity-type brokers --entity-name 0 --describe
    

    To delete a configuration override and revert to the statically configured or default value for broker ID 0 (for example, the number of log cleaner threads):

    bin/kafka-configs --bootstrap-server localhost:9092 --entity-type brokers --entity-name 0 --alter --delete-config log.cleaner.threads
    

    Some configurations may be configured as a cluster-wide default to maintain consistent values across the whole cluster. All brokers in the cluster will process the cluster default update. For example, to update log cleaner threads on all brokers:

    bin/kafka-configs --bootstrap-server localhost:9092 --entity-type brokers --entity-default --alter --add-config log.cleaner.threads=2
    

    To describe the currently configured dynamic cluster-wide default configurations:

    bin/kafka-configs --bootstrap-server localhost:9092 --entity-type brokers --entity-default --describe
    

    All configurations that are configurable at cluster level may also be configured at per-broker level (e.g. for testing). If a configuration value is defined at different levels, the following order of precedence is used:

    • Dynamic per-broker config stored in ZooKeeper
    • Dynamic cluster-wide default config stored in ZooKeeper
    • Static broker config from server.properties
  • 相关阅读:
    java spring cloud 企业电子招标采购系统源码:营造全面规范安全的电子招投标环境,促进招投标市场健康可持续发展
    金仓数据库KStudio使用手册(5. PLSQL开发)
    Linux系统编程04
    SQL的substring_index()用法——MySQL字符串截取
    QT With OpenGL(延时着色法)(Deferred Shading)
    多维时序 | MATLAB实现SSA-CNN-BiLSTM-Attention多变量时间序列预测(SE注意力机制)
    Docker容器搭建本地私有仓库
    一次直播和图像识别技术应用的探索之旅
    如何使用GPT引领前沿与应用突破之GPT4科研实践技术与AI绘图
    经典伴读_GOF设计模式_行为模式(下)
  • 原文地址:https://blog.csdn.net/qq_32907195/article/details/126488579