jaytaylor / ansible-kafka

Ansible Kafka role
https://galaxy.ansible.com/jaytaylor/kafka/
Other
67 stars 52 forks source link

With generated machine id, this seems to exceed reserved.broker.max.id in 0.9.0.0 #4

Closed kareblak closed 8 years ago

kareblak commented 8 years ago
reserved.broker.max.id = 1000

[2016-01-06 10:46:40,824] FATAL  (kafka.Kafka$)
java.lang.IllegalArgumentException: requirement failed: broker.id must be equal or greater than -1 and not greater than reserved.broker.max.id
        at scala.Predef$.require(Predef.scala:219)
        at kafka.server.KafkaConfig.validateValues(KafkaConfig.scala:945)
        at kafka.server.KafkaConfig.<init>(KafkaConfig.scala:942)
        at kafka.server.KafkaConfig$.fromProps(KafkaConfig.scala:691)
        at kafka.server.KafkaServerStartable$.fromProps(KafkaServerStartable.scala:28)
        at kafka.Kafka$.main(Kafka.scala:58)
        at kafka.Kafka.main(Kafka.scala)
kareblak commented 8 years ago

The easiest way to solve this is to just specify broker.id in the inventory file.

jaytaylor commented 8 years ago

Does this mean we could just set a much higher default value for the kafka config template to avoid this issue?

aisch commented 8 years ago

yes, e.g. it generated this:

broker.id=304017429

and adding this to server.properties worked for me:

reserved.broker.max.id=1000000000

i can add that to a pr i'm working on for 0.9.0.0. note though that 0.9.0.0 does auto broker id assignment which we should probably used by default.

jaytaylor commented 8 years ago

Auto-broker id sounds highly preferable to the moderately insane (or possibly even completely off the rails!) one-liner I devised and put in to generate a consistent ID.. ;)

jaytaylor commented 8 years ago

See: https://github.com/jaytaylor/ansible-kafka/blob/master/tasks/kafka-cfg.yml#L4