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
标签:exe,service,windows,nacos,green,WinSW,2.0 From: https://www.cnblogs.com/simon-xie/p/16999083.html