feat: add vmcluster module (#363)
- manage vmstorage package, service and environment file - manage vmselect package, service and environment file - manage vminsert package, service and environment file - manage vmagent package, service and environment file - manage options for vmstorage, vmselect, vminsert, vmagent role Reviewed-on: #363
This commit was merged in pull request #363.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<%
|
||||
opts = @options || {}
|
||||
lines = []
|
||||
|
||||
opts.each do |key, val|
|
||||
flag = "-#{key}"
|
||||
|
||||
if val.is_a?(Array)
|
||||
val.each do |v|
|
||||
lines << "#{flag}=#{v}"
|
||||
end
|
||||
else
|
||||
lines << "#{flag}=#{val}"
|
||||
end
|
||||
end
|
||||
%>
|
||||
OPTIONS="<%= lines.map { |l| l.lstrip }.join(" \\\n ") %>"
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
scrape_timeout: 10s
|
||||
|
||||
scrape_configs:
|
||||
- job_name: 'consul'
|
||||
consul_sd_configs:
|
||||
- server: 'consul.service.consul:8500'
|
||||
token: <%= @consul_node_token %>
|
||||
scheme: http
|
||||
|
||||
relabel_configs:
|
||||
# Only keep services with the `metrics` tag
|
||||
- source_labels: [__meta_consul_tagpresent_metrics]
|
||||
regex: true
|
||||
action: keep
|
||||
|
||||
# Use the service address and port
|
||||
- source_labels: [__meta_consul_node, __meta_consul_service_port]
|
||||
separator: ':'
|
||||
target_label: __address__
|
||||
replacement: '${1}:${2}'
|
||||
action: replace
|
||||
|
||||
# Set scheme to metrics_scheme
|
||||
- source_labels: [__meta_consul_tag_metrics_scheme]
|
||||
target_label: __scheme__
|
||||
action: replace
|
||||
|
||||
# Set path to /metrics
|
||||
- target_label: __metrics_path__
|
||||
replacement: /metrics
|
||||
|
||||
# Use metrics_job=<job> as job label
|
||||
- source_labels: [__meta_consul_tag_metrics_job]
|
||||
target_label: job
|
||||
action: replace
|
||||
@@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=VictoriaMetrics vmagent service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=<%= @user %>
|
||||
Group=<%= @group %>
|
||||
Restart=always
|
||||
EnvironmentFile=<%= @vars_file %>
|
||||
ExecStart=<%= @exec_path %> -remoteWrite.tmpDataPath=<%= @data_path %> $OPTIONS
|
||||
|
||||
PrivateTmp=yes
|
||||
NoNewPrivileges=yes
|
||||
ProtectSystem=full
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=VictoriaMetrics vminsert service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=<%= @user %>
|
||||
Group=<%= @group %>
|
||||
Restart=always
|
||||
EnvironmentFile=<%= @vars_file %>
|
||||
ExecStart=<%= @exec_path %> $OPTIONS
|
||||
|
||||
PrivateTmp=yes
|
||||
NoNewPrivileges=yes
|
||||
ProtectSystem=full
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=VictoriaMetrics vmselect service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=<%= @user %>
|
||||
Group=<%= @group %>
|
||||
Restart=always
|
||||
EnvironmentFile=<%= @vars_file %>
|
||||
ExecStart=<%= @exec_path %> -cacheDataPath=<%= @data_path %> $OPTIONS
|
||||
|
||||
PrivateTmp=yes
|
||||
NoNewPrivileges=yes
|
||||
ProtectSystem=full
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=VictoriaMetrics vmstorage service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=<%= @user %>
|
||||
Group=<%= @group %>
|
||||
Restart=always
|
||||
EnvironmentFile=<%= @vars_file %>
|
||||
ExecStart=<%= @exec_path %> -storageDataPath=<%= @data_path %> $OPTIONS
|
||||
|
||||
PrivateTmp=yes
|
||||
NoNewPrivileges=yes
|
||||
ProtectSystem=full
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user