Foo L
Foo L

Reputation: 11137

kafka broker config change dynamically

I'm using kafka_2.9.2-0.8.1.1 with zookeeper 3.4.6.

Is there a way to change broker configuration settings dynamically? Specifically, I want to change controlled.shutdown.enable

bin/kafka-topics.sh --zookeeper zookeeper01.mysite.com --config controlled.shutdown.enable=true --alter

but I get the error

Missing required argument "[topic]"

Upvotes: 1

Views: 17065

Answers (2)

xmar
xmar

Reputation: 1809

You can now from 1.1 onwards: Dynamic Broker Config

In your case, something like:

> bin/kafka-configs.sh --bootstrap-server localhost:9092 \ 
--entity-type brokers --entity-name 0 --alter \ 
--add-config controlled.shutdown.enable=true

Upvotes: 3

Heejin
Heejin

Reputation: 4581

No, you can't change broker configs dynamically.

There are two kinds of configurations related to the brokers: broker configs and per-topic configs.

Since per-topic configs are managed by a Zookeeper cluster, you can change those with kafka-topics.sh on the fly.

controlled.shutdown.enable is, however, a broker config which can be only set up by server.properties file and requires broker restarting when to be changed.

This issue was also discussed in Kafka JIRA: [KAFKA-1229] Reload broker config without a restart

Upvotes: 7

Related Questions