Kubernetes 裸金属上的塔诺斯
我目前已经让普罗米修斯安装了裸机,并作为码头集装箱运行。我使用同样的方法来监控我们的基础设施以及Kubernetes集群 为了使这个设置透明,我尝试在2个Prometheus实例前面部署一个代理或查询器。我的第一个目标是尝试塔诺斯。但我没有找到太多关于裸机使用的文档或信息。这些文档都是关于Thanos在Kubernetes上的实现的 有人在裸机上试过Thanos吗 更新: 我使用docker compose启动sidecar并查询组件:Kubernetes 裸金属上的塔诺斯,kubernetes,prometheus,Kubernetes,Prometheus,我目前已经让普罗米修斯安装了裸机,并作为码头集装箱运行。我使用同样的方法来监控我们的基础设施以及Kubernetes集群 为了使这个设置透明,我尝试在2个Prometheus实例前面部署一个代理或查询器。我的第一个目标是尝试塔诺斯。但我没有找到太多关于裸机使用的文档或信息。这些文档都是关于Thanos在Kubernetes上的实现的 有人在裸机上试过Thanos吗 更新: 我使用docker compose启动sidecar并查询组件: thanos-sidecar: image: impr
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端口,但塔诺斯查询器仍然无法访问它们。sidecar配置中还缺少什么吗?它应该与在Kubernetes中运行没有太大区别。这些是K8s清单文件,但您应该能够在容器内或容器外分别运行每个组件 例如: 或 或 或
Thanos是一个二进制文件,因此它可以在大多数Go支持的系统上运行。需要注意的是:
现在,一切正常 我使用docker compose在我们的裸机服务器上运行thanos。我已经用细节更新了帖子。是否还需要向sidecar添加任何其他内容以公开gRPC端口?不需要,只需要gRPC服务器正在侦听的标准tcp端口。
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
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
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)
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"