get current config in kafka
Asked Answered
O

5

14

I was trying to get the config for one of the kafka clusters we have. After doing a config change through puppet, I want to know if kafka has reloaded the config, or if we need to restart the service for that.

I have tried with ./kafka-configs.sh --describe --zookeeper my-zookeeper:2181 --entity-type brokers but I only have empty output.

I have also tried to find for the config browsing inside the zookeepers but i have found nothing.

Is there any way to retrieve which config is being used?

Olympic answered 21/3, 2018 at 12:41 Comment(3)
On broker start up , it should be printing the current config if log level is enabledBrooke
thanks a lot @LijuJohn, it was there.Olympic
How would I get the config of a kafka broker that is running and which I'm unauthorized to restart..?Ferromagnetism
O
5

as suggested @LijuJohn i found the config in the server.log file. Thanks a lot!!

Olympic answered 21/3, 2018 at 14:45 Comment(1)
Doesn't help if the brokers never stop, and so are never restarted, though I accept it worked in your caseTahmosh
D
15

Here's full working command to list all configs for the broker with id=1:

./bin/kafka-configs.sh --bootstrap-server <broker-host>:9092 --entity-type 
brokers --entity-name 1 --all --describe
Difficile answered 25/2, 2021 at 13:58 Comment(2)
It doesn't work for me cause: all is not a recognized option.Uncover
@Uncover use kafka >= 2.5Hirohito
O
5

as suggested @LijuJohn i found the config in the server.log file. Thanks a lot!!

Olympic answered 21/3, 2018 at 14:45 Comment(1)
Doesn't help if the brokers never stop, and so are never restarted, though I accept it worked in your caseTahmosh
P
1

Since Kafka 2.5.0 (see issue here), you can now specify the --all flag to list all configs (not just the dynamic ones) when using ./kafka-configs.sh

Phosphide answered 8/1, 2021 at 9:42 Comment(0)
F
1

On CentOS7, kafka version:3.3.2

Should be able to find all the configurations via:

bin/kafka-configs.sh --describe --bootstrap-server <advertised.listeners>:9092 --entity-type brokers --entity-name <broker-id> --all

#example:
bin/kafka-configs.sh --describe --bootstrap-server localhost:9092 --entity-type brokers --entity-name 0 --all

Note: Both <advertised.listeners> and could be found in config/server.properties

Formulism answered 7/2, 2023 at 2:39 Comment(0)
M
0

Have you tried with parameter --entity-name 0 where 0 is the id of the broker? This is required at least for my cluster.

Mixup answered 23/10, 2020 at 7:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.