Simple debian packaging for Apache Kafka 0.8.1,
According to debian guidelines kafka user will not be dropped on package deletion - only locked (postrm script) On installation of a package user will be created, if not exists. If exists - unlocked.
- Pid storage:
/var/run/*.pid
- Kafka working path (message logs):
/var/lib/kafka
, also this is$HOME
for kafka user... - Kafka binaries path:
/opt/kafka
- Kafka configuration:
/etc/kafka
linked to/opt/kafka/config
- Kafka init script (debian):
/etc/init.d/kafka
- Kafka "default" :
/etc/default/kafka
Following Filesystem Hierarchy Standard here: /opt
is for programs that are not packaged and don't follow the standards. You'd just put all the libraries there together with the program.
Some other scripts on github have kafka packaged to /usr/lib/kafka
(and they have bin
, and libs
inside), this approach does not comply with FHS.
So, it was decided to use /opt/kafka
. Configs are linked from /etc
and init script is in /etc/init.d/*
Kafka is using slf4j
, and there is log4j
config in /opt/kafka/config
KAFKA_HEAP_OPTS
is set in /etc/default/kafka
, as well as ulimits. These configs are pulled by init script. Kafka opens lots of files, so in most cases ulimit for opened files should be changed from default.
Yet this script was developed with LSB in mind, but tested only under debian 7 (can also work on other dists that support LSB and init system).
This script is building debian package, but using fpm
, so it should also build rpm
package. (not tested).