Snap docs change (#986)

* adds snap docs,
adds release information for snap package,
adds docs notes about configuration management with snap package.

* adds release page mention

* version fix for snap, its awful

* revert version

* Apply suggestions from code review

Co-authored-by: Aliaksandr Valialkin <valyala@gmail.com>
This commit is contained in:
Nikolay 2020-12-29 12:43:09 +03:00 committed by GitHub
parent f6ca776c75
commit 85962b459f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 60 additions and 11 deletions

View file

@ -49,6 +49,10 @@ vmutils: \
vmbackup \ vmbackup \
vmrestore vmrestore
release-snap:
snapcraft
snapcraft upload "victoriametrics_$(PKG_TAG)_multi.snap" --release beta,edge,candidate
release: \ release: \
release-victoria-metrics \ release-victoria-metrics \
release-vmutils release-vmutils

View file

@ -104,6 +104,7 @@ Alphabetically sorted links to case studies:
* [How to start VictoriaMetrics](#how-to-start-victoriametrics) * [How to start VictoriaMetrics](#how-to-start-victoriametrics)
* [Environment variables](#environment-variables) * [Environment variables](#environment-variables)
* [Configuration with snap package](#configuration-with-snap-package)
* [Prometheus setup](#prometheus-setup) * [Prometheus setup](#prometheus-setup)
* [Grafana setup](#grafana-setup) * [Grafana setup](#grafana-setup)
* [How to upgrade VictoriaMetrics](#how-to-upgrade-victoriametrics) * [How to upgrade VictoriaMetrics](#how-to-upgrade-victoriametrics)
@ -197,6 +198,26 @@ Each flag value can be set via environment variables according to these rules:
* For repeating flags an alternative syntax can be used by joining the different values into one using `,` char as separator (for example `-storageNode <nodeA> -storageNode <nodeB>` will translate to `storageNode=<nodeA>,<nodeB>`) * For repeating flags an alternative syntax can be used by joining the different values into one using `,` char as separator (for example `-storageNode <nodeA> -storageNode <nodeB>` will translate to `storageNode=<nodeA>,<nodeB>`)
* It is possible setting prefix for environment vars with `-envflag.prefix`. For instance, if `-envflag.prefix=VM_`, then env vars must be prepended with `VM_` * It is possible setting prefix for environment vars with `-envflag.prefix`. For instance, if `-envflag.prefix=VM_`, then env vars must be prepended with `VM_`
### Configuration with snap package
Command-line flags can be changed with following command:
```text
echo 'FLAGS="-selfScrapeInterval=10s -search.logSlowQueryDuration=20s"' > $SNAP_DATA/var/snap/victoriametrics/current/extra_flags
snap restart victoriametrics
```
Or add needed command-line flags to the file `$SNAP_DATA/var/snap/victoriametrics/current/extra_flags`.
Note you cannot change value for `-storageDataPath` flag, for safety snap package has limited access to host system.
Changing scrape configuration is possible with text editor:
```text
vi $SNAP_DATA/var/snap/victoriametrics/current/etc/victoriametrics-scrape-config.yaml
```
After changes was made, trigger config re-read with command `curl 127.0.0.1:8248/-/reload`.
## Prometheus setup ## Prometheus setup

View file

@ -10,6 +10,19 @@ Release process guidance
5. Push release tag to https://github.com/VictoriaMetrics/VictoriaMetrics : `git push origin v1.xx.y`. 5. Push release tag to https://github.com/VictoriaMetrics/VictoriaMetrics : `git push origin v1.xx.y`.
6. Go to https://github.com/VictoriaMetrics/VictoriaMetrics/releases , create new release from the pushed tag on step 5 and upload `*.tar.gz` archive with the corresponding `_checksums.txt` from step 2. 6. Go to https://github.com/VictoriaMetrics/VictoriaMetrics/releases , create new release from the pushed tag on step 5 and upload `*.tar.gz` archive with the corresponding `_checksums.txt` from step 2.
## Building snap package.
pre-requirements:
- snapcraft binary, can be installed with commands:
for MacOS `brew install snapcraft` and [install mutipass](https://discourse.ubuntu.com/t/installing-multipass-on-macos/8329),
for Ubuntu - `sudo snap install snapcraft --classic`
- login with `snapcraft login`
- already created release at github (it operates `git describe` version, so git tag must be annotated).
0. checkout to the latest git tag for single-node version.
1. execute `make release-snap` - it must build and upload snap package.
2. promote release to current, if needed manually at release page [snapcraft-releases](https://snapcraft.io/victoriametrics/releases)
### Public Announcement ### Public Announcement
1. Publish message in slack (victoriametrics.slack.com, general channel) 1. Publish message in slack (victoriametrics.slack.com, general channel)

View file

@ -104,6 +104,7 @@ Alphabetically sorted links to case studies:
* [How to start VictoriaMetrics](#how-to-start-victoriametrics) * [How to start VictoriaMetrics](#how-to-start-victoriametrics)
* [Environment variables](#environment-variables) * [Environment variables](#environment-variables)
* [Configuration with snap package](#configuration-with-snap-package)
* [Prometheus setup](#prometheus-setup) * [Prometheus setup](#prometheus-setup)
* [Grafana setup](#grafana-setup) * [Grafana setup](#grafana-setup)
* [How to upgrade VictoriaMetrics](#how-to-upgrade-victoriametrics) * [How to upgrade VictoriaMetrics](#how-to-upgrade-victoriametrics)
@ -197,6 +198,26 @@ Each flag value can be set via environment variables according to these rules:
* For repeating flags an alternative syntax can be used by joining the different values into one using `,` char as separator (for example `-storageNode <nodeA> -storageNode <nodeB>` will translate to `storageNode=<nodeA>,<nodeB>`) * For repeating flags an alternative syntax can be used by joining the different values into one using `,` char as separator (for example `-storageNode <nodeA> -storageNode <nodeB>` will translate to `storageNode=<nodeA>,<nodeB>`)
* It is possible setting prefix for environment vars with `-envflag.prefix`. For instance, if `-envflag.prefix=VM_`, then env vars must be prepended with `VM_` * It is possible setting prefix for environment vars with `-envflag.prefix`. For instance, if `-envflag.prefix=VM_`, then env vars must be prepended with `VM_`
### Configuration with snap package
Command-line flags can be changed with following command:
```text
echo 'FLAGS="-selfScrapeInterval=10s -search.logSlowQueryDuration=20s"' > $SNAP_DATA/var/snap/victoriametrics/current/extra_flags
snap restart victoriametrics
```
Or add needed command-line flags to the file `$SNAP_DATA/var/snap/victoriametrics/current/extra_flags`.
Note you cannot change value for `-storageDataPath` flag, for safety snap package has limited access to host system.
Changing scrape configuration is possible with text editor:
```text
vi $SNAP_DATA/var/snap/victoriametrics/current/etc/victoriametrics-scrape-config.yaml
```
After changes was made, trigger config re-read with command `curl 127.0.0.1:8248/-/reload`.
## Prometheus setup ## Prometheus setup

View file

@ -9,23 +9,13 @@ snap link: https://snapcraft.io/victoriametrics
Install snapcraft and multipass: Install snapcraft and multipass:
```text ```text
snap install snapcraft sudo snap install snapcraft --classic
snap install multipass
``` ```
build victoria-metrics prod binary and run snapcraft ```snapcraft --debug```. build victoria-metrics prod binary and run snapcraft ```snapcraft --debug```.
It produces snap package with current git version - `victoriametrics_v1.46.0+git1.1bebd021a-dirty_all.snap`. It produces snap package with current git version - `victoriametrics_v1.46.0+git1.1bebd021a-dirty_all.snap`.
You can install it with command: `snap install victoriametrics_v1.46.0+git1.1bebd021a-dirty_all.snap --dangerous` You can install it with command: `snap install victoriametrics_v1.46.0+git1.1bebd021a-dirty_all.snap --dangerous`
package and publish:
```text
make victoria-metrics-package-snap
snap login
snap_file=$(ls | grep -e '_multi.snap$')
snapcraft upload --release=latest/edge "$snap_file"
rm "$snap_file"
```
#### usage #### usage