/usr/lib/systemd/system/kafka.service
[Unit]
Description=Kafka Server Service
After=network.target[Service]
Type=forking
User=tmn
Group=tmn
KillMode=control-group
Environment="JAVA_HOME=/opt/soft/jdk/jdk1.8.0_181"
ExecStart=/opt/soft/kafka/kafka_2.12-2.2.2/bin/kafka-server-start.sh -daemon /opt/soft/kafka/kafka_2.12-2.2.2/config/server.properties
ExecStop=/opt/soft/kafka/kafka_2.12-2.2.2/bin/kafka-server-stop.sh
ExecReload=/bin/kill -s HUP $MAINPID
SuccessExitStatus=0 143
PrivateTmp=false
LimitNOFILE=1000000
LimitNPROC=100000
TimeoutStopSec=10s
Restart=on-failure
RestartSec=30[Install]
WantedBy=multi-user.target
/usr/lib/systemd/system/zookeeper.service
[Unit]
Description=Zookeeper Service
After=network.target[Service]
Type=forking
User=tmn
Group=tmn
KillMode=control-group
Environment="JAVA_HOME=/usr/java/default"
ExecStart=/opt/soft/apache-zookeeper-3.5.9-bin/bin/zkServer.sh start
ExecStop=/opt/soft/apache-zookeeper-3.5.9-bin/bin/zkServer.sh stop
ExecReload=/opt/soft/apache-zookeeper-3.5.9-bin/bin/zkServer.sh restart
SuccessExitStatus=0 143
PrivateTmp=false
LimitNOFILE=1000000
LimitNPROC=100000
TimeoutStopSec=10s
Restart=on-failure
RestartSec=30[Install]
WantedBy=multi-user.targetEOF
systemctl daemon-reload
systemctl start kafka
systemctl start zookeeper
systemctl status kafka文章来源:https://www.toymoban.com/news/detail-701740.html
systemctl status zookeeper文章来源地址https://www.toymoban.com/news/detail-701740.html
到了这里,关于systemctl管理kafka和zookeeper的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!