mirror of
https://gitea.0xace.cc/ansible-playbooks/victoriametrics.git
synced 2024-11-24 23:56:39 +00:00
71 lines
1.1 KiB
Markdown
71 lines
1.1 KiB
Markdown
# Setup VictoriaMetrics 1.101.1 cluster
|
|
|
|
## Install ansible and requirements in virtualenv
|
|
|
|
mkvirtualenv ansible-9.5.1
|
|
pip install -r requirements.txt
|
|
deactivate
|
|
workon ansible-9.5.1
|
|
|
|
## Install roles
|
|
|
|
ansible-playbook ansible-roles.yaml
|
|
|
|
## Install Patroni
|
|
|
|
ansible-playbook -i inventory/hosts victoriametrics.yaml -u almalinux
|
|
|
|
|
|
## Example hosts file:
|
|
|
|
[victoriametrics:children]
|
|
vmstorage
|
|
vminsert
|
|
vmselect
|
|
vmauth
|
|
vmagent
|
|
|
|
[vmstorage]
|
|
vm-1
|
|
vm-2
|
|
vm-3
|
|
|
|
[vminsert]
|
|
vm-1
|
|
vm-2
|
|
vm-3
|
|
|
|
[vmselect]
|
|
vm-1
|
|
vm-2
|
|
vm-3
|
|
|
|
[vmauth]
|
|
vm-1
|
|
vm-2
|
|
vm-3
|
|
|
|
[vmagent]
|
|
vm-1
|
|
vm-2
|
|
vm-3
|
|
|
|
Example group_vars:
|
|
|
|
victoriametrics_vmauth_reloadAuthKey: reload-auth-key
|
|
victoriametrics_vmauth_users:
|
|
- id: "1"
|
|
username: "foobar"
|
|
password: "foobar"
|
|
|
|
victoriametrics_vmagent_prometheus_config:
|
|
global:
|
|
scrape_interval: '1m'
|
|
scrape_timeout: '1m'
|
|
scrape_configs:
|
|
- job_name: 'rgw'
|
|
stream_parse: true
|
|
static_configs:
|
|
- targets: ['127.0.0.1:9242']
|
|
|