惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Check Point Blog
IT之家
IT之家
V
Visual Studio Blog
The Cloudflare Blog
博客园 - 司徒正美
Jina AI
Jina AI
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
S
SegmentFault 最新的问题
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
T
Tailwind CSS Blog
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
博客园 - 三生石上(FineUI控件)
爱范儿
爱范儿
博客园 - Franky
Last Week in AI
Last Week in AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

陈少文的网站

巨变与机遇的未来十年 Kubernetes 平台管理软件压力测试方案 使用镜像部署 Hexo 静态页面 终于等到你 - GitHub 镜像仓库服务(ghcr.io) 一起来学 Go --(6)Interface 一起来学 Go --(5)Goroutine 和 Channel 什么是函数式编程 如何在 Kubernetes 集群集成 Kata 柯里化与偏函数 使用 PyGithub 自动创建 Label 软件产品是团队能力的输出 Helm 2 、Helm 3 比较 IoT 变现 Kubernetes 中的 DNS 服务 国内的 Helm 镜像源 Harbor 使用自签证书支持 Https 访问 DevOps 工具链之 Prow 如何使用 kfctl 安装 Kubeflow VS Code 无法下载 Go 插件的工具包 工程师更应具有服务精神 你不知道的 Docker 使用技巧 使用 Docker 运行 Tensorflow 论中国 什么是左移 如何清空 Git 仓库全部历史记录 一禅小和尚 有风吹过厨房 时间的玫瑰 如何在 CentOS 安装 GPU 驱动 开发 Tips(19)
二进制部署 Thanos
微信公众号 · 2022-05-12 · via 陈少文的网站

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 参数添加需要聚合的全部源。

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
[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

这里如果需要上传到对象存储还需要加上 --objstore.config-file /etc/thanos/bucket_config.yaml,指定对象存储相关的参数。

1
systemctl daemon-reload && systemctl enable thanos-sidecar
1
systemctl start thanos-sidecar && systemctl status thanos-sidecar