windows上没有
nohup run.sh &一直开启cmd窗口,实在不方便,所以找到了WinSW工具
下载
 
选择如下两个文件下载
 
配置
下载完成后,放在同一文件夹下,重命名为相同的名字,如下
编辑xml文件如下
<service>
  
  <!-- ID of the service. It should be unique across the Windows system-->
  <id>elasticsearch7</id>
  <!-- Display name of the service -->
  <name>elasticsearch7</name>
  <!-- Service description -->
  <description>This service is a service created from a minimal configuration</description>
  
  <!-- Path to the executable, which should be started -->
  <executable>D:\MyProgram\development\elk\elasticsearch-7.7.1\bin\elasticsearch.bat</executable>
  
   <!-- <arguments>-jar statement-0.0.1-SNAPSHOT.jar</arguments> -->
</service>
### 注册服务
当前文件夹下以管理员身份打开cmd,运行boot.exe install
启动服务并运行
提示成功后services.msc 打开服务列表,启动对用的服务,并设置为自启动即可
 













网友评论