systemctl管理kafka和zookeeper

/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.target

EOF
systemctl daemon-reload

systemctl start kafka

systemctl start zookeeper

systemctl status kafka

systemctl status zookeeper

相关推荐
运维&陈同学1 小时前
【zookeeper01】消息队列与微服务之zookeeper工作原理
运维·分布式·微服务·zookeeper·云原生·架构·消息队列
时差9531 小时前
Flink Standalone集群模式安装部署
大数据·分布式·flink·部署
菠萝咕噜肉i1 小时前
超详细:Redis分布式锁
数据库·redis·分布式·缓存·分布式锁
Mephisto.java1 小时前
【大数据学习 | Spark】Spark的改变分区的算子
大数据·elasticsearch·oracle·spark·kafka·memcache
只因在人海中多看了你一眼5 小时前
分布式缓存 + 数据存储 + 消息队列知识体系
分布式·缓存
zhixingheyi_tian7 小时前
Spark 之 Aggregate
大数据·分布式·spark
KevinAha9 小时前
Kafka 3.5 源码导读
kafka
求积分不加C9 小时前
-bash: ./kafka-topics.sh: No such file or directory--解决方案
分布式·kafka
nathan05299 小时前
javaer快速上手kafka
分布式·kafka
激流丶12 小时前
【Kafka 实战】Kafka 如何保证消息的顺序性?
java·后端·kafka