项目需求:将kafka启动注册为windows系统服务
开发环境中使用批处理一键启动,但是生产环境中需要注册为系统服务方便维护
原始批处理代码:
@echo off
start cmd /k "bin\windows\zookeeper-server-start.bat config\zookeeper.properties"
start cmd /k "bin\windows\kafka-server-start.bat config\server.properties"
exit
使用winSW工具将批处理bat注册为windows系统服务步骤
1.下载winSW,地址:http://repo.jenkins-ci/releases/com/sun/winsw/winsw/
2.将.exe和.xml放到kafka根目录
配置winSW.xml
<service>
<!-- 指定在Windows系统内部使用的识别服务的ID。在系统中安装的所有服务中,这必须是唯一的,它应该完全由字母数字字符组成 -->
<id>kafka</id>
<!-- 服务的简短名称,它可以包含空格和其他字符。尽量简短,
发布者:admin,转转请注明出处:http://www.yc00.com/web/1742173404a4395523.html
评论列表(0条)