首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >裸金属上的Thanos

裸金属上的Thanos
EN

Stack Overflow用户
提问于 2019-06-28 21:13:15
回答 2查看 881关注 0票数 1

我现在有普罗米修斯安装裸金属和运行作为码头集装箱。我使用同样的方法来监视我们的基础设施以及Kubernetes集群。

为了设置HA,我试图在2个Prometheus实例之前部署代理或查询程序。我的第一个目标是尝试萨诺斯。但我没有发现太多关于裸金属使用的文件或信息。所有的文档都在库伯内特斯上实现萨诺斯。

有人在裸露的金属上试过萨诺斯吗?

更新:

我使用docker来旋转sidecar和查询组件:

代码语言:javascript
复制
thanos-sidecar:
  image: improbable/thanos:v0.5.0
  restart: always
  volumes:
    - tsdb-vol:/prometheus
  command: ['sidecar', '--tsdb.path="/prometheus"', '--prometheus.url=http://metrics_prometheus_1:9090' ]
  ports:
    - '10902:10902'
    - '10901:10901'
  depends_on:
  - Prometheus
  network:
    - thanos


thanos-querier:
  image: improbable/thanos:v0.5.0
  logging:
  # limit logs retained on host to 25MB
    driver: "json-file"
    options:
      max-size: "500k"
      max-file: "50"
  restart: always
  command: ['query' , '--http-address=0.0.0.0:19192' , '--query.replica-label=replica' , '--store=metrics_thanos-sidecar_1:10901', '--store=172.XX.XX.XXX:10901']
  ports:
    - '19192:19192'
  depends_on:
  - thanos-sidecar
  network:
    - thanos

我已经在10901公开了商店API的gRPC端口,但是仍然无法到达它们。旁白里还有什么东西不见了吗?

EN

回答 2

Stack Overflow用户

发布于 2019-06-29 00:39:48

这和在库伯奈特跑没那么大的区别。are K8s清单文件这里,但是您应该能够在容器中或容器之外分别运行每个组件。

例如,存储API

代码语言:javascript
复制
thanos sidecar \
    --tsdb.path                 /var/prometheus \
    --objstore.config-file      bucket_config.yaml \       # Bucket config file to send data to
    --prometheus.url            http://localhost:9090 \    # Location of the Prometheus HTTP server
    --http-address              0.0.0.0:19191 \            # HTTP endpoint for collecting metrics on the Sidecar
    --grpc-address              0.0.0.0:19090              # GRPC endpoint for StoreAPI

查询网关

代码语言:javascript
复制
thanos query \
    --http-address 0.0.0.0:19192 \                                # HTTP Endpoint for Query UI
    --store        1.2.3.4:19090 \                                # Static gRPC Store API Address for the query node to query
    --store        1.2.3.5:19090 \                                # Also repeatable
    --store        dnssrv+_grpc._tcp.thanos-store.monitoring.svc  # Supports DNS A & SRV records

压路机

代码语言:javascript
复制
thanos compact \
    --data-dir             /var/thanos/compact \  # Temporary workspace for data processing
    --objstore.config-file bucket_config.yaml \   # Bucket where to apply the compacting
    --http-address         0.0.0.0:19191          # HTTP endpoint for collecting metrics on the Compactor)

尺子

代码语言:javascript
复制
thanos rule \
    --data-dir             "/path/to/data" \
    --eval-interval        "30s" \
    --rule-file            "/path/to/rules/*.rules.yaml" \
    --alert.query-url      "http://0.0.0.0:9090" \ # This tells what query URL to link to in UI.
    --alertmanagers.url    "alert.thanos.io" \
    --query                "query.example.org" \
    --query                "query2.example.org" \
    --objstore.config-file "bucket.yml" \
    --label                'monitor_cluster="cluster1"'
    --label                'replica="A"

Thanos是一个二进制文件,所以它可以在大多数支持目标的系统上运行。

票数 2
EN

Stack Overflow用户

发布于 2019-07-08 20:36:11

需要注意的

  1. Docker-compose名称解析不适用于默认网络。因此必须为所有Thanos组件创建一个显式网络。
  2. 我们不需要在商店网址上注明http。这就是为什么Thanos查询无法与远程.store API连接的问题。

现在,一切正常!!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56813233

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档