将springboot安装成windows服务启动。
本文下载了winsw-2.3.0-bin.exe。
新建一个目录aiplatformService
在目录里面新建一个aiplatformService.xml,同时把winsw-2.3.0-bin.exe重命名陈aiplatformService.exe
必须这么做,否则无法安装启动服务。
编辑aiplatfomService.xml文件
<?xml version="1.0" encoding="utf-8" ?>
<service>
<id>aiPlat</id> <!-- must be unique -->
<name>ai Platfrom Daemon</name>
<description>ai平台演示程序</description>
<executable>javaw</executable>
<arguments>-jar "%BASE%\web-0.2.jar"</arguments>
<logpath>%BASE%\log</logpath>
<log mode="roll-by-time">
<pattern>yyyy-MM-dd</pattern>
</log>
</service>
在目录中放入你的springboot项目,web-0.2.jar
在命令行 运行
安装服务命令
aiPlatService.exe install
启动服务
E:\aiplatformService>aiPlatService.exe stop
2019-09-05 15:59:31,974 INFO - Stopping the service with id 'aiPlat'
关闭服务
E:\aiplatformService>aiPlatService.exe start
2019-09-05 15:59:38,399 INFO - Starting the service with id 'aiPlat'
卸载服务命令
aiPlatService.exe uninstall
成功运行后如下
参考:https://reflectoring.io/autostart-with-winsw/
将springboot安装成windows服务启动。的更多相关文章
- 【先定一个小目标】Redis 安装成windows服务-开机自启
1.第一步安装成windows服务的,开机自启动 redis-server --service-install redis.windows.conf 2.启动\关闭 redis-server --se ...
- Java的jar文件安装成windows 服务
Java的jar文件安装成windows 服务: 1.下载:nssm,复制到jar文件目录下 2. jar文件目录下创建bat文件[run.bat],内容为[java -jar 文件名.jar] 3. ...
- Nginx 安装成 Windows 服务
Nginx 安装成Windows 服务方法,具体方法如下 1. 下载nginx windows版本 http://www.nginx.org 2. 下载微软的2个工具: instsrv.exe.srv ...
- Redis是可以安装成windows服务-开机自启
其实Redis是可以安装成windows服务的,开机自启动,命令如下 redis-server --service-install redis.windows.conf 安装完之后,就可看到Redis ...
- 使用srvany.exe把程序安装成windows服务的方法
http://mazhihui.iteye.com/blog/1294431 srvany.exe是什么? srvany.exe是Microsoft Windows Resource Kits工具集的 ...
- 使用srvany.exe将程序安装成windows服务的详细教程
srvany.exe介绍 srvany.exe是Microsoft Windows Resource Kits工具集的一个实用的小工具,用于将任何EXE程序作为Windows服务运行.也就是说srva ...
- Redis是可以安装成windows服务-开机自启 win7 64位
其实Redis是可以安装成windows服务的,开机自启动,命令如下: redis-server --service-install redis.windows.conf 安装完之后,就可看到Redi ...
- 使用srvany.exe把程序安装成windows服务
srvany.exe介绍 srvany.exe是Microsoft Windows Resource Kits工具集的一个实用的小工具,用于将任何EXE程序作为Windows服务运行.也就是说srva ...
- ELK安装成windows服务
一.Elasticsearch安装成windows服务 我的es所在路径为:D:\ELK5.5.0\elasticsearch-5.5.0 Java 安装目录为:C:\Program Files\Ja ...
随机推荐
- Linux下 expect 使用详解与实例
一.概述 我们通过Shell可以实现简单的控制流功能,如:循环.判断等.但是对于需要交互的场合则必须通过人工来干预,有时候我们可能会需要实现和交互程序如telnet服务器等进行交互的功能.而Expec ...
- WebMvcConfig
package cn.xx.yy; import java.util.ArrayList;import java.util.HashMap;import java.util.List;import j ...
- 4.使用webpack-dev-server工具实现自动打包编译的功能
使用webpack-dev-server这个工具,来实现自动打包编译的功能 1.运行 npm i webpack-dev-server -D 把这个工具安装到项目的本地开发依赖 或者运行 cnpm i ...
- Oracle-锁的查询和处理
1.查出锁定object的session的信息以及被锁定的object名 SELECT L.SESSION_ID SID, S.SERIAL#, L.LOCKED_MODE, L.ORACLE_USE ...
- django2为什么要用序列化
https://www.jianshu.com/p/1e404604d5c3 结论:如果没用序列化,Django默认将数据进行多次转换才能提取我们所需数据,出现关联时我们还需进一步对数据进行查询,操作 ...
- js中当call或者apply传入的第一个参数是null/undefined时,js函数内执行的上下文环境是什么?
在js中我们都知道call/apply,还有比较少用的bind;传入的第一个参数都是改变函数当前上下文对象; call/apply区别在于传的参数不同,一个是已逗号分隔字符串,一个以数组形式.而bin ...
- delegate:动态绑定js事件
$('.videomodule').delegate("span", "click", function() { var i = $(this).index() ...
- python--第五天练习题
# 1.按alist中元素的age由大到小排序 alist = [{'name': 'a', 'age': 20}, {'name': 'b', 'age': 30}, {'name': 'v', ' ...
- MySQL Bug#67718 浅谈B+树索引的分裂优化
原文链接:http://hedengcheng.com/?p=525 问题背景 今天,看到Twitter的DBA团队发布了其最新的MySQL分支:Changes in Twitter MySQL 5. ...
- js快速将字符串数组转化为数字数组(互换)
1.数字数组转化为字符串数组 var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]; arr.map(String); //结果: ['1', '2', '3', '4', '5 ...