Home > Enterprise >  How to modify on-the-fly kafka cluster logger?
How to modify on-the-fly kafka cluster logger?

Time:08-11

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

CodePudding user response:

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.

  • Related