在windows server上部署spring boot

spring boot 部署参考官方文档https://docs.spring.io/spring-boot/docs/2.0.8.RELEASE/reference/htmlsingle/#deployment-windows

通过官网信息可得,在windows server上部署spring boot 需要使用winsw

winsw下载地址:https://github.com/winsw/winsw/releases

仔细阅读安装指南:https://github.com/winsw/winsw/blob/master/doc/installation.md

根据安装指南,可以看出需要下载的文件包括sample-minimal.xml、WinSW.NET4.exe

把sample-minimal.xml、WinSW.NET4.exe放在同一个目录下,打包的jar也放在同一目录下,修改exe、xml文件的名称为同样的名称。

修改xml配置文件

xml文件配置参考:https://github.com/winsw/winsw/blob/master/doc/xmlConfigFile.md

在<arguments>中配置jar

如果server中配置了java,在executable直接配置java就可以了

<service>
  
  <!-- ID of the service. It should be unique across the Windows system-->
  <id>s*********l</id>
  <!-- Display name of the service -->
  <name>s*********l_test</name>
  <!-- Service description -->
  <description>This service is a service created from a minimal configuration</description>
  
  <!-- Path to the executable, which should be started -->
  <executable>java</executable>
  
  <arguments>-Xmx256m -jar s*************y.jar</arguments>
  
  <logmode>rotate</logmode>

</service>

管理员权限启动cmd,在exe目录中,执行exe install安装服务

输入net start xxxxxxName启动服务。或者在cmd中输入services.msc查看系统服务,手动启动服务

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值