简体   繁体   中英

How to modify on-the-fly kafka cluster logger?

I have a secure kafka cluster (SSL with certificate) in production and i want to modify some logger level on-the-fly without restarting the cluster (even with a rolling update)

In the official doc it state you can modify broker configuration dynamically.

So, i tried this command

/bin/kafka-configs --bootstrap-server localhost:9092 --describe --entity-type broker-loggers --entity-name 1

only to obtain this error

java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.ClusterAuthorizationException: Cluster authorization failed.

If i try with port 9093 i get a java.util.concurrent.TimeoutException

kafka-configs is the right command to use.

You need to tell the command "who you are" / "log in".

It's achieved with the --command-config option.

There is an official example here

kafka-configs --command-config /etc/kafka/client.properties --bootstrap-server [hostname]:9093 --describe --entity-type broker-loggers --entity-name 1

Once you can use describe , then you can alter like

kafka-configs --command-config /etc/kafka/client.properties --bootstrap-server [hostname]:9093 --alter --add-config "kafka.authorizer.logger=INFO" --entity-type broker-loggers --entity-name 1

Which result in

Completed updating config for broker-logger 1.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM