mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 12:31:07 +01: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>
This commit is contained in:
parent
3d5d62e38a
commit
cc7d5b7bab
52
README.md
52
README.md
@ -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:
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user