diff --git a/README.md b/README.md index 24837c605..93c42e4c6 100644 --- a/README.md +++ b/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 + + VictoriaMetrics + VictoriaMetrics + VictoriaMetrics + %BASE%\victoria-metrics-windows-amd64-prod.exe" + + + + + 1 hour + + -envflag.enable + + Normal + + 15 sec + + true + Automatic + 15 sec + 1 sec + + %BASE%\logs + + 10240 + 8 + + + + + + + + ``` + +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: diff --git a/docs/README.md b/docs/README.md index 2dd7347b4..142aa9f9c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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 + + VictoriaMetrics + VictoriaMetrics + VictoriaMetrics + %BASE%\victoria-metrics-windows-amd64-prod.exe" + + + + + 1 hour + + -envflag.enable + + Normal + + 15 sec + + true + Automatic + 15 sec + 1 sec + + %BASE%\logs + + 10240 + 8 + + + + + + + + ``` + +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: diff --git a/docs/Single-server-VictoriaMetrics.md b/docs/Single-server-VictoriaMetrics.md index d930e7643..ee66d9ed5 100644 --- a/docs/Single-server-VictoriaMetrics.md +++ b/docs/Single-server-VictoriaMetrics.md @@ -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 + + VictoriaMetrics + VictoriaMetrics + VictoriaMetrics + %BASE%\victoria-metrics-windows-amd64-prod.exe" + + + + + 1 hour + + -envflag.enable + + Normal + + 15 sec + + true + Automatic + 15 sec + 1 sec + + %BASE%\logs + + 10240 + 8 + + + + + + + + ``` + +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: