Nacos设置为windows自启动服务
Nacos设置为windows自启动服务
参考:
1、nacos下载安装
官网教程:
2、下载WinSW
-
win64: win32:
3、在nacos的bin目录下,将下载的winsw.exe拷贝到此目录下,并重命名为NacosWinService.exe。
4、在nacos的bin目录下新建配置文件NacosWinService.xml,写入服务的相关配置:
<?xml version="1.0" encoding="UTF-8"?> <service> <id>NacosWinService</id> <name>NacosWinService</name> <description>NacosWinService</description> <executable>%BASE%startup.cmd</executable> <arguments>-m standalone</arguments> <logpath>%BASE%serviceLogs</logpath> </service>
5、以管理员权限cmd到nacos的bin目录,执行以下命令:
- 安装服务:NacosWinService.exe install
- 启动服务:net start NacosWinService
6、访问127.0.0.1:8848/nacos,账号密码默认都是nacos。
7、如果要停止服务,则执行net stop NacosWinService
8、如果要卸载服务,则cmd到nacos的bin目录,执行NacosWinService.exe uninstall
下一篇:
java面试一般提问的问题,详细说明