mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-02-19 15:30:17 +00:00
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>
(cherry picked from commit cc7d5b7bab
)
Signed-off-by: hagen1778 <roman@victoriametrics.com>
This commit is contained in:
parent
f42c12e69a
commit
99582f19d2
2 changed files with 104 additions and 0 deletions
|
@ -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`.
|
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
|
## 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:
|
Add the following lines to Prometheus config file (it is usually located at `/etc/prometheus/prometheus.yml`) in order to send data to VictoriaMetrics:
|
||||||
|
|
|
@ -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`.
|
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
|
## 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:
|
Add the following lines to Prometheus config file (it is usually located at `/etc/prometheus/prometheus.yml`) in order to send data to VictoriaMetrics:
|
||||||
|
|
Loading…
Reference in a new issue