Skip to main content

Replicas that keep
the service and the data up.

Service and data replicas keep the service running during failures, spread across the nodes so that losing one node does not take down all the copies.

Replicas and replicated data​

Service and data replicas help keep the service running during failures.

The counts below are the initial values of the TDP charts, except for the example indicated for ClickHouse. Continuity also depends on the quorum, on replica synchronization, on the clients and on the distribution across failure domains.

Kafka

The chart defines the number of nodes with the broker and controller roles (nodePool.replicas), the default replication factor (config.default.replication.factor) and the minimum in-sync replicas (config.min.insync.replicas). Strimzi coordinates the restarts during updates. Availability depends on the quorum, on the in-sync replicas and on the topic and client settings.

Trino

Workers defined in tdp-trino.server.workers, with autoscaling. The workers ship with distribution across nodes, PodDisruptionBudget and graceful shutdown.

Ozone

Datanodes defined in tdp-ozone.datanode.replicas (default 3), distributed across the nodes.

ClickHouse

Shards and replicas can be declared in the ClickHouseInstallation, with coordination by ClickHouse Keeper. The chart includes a commented example of shards and replicas (shardsCount and replicasCount). This topology and Keeper must be enabled and configured.

NiFi

One node by default. Additional nodes are declared in nifiCluster.nodes.

Replicas in ClickHouse

Replication applies to tables created with the ReplicatedMergeTree engine or an equivalent one.

Shards distribute the data across nodes. Fault tolerance comes from the replicas.

Distribution across nodes​

Replicas spread across nodes, so that losing one node does not take down all copies.

Kubernetes offers three types of placement rule.

Topology spread spreads replicas across nodes or zones with a maximum difference between them.

Affinity and anti-affinity attract a Pod to certain nodes or keep it away from other Pods.

Tolerations and nodeSelector allow the use of nodes marked with taints or with specific labels.

Whoever installs the component defines these rules in the values file, according to the cluster topology.

Kafka and Trino

The TDP charts configure a preference for distribution across nodes, with maxSkew: 1 and ScheduleAnyway. The scheduler tries to balance brokers and workers, but may accept another distribution.

Ozone

Datanodes spread across the nodes by default, through anti-affinity and topology spread. Ozone Manager and SCM prefer nodes different from each other.

Airflow

nodeSelector, affinity, tolerations and topologySpreadConstraints available through configuration.

CloudBeaver, OpenMetadata, Superset and Ozone

nodeSelector, affinity and tolerations available through configuration. In Ozone, the rules can be defined for all Pods or for each service.

Kafka

nodePool.affinity and nodePool.tolerations available through configuration, to run the brokers on dedicated nodes.

Scenario: four Kafka brokers on three nodes​

Situation: a Kafka cluster with 4 brokers runs on 3 nodes.

Kafka places the replicas of a partition on different brokers, but not necessarily on different nodes.

What TDP does: the default rule of the chart spreads the brokers across the nodes as a preference, not as a requirement:

values.yaml (excerpt)
nodePool:
topologySpreadConstraints:
- maxSkew: 1 # e.g. 4 brokers on 3 nodes -> 2/1/1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway # never leaves a broker Pending
labelSelector:
matchLabels:
strimzi.io/cluster: "{{ .Values.name }}"
strimzi.io/kind: Kafka
strimzi.io/name: "{{ .Values.name }}-kafka"
affinity: {}
tolerations: []

Effect: the scheduler aims for the 2, 1 and 1 distribution. With whenUnsatisfiable: ScheduleAnyway, when the nodes do not have free resources for this distribution, the broker is scheduled anyway, in another distribution.

note

With node-local storage, each broker is bound to the node that holds its volume: the distribution applies to brokers and volumes created after the change.

Example of dedicated nodes for the brokers

See also​