docs/sources/get-started/hash-rings.md
Consistent hash rings are incorporated into Loki cluster architectures to
Hash rings connect instances of a single type of component when
Not all Loki components are connected by hash rings. These components need to be connected into a hash ring:
These components can optionally be connected into a hash ring:
In an architecture that has three distributors and three ingesters defined, the hash rings for these components connect the instances of same-type components.
Each node in the ring represents an instance of a component. Each node has a key-value store that holds communication information for each of the nodes in that ring. Nodes update the key-value store periodically to keep the contents consistent across all nodes. For each node, the key-value store holds:
Define ring configuration within the common.ring block.
Use the memberlist key-value store type unless there is
a compelling reason to use a different key-value store type.
memberlist uses a gossip protocol
to propagate information to all the nodes
to guarantee the eventual consistency of the key-value store contents.
There are additional configuration options for distributor rings,
ingester rings, and ruler rings.
These options are for advanced, specialized use only.
These options are defined within the distributor.ring block for distributors,
the ingester.lifecycler.ring block for ingesters,
and the ruler.ring block for rulers.
Distributors use the information in their key-value store to keep a count of the quantity of distributors in the distributor ring. The count further informs cluster limits.
Ingester ring information in the key-value stores is used by distributors. The information lets the distributors shard log lines, determining which ingester or set of ingesters a distributor sends log lines to.
Query schedulers use the information in their key-value store for service discovery of the schedulers. This allows queriers to connect to all available schedulers, and it allows schedulers to connect to all available query frontends, effectively creating a single queue that aids in balancing the query load.
Compactors use the information in the key-value store to identify a single compactor instance that will be responsible for compaction. The compactor is only enabled on the responsible instance, despite the compactor target being on multiple instances.
The ruler ring is used to determine which rulers evaluate which rule groups.
The index gateway ring is used to determine which gateway is responsible for which tenant's indexes when queried by rulers or queriers.