docs: add example service configuration for windows (#5129)

Use service configuration example from https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3781#issuecomment-1424671624

Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com>
This commit is contained in:
Zakhar Bessarab 2023-10-05 15:55:27 +04:00 committed by GitHub
parent 3d5d62e38a
commit cc7d5b7bab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 156 additions and 0 deletions

View File

@ -211,6 +211,58 @@ vi $SNAP_DATA/var/snap/victoriametrics/current/etc/victoriametrics-scrape-config
After changes were made, trigger config re-read with the command `curl 127.0.0.1:8428/-/reload`.
### Running as Windows service
In order to run as a windows service it is required to create a service configuration for [WinSW](https://github.com/winsw/winsw)
and then install it as a service.
1. Create a service configuration:
```xml
<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>
```
1. Install WinSW by following this [documentation](https://github.com/winsw/winsw#download).
1. Install VictoriaMetrics as a service by running the following from elevated PowerShell:
```console
winsw install VictoriaMetrics.xml
Get-Service VictoriaMetrics | Start-Service
```
## Prometheus setup
Add the following lines to Prometheus config file (it is usually located at `/etc/prometheus/prometheus.yml`) in order to send data to VictoriaMetrics:

View File

@ -214,6 +214,58 @@ vi $SNAP_DATA/var/snap/victoriametrics/current/etc/victoriametrics-scrape-config
After changes were made, trigger config re-read with the command `curl 127.0.0.1:8428/-/reload`.
### Running as Windows service
In order to run as a windows service it is required to create a service configuration for [WinSW](https://github.com/winsw/winsw)
and then install it as a service.
1. Create a service configuration:
```xml
<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>
```
1. Install WinSW by following this [documentation](https://github.com/winsw/winsw#download).
1. Install VictoriaMetrics as a service by running the following from elevated PowerShell:
```console
winsw install VictoriaMetrics.xml
Get-Service VictoriaMetrics | Start-Service
```
## Prometheus setup
Add the following lines to Prometheus config file (it is usually located at `/etc/prometheus/prometheus.yml`) in order to send data to VictoriaMetrics:

View File

@ -222,6 +222,58 @@ vi $SNAP_DATA/var/snap/victoriametrics/current/etc/victoriametrics-scrape-config
After changes were made, trigger config re-read with the command `curl 127.0.0.1:8428/-/reload`.
### Running as Windows service
In order to run as a windows service it is required to create a service configuration for [WinSW](https://github.com/winsw/winsw)
and then install it as a service.
1. Create a service configuration:
```xml
<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>
```
1. Install WinSW by following this [documentation](https://github.com/winsw/winsw#download).
1. Install VictoriaMetrics as a service by running the following from elevated PowerShell:
```console
winsw install VictoriaMetrics.xml
Get-Service VictoriaMetrics | Start-Service
```
## Prometheus setup
Add the following lines to Prometheus config file (it is usually located at `/etc/prometheus/prometheus.yml`) in order to send data to VictoriaMetrics: