cmccabe commented on code in PR #19100: URL: https://github.com/apache/kafka/pull/19100#discussion_r1981933910
########## docs/zk2kraft.html: ########## @@ -153,6 +153,67 @@ <h3 class="anchor-heading">Configurations</h3> </ul> </li> </ul> + <h3 class="anchor-heading">Dynamic Log Levels</h3> + <ul> + <li> + <p> + The dynamic log levels feature allows you to change the log4j settings of a running broker or controller process without restarting it. The command-line syntax for setting dynamic log levels on brokers has not changed in KRaft mode. Here is an example of setting the log level on a broker:<br/> + <pre><code class="language-bash"> +./bin/kafka-configs.sh --bootstrap-server localhost:9092 \ + --entity-type broker-loggers \ + --entity-name 1 \ + --alter \ + --add-config org.apache.kafka.raft.KafkaNetworkChannel=TRACE + </code></pre> + </p> + </li> + <li> + <p> + When setting dynamic log levels on the controllers, the <code>--bootstrap-controller</code> flag must be used. Here is an example of setting the log level ona controller:<br/> + <pre><code class="language-bash"> +./bin/kafka-configs.sh --bootstrap-controller localhost:9093 \ + --entity-type broker-loggers \ + --entity-name 1 \ + --alter \ + --add-config org.apache.kafka.raft.KafkaNetworkChannel=TRACE + </code></pre><br/> + Note that the entity-type must be specified as <code>broker-loggers</code>, even though we are changing a controller's log level rather than a broker's log level. + </p> + </li> + <li> + <p> + When changing the log level of a combined node, which has both broker and controller roles, either --bootstrap-servers or --bootstrap-controllers may be used. Combined nodes have only a single set of log levels; there are not different log levels for the broker and controller parts of the process. + </p> + </li> + </ul> + <h3 class="anchor-heading">Dynamic Controller Configurations</h3> + <ul> + <li> + <p> + Some Kafka configurations can be changed dynamically, without restarting the process. The command-line syntax for setting dynamic log levels on brokers has not changed in KRaft mode. Here is an example of setting the number of IO threads on a broker:<br/> + <pre><code class="language-bash"> +./bin/kafka-configs.sh --bootstrap-server localhost:9092 \ + --entity-type brokers \ + --entity-name 1 \ + --alter \ + --add-config num.io.threads=5 + </code></pre> + </p> + </li> + <li> + <p> + Controllers will apply all applicable cluster-level dynamic configurations. For example, the following command-line will change the <code>max.connections</code> setting on all of the brokers and all of the controllers in the cluster:<br/> + <pre><code class="language-bash"> +./bin/kafka-configs.sh --bootstrap-server localhost:9092 \ + --entity-type brokers \ + --entity-default \ + --alter \ + --add-config max.connections=10000 + </code></pre><br/> + It is not currently possible to apply a dynamic configuration on only a single controller. Review Comment: It depends on if we wanted to do validation on the controller node whose configuration we were changing. If we did, then we would have to have the client initially contact that node in particular, and then pass the message to the active controller. If we don't care about pre-application validation then we could just send to the active controller like now. I don't think anyone has worked on this. It's not a feature in high demand since restarting controllers is so quick, that it's easier just to change the config file. But if you're interested you could look at implementing this. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org