Skip to content

Commit

Permalink
docs: add example service configuration for windows
Browse files Browse the repository at this point in the history
Use service configuration example from #3781 (comment)

Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com>
  • Loading branch information
zekker6 committed Oct 5, 2023
1 parent 8b90bb3 commit 18e5461
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 0 deletions.
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
52 changes: 52 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
52 changes: 52 additions & 0 deletions docs/Single-server-VictoriaMetrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 18e5461

Please sign in to comment.