普通命令注册为windows服务
https://www.cnblogs.com/li150dan/p/15603149.html
作为 Windows 服务运行#
为了将 VictoriaMetrics 作为 Windows 服务运行,需要为 WinSW 创建服务配置,然后根据以下指南将其安装为服务: 创建服务配置: <service> <id>VictoriaMetrics</id> <name>VictoriaMetrics</name> <description>VictoriaMetrics</description> <executable>%BASE%\victoria-metrics-windows-amd64-prod.exe"</executable> <onfailure action="restart" delay="10 sec"/> <onfailure action="restart" delay="20 sec"/> <resetfailure>1 hour</resetfailure> <arguments>-envflag.enable</arguments> <priority>Normal</priority> <stoptimeout>15 sec</stoptimeout> <stopparentprocessfirst>true</stopparentprocessfirst> <startmode>Automatic</startmode> <waithint>15 sec</waithint> <sleeptime>1 sec</sleeptime> <logpath>%BASE%\logs</logpath> <log mode="roll"> <sizeThreshold>10240</sizeThreshold> <keepFiles>8</keepFiles> </log> <env name="loggerFormat" value="json" /> <env name="loggerOutput" value="stderr" /> <env name="promscrape_config" value="C:\Program Files\victoria-metrics\promscrape.yml" /> </service> 解释 XML格式 按照本文档安装 WinSW。 通过从提升的 PowerShell 运行以下命令,将 VictoriaMetrics 安装为服务:Install VictoriaMetrics as a service by running the following from elevated PowerShell: winsw install VictoriaMetrics.xml Get-Service VictoriaMetrics | Start-Service
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 葡萄城 AI 搜索升级:DeepSeek 加持,客户体验更智能
· 什么是nginx的强缓存和协商缓存
· 一文读懂知识蒸馏