prometheus-operator: shards(分片)和 replicas(副本)之间有什么区别?

huangapple go评论50阅读模式
英文:

prometheus-operator: what is the difference between shards and replicas?

问题

replicasshards 之间的区别是什么?

英文:

The following manifest creates a Prometheus server with two replicas and two shards:

apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
  labels:
    prometheus: prometheus
  name: prometheus
  namespace: default
spec:
  serviceAccountName: prometheus
  replicas: 2
  shards: 2
  serviceMonitorSelector:
    matchLabels:
      team: frontend

What is the difference between replicas and shards?

答案1

得分: 2

在Prometheus中,Sharding涉及将指标分割到多个服务器上,以提高性能(特别是查询性能)和可伸缩性。每个分片负责收集和存储总指标的子集。

Replication涉及在多个服务器上创建数据的多个副本,以增加可用性和容错性。每个副本包含数据的完整副本,对一个副本进行的任何更改最终都会传播到其他副本。

这对于任何应用程序都是适用的 - 分片和复制是用来描述这一概念的通用概念,而不是Prometheus特有的内容。这在数据库中被广泛使用。

英文:

Sharding in Prometheus involves splitting the metrics across multiple servers, to improve performance (especially query performance) and scalability. Each shard is responsible for collecting and storing a subset of the total metrics.

Replication involves creating multiple copies of the data across multiple servers, to increase availability and fault tolerance. Each replica contains a full copy of the data, and any changes made to one replica are eventually propagated to the others.

This is true for any app - shard and replication are generic concepts used to describe this and not something specific to prometheus. This is widely used in Databases.

huangapple
  • 本文由 发表于 2023年2月16日 17:27:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/75470182.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定