Please enable Javascript to view the contents

二进制部署 Thanos

 ·  ☕ 1 分钟

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
[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=0.0.0.0:30091

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

3. 安装 Thanos Sidecar

1
vim /etc/systemd/system/thanos-sidecar.service
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
[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" \
    --objstore.config-file /etc/thanos/bucket_config.yaml

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

微信公众号
作者
微信公众号