Pen*_* Qu 2 apache-kafka systemd
我试图通过systemd管理kafka经纪人.这是一个单元文件:
[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
Run Code Online (Sandbox Code Playgroud)
与该文件,我可以通过命令启动卡夫卡systemctl --user start kafka@0.service
和systemctl --user start kafka@1.service
.
但是当我试图杀死那些守护进程时systemctl --user stop kafka@0.service
,所有两个守护进程都停止了!所以,为什么我不能只杀死一个经纪人呢?
像这样的东西:
[Unit]
Description=Kafka with broker id (%i)
After=network.target
After=zk.service
[Service]
Type=forking
SyslogIdentifier=kafka (%i)
Restart=on-failure
LimitNOFILE=16384:163840
ExecStart=/opt/service/kafka_2.11-0.9.0.1/bin/kafka-server-start.sh -daemon /opt/service/units/kafka/%i.properties
[Install]
WantedBy=multi-user.target
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4573 次 |
最近记录: |