Setting log.dirs outside of Mesos executor workspace is tedious
Closed this issue · 2 comments
To store Kafka's topic data outside of Mesos' executor workspace, we can use the log.dirs
property and specify an absolute path to the system, e.g.: /mnt/array1/kafka,/mnt/array2/kafka
.
This works fine, but will break when 2 different brokers run from the same Mesos agent. When a broker starts, it creates a meta.properties
file in each log.dirs
directory which contains the broker id. So if a new broker with a different id is started on that agent, it refuses to start.
This situation can happen for 2 reasons:
- the broker configuration is not using constraints and the scheduler ends up using the same agent
- a broker used to run on that agent, but no longer does (so even with constraints on, we can get in this situation)
The solution is to use a slightly different log.dirs
parameter per broker (e.g.: /mnt/array1/kafka/broker0
) but that's tedious since you have to specify a different configuration for each broker.
It would be nice if one could specify a path that kafka-mesos
would manage or allow substitution, (e.g.: /mnt/array1/kafka/broker${brokerId}
)
Probably using Mesos' persistent volumes can also solve this, but it's not clear to me how this feature works with kafka-mesos.
you can use $id to-do what you are looking for e.g. https://github.com/mesos/kafka#rolling-restart
Argh! Didn't notice that in the examples. Thanks!