二进制部署 Thanos

1. 下载二进制文件

1
2
3
4
wget https://github.com/thanos-io/thanos/releases/download/v0.26.0/thanos-0.26.0.linux-amd64.tar.gz
tar xvf thanos-0.26.0.linux-amd64.tar.gz
mv thanos-0.26.0.linux-amd64/thanos /usr/bin/
rm -rf thanos-0.26.0.linux-amd64*

2. 安装 Thanos Query

1
vim /etc/systemd/system/thanos-query.service
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
[Unit]
Description=Thanos Query
After=network-online.target

[Service]
Restart=on-failure
ExecStart=/usr/bin/thanos query \
    --log.level=debug \
    --query.auto-downsampling \
    --grpc-address=0.0.0.0:30091 \
    --http-address=0.0.0.0:30092 \
    --query.partial-response \
    --query.replica-label=prometheus_replica \
    --query.replica-label=rule_replica  \
    --store=1.0.0.0:30091 \
    --store=2.0.0.0:30091

[Install]
WantedBy=multi-user.target

--store 参数添加需要聚合的全部源。

相关推荐

站点声明:本站部分内容转载自网络,作品版权归原作者及来源网站所有,任何内容转载、商业用途等均须联系原作者并注明来源。

相关侵权、举报、投诉及建议等,请发邮件至E-mail:service@mryunwei.com

回到顶部
1
systemctl daemon-reload && systemctl enable thanos-query
systemctl start thanos-query && systemctl status thanos-query
vim /etc/systemd/system/thanos-sidecar.service
[Unit]
Description=Thanos SideCar
After=network-online.target

[Service]
Restart=on-failure
ExecStart=/usr/bin/thanos sidecar \
    --grpc-address=0.0.0.0:30091 \
    --tsdb.path /var/lib/prometheus \
    --prometheus.url "http://localhost:9090"

[Install]
WantedBy=multi-user.target
systemctl daemon-reload && systemctl enable thanos-sidecar
systemctl start thanos-sidecar && systemctl status thanos-sidecar