1.首先需要下载一个winSw.exe可以到官网下载地址是Releases · winsw/winsw · GitHub
以下版本是win64版本 WinSW v2.11.0
链接:https://pan.baidu.com/s/1kDgLfmNeyVj74caUZjyNTw?pwd=1234
提取码:1234
2.下载后将winsw.exe拷贝到nacos的bin目录下,并重命名为nacosService.exe。
3.并创建nacosService.xml文件内容如下
<?xml version="1.0" encoding="UTF-8"?>
<service>
<id>nacosService</id>
<name>nacosService</name>
<description>nacosService</description>
<executable>D:\nacos\bin\startup.cmd</executable>
<arguments>startup.cmd -m standalone</arguments>
<logpath>D:\nacos\bin\logs</logpath>
</service>
4.以管理员权限cmd到nacos的bin目录,执行以下命令:
1.安装服务:nacosService.exe install
2.启动服务:net start nacosService
5.nacos就启动好了可以通过http://127.0.0.1:8848/nacos/#/login 账号密码都是nacos。
6.如果要停止服务,同样管理员进入到bin目录下执行net stop nacosService即可
7.如果要卸载该服务先停止该服务再执行nacosService.exe uninstall即可