Skip to content

Document using Longhorn with self-replicating components - #387

Open
l4zy0n3 wants to merge 1 commit into
rancher:mainfrom
l4zy0n3:longhorn-ha-storage-docs
Open

Document using Longhorn with self-replicating components#387
l4zy0n3 wants to merge 1 commit into
rancher:mainfrom
l4zy0n3:longhorn-ha-storage-docs

Conversation

@l4zy0n3

@l4zy0n3 l4zy0n3 commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

What

Documents how to configure Longhorn for components that already replicate their own data at the application layer (Kafka, ZooKeeper, ClickHouse, HDFS DataNodes), to avoid doubling up on storage-level replication.

Why

These components already keep multiple copies of their data across nodes. Longhorn's default StorageClass also replicates each volume (3 copies by default), multiplying storage usage unnecessarily on top of the application's own copies.

Changes

  • New section Using Longhorn with self-replicating components in storage.adoc
  • Example single-replica, data-local Longhorn StorageClass (numberOfReplicas: 1, dataLocality: strict-local)
  • Per-component storageClass override example for the affected components
  • Caveats: strict-local is incompatible with RWX, and node drains hang indefinitely by default with a single replica unless Node Drain Policy is set to always-allow

@l4zy0n3
l4zy0n3 requested a review from a team as a code owner August 20, 2026 10:31
@netlify

netlify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploy Preview for suse-obs ready!

Name Link
🔨 Latest commit 1912e1e
🔍 Latest deploy log https://app.netlify.com/projects/suse-obs/deploys/6a86dca118c774000835fbec
😎 Deploy Preview https://deploy-preview-387--suse-obs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@l4zy0n3
l4zy0n3 force-pushed the longhorn-ha-storage-docs branch from c6823e8 to b007ebf Compare August 20, 2026 10:41
@l4zy0n3 l4zy0n3 changed the title Document reducing storage overhead on replicated storage backends Document node-drain caveat for single-replica storage classes Aug 20, 2026
@l4zy0n3
l4zy0n3 force-pushed the longhorn-ha-storage-docs branch from b007ebf to d9eeb3a Compare August 20, 2026 10:46
@l4zy0n3 l4zy0n3 changed the title Document node-drain caveat for single-replica storage classes Document using Longhorn with self-replicating components Aug 20, 2026
@l4zy0n3
l4zy0n3 force-pushed the longhorn-ha-storage-docs branch from d9eeb3a to cfbcf45 Compare August 20, 2026 10:49
Kafka, ZooKeeper, ClickHouse, and HDFS DataNodes already replicate
their data at the application layer. Longhorn's default StorageClass
also replicates each volume, multiplying storage usage on top of that.
Document a single-replica, data-local Longhorn StorageClass for these
components, the per-component override, and the caveats: strict-local
is incompatible with RWX, and node drains hang by default with only
one replica unless the Node Drain Policy is set to always-allow.
@l4zy0n3
l4zy0n3 force-pushed the longhorn-ha-storage-docs branch from cfbcf45 to 1912e1e Compare August 20, 2026 10:53

== Using Longhorn with self-replicating components

Kafka, ZooKeeper, ClickHouse, and HDFS DataNodes already replicate their data across pods/nodes at the application layer. If you run https://longhorn.io/[Longhorn] as your storage backend, its default StorageClass also replicates each volume (3 copies by default), multiplying storage usage on top of the application's own copies.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For elasticsearch we need a helm chart update I believe, right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also include that this applies to an HA deployment. For non-ha deployments we do not recommend this strict-local setup but instead we might want to recommend a storage class with only the default replica count set to 2 instead of 3.

We could actually suggest that also for all other PVCs in HA: use another custom storage class with replicaCount: "2" (instead of 3) by setting it as the global.storageClass. WDTY?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And we can include a link to Longhorn best practices:

See also Longhorn [IO Performance best practices](https://longhorn.io/docs/1.12.1/best-practices/#io-performance)


[NOTE]
====
`dataLocality: strict-local` is incompatible with `ReadWriteMany` volumes. Also, on Longhorn with `numberOfReplicas: 1`, draining that node hangs indefinitely by default -- set the https://longhorn.io/docs/latest/references/settings/#node-drain-policy[Node Drain Policy] to `always-allow` beforehand.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should include a little bit more I think:

Suggested change
`dataLocality: strict-local` is incompatible with `ReadWriteMany` volumes. Also, on Longhorn with `numberOfReplicas: 1`, draining that node hangs indefinitely by default -- set the https://longhorn.io/docs/latest/references/settings/#node-drain-policy[Node Drain Policy] to `always-allow` beforehand.
`dataLocality: strict-local` is incompatible with `ReadWriteMany` volumes. Also, on Longhorn with `numberOfReplicas: 1`, draining that node hangs indefinitely by default -- set the https://longhorn.io/docs/latest/references/settings/#node-drain-policy[Node Drain Policy] to `always-allow` beforehand.
When removing or replacing a node follow the [Longhorn documentation](https://longhorn.io/docs/1.12.1/nodes-and-volumes/nodes/graceful-node-removal/) to do this 1 node at a time only, and wait for the data replication on the database level to have completed. Without waiting for replication to finish data is likely to be lost.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should also make sure to know what to do when a node fails (and the disk is lost). Also documented by Longhorn: https://longhorn.io/docs/1.12.1/high-availability/node-failure/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants