A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© 不二晨 金牌黑马   /  2018-8-17 10:02  /  908 人查看  /  2 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

方案一

Thanos

https://github.com/improbable-eng/thanos

部署要求:

prometheus v2.2.1 版本以上

go 1.10 以上版本

用户对象存储的数据库

安装thanos:



  • go get -v -d github.com/improbable-eng/thanos/..



  • cd ${GOPATH}/src/github.com/improbable-eng/thanos



  • make


Sidecars

thanos通过sidecar进程把多个prometheus实例整合起来。sidecar部署在和prometheus同台机器上或同个pod.

sidecar要求aprometheus版本在2.0以上。

sidecar负责备份数据到对象存储,并且查询prometheus实例。

启动



  • thanos sidecar \



  •     --prometheus.url    http://localhost:9090 \     # Prometheus's HTTP address



  •     --tsdb.path         /var/prometheus \           # Data directory of Prometheus



  •     --gcs.bucket        example-bucket \            # Bucket to upload data to


如果不想备份任何数据,在启动时去掉 --gcs.bucket 选项。

目前已经支持的两种存储:Google Cloud Storage, AWS S3

需要使用其他存储需要重写:https://github.com/improbable-eng/thanos/blob/master/pkg/objstore/objstore.go

查询

thanos各个组件之间通过高性能的grpc api进行交互。



  • thanos sidecar \



  •     --prometheus.url            http://localhost:9090 \



  •     --tsdb.path                 /var/prometheus \



  •     --gcs.bucket                example-bucket \



  •     --grpc-address              0.0.0.0:19091 \            # gRPC endpoint for Store API (will be used to perform PromQL queries)



  •     --http-address              0.0.0.0:19191 \            # HTTP endpoint for collecting metrics on Thanos sidecar



  •     --cluster.address           0.0.0.0:19391 \            # Endpoint used to meta data about the current node



  •     --cluster.advertise-address 127.0.0.1:19391 \          # Location at which the node advertise itself at to other members of the cluster



  •     --cluster.peers             127.0.0.1:19391 \          # Static cluster peer where the node will get info about the cluster


Query Layer

支持查询PromQL在多个prometheus实例。内部通过可容错的最终一致协议gossip实现。支持扩容和自动发现。



【转载】        https://blog.csdn.net/lr982330245/article/details/81736707


2 个回复

倒序浏览
奈斯
回复 使用道具 举报
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马