I am trying to manager kafka broker by systemd. here is a unit-file:
[Unit]
Description=Kafka with broker id (%i)
After=network.target
After=zk.service
[Service]
Type=simple
SyslogIdentifier=kafka (%i)
WorkingDirectory=/opt/service/kafka_2.11-0.9.0.1
LimitNOFILE=16384:163840
ExecStart=/usr/bin/bash -c 'bin/kafka-server-start.sh /opt/service/units/kafka/%i.properties'
ExecStop=/usr/bin/bash -c 'bin/kafka-server-stop.sh /opt/service/units/kafka/%i.properties'
[Install]
WantedBy=multi-user.target
with that file, I can start kafka by command systemctl --user start kafka@0.service
and systemctl --user start kafka@1.service
.
But when I try to kill those daemons by systemctl --user stop kafka@0.service
, all two daemons are stoped! so, why could not I kill just only one broker?