使用WinSW将nacos安装为windows服务

1、下载WinSW:https://github.com/winsw/winsw/releases,此处下载WinSW v2.11.0版,以下几个版本都行:

 

 此处使用WinSW-x64.exe

2、将WinSW-x64.exe重命名为nacos-service.exe,并拷贝到nacos根目录

3、在nacos根目录新建一个nacos-service.xml的文件,编码格式为UTF-8,内容如下:

 1 <service>
 2   
 3   <!-- ID of the service. It should be unique across the Windows system-->
 4   <id>Nacos2.0.4</id>
 5   <!-- Display name of the service -->
 6   <name>Nacos2</name>
 7   <!-- Service description -->
 8   <description>Nacos2.0.4</description>
 9   <logpath>E:\green\nacos-2.0.4\logs</logpath>
10   <!-- Path to the executable, which should be started -->
11   <executable>E:\green\nacos-2.0.4\bin\startup.cmd</executable>
12   <stopexecutable>E:\green\nacos-2.0.4\bin\shutdown.cmd</stopexecutable>
13   <startmode>Automatic</startmode>
14 </service>

4、安装服务nacos-service install

5、删除服务nacos-service uninstall

 

posted @ 2022-12-22 16:34  疯狗强尼  阅读(832)  评论(0编辑  收藏  举报