How Cluster nextcloud 18

I try to cluster nextcloud server but I didn’t find proper document
Nextcloud version _(18.0.2)
Operating system and version _(centos 7)
I think next cloud server is stateful application and working with session , so how can scale it with HAproxy ?
the only document I can find was for next cloud 12
https://docs.nextcloud.com/server/12.0/admin_manual/operations/scaling_multiple_machines.html Clustering nextcloud 18

a bit old but maybe helpful for you:

This is an enterprise setting so you should talk to nextcloud directly.

Off the top of my head:

Primary storage being S3 or a shared FS such as CephFS;
2+ http/PHP servers
1 MySQL server - or if you can figure out how to make it work with more kudos to you.
2+ HAProxy servers (cache mirrors)

Although if you’re in this position I’d hope you can hire someone to do this for you, unless it’s casual experimenting in your homelab.

I am actually planning to set up a small cluster with a Pine64 Clusterboard soon.

Traefik with round robin load balancing should do the trick as well I think.

In addition there is a setting for local and distributed caching and file locking, so you can have one Redis server for distributed caching as well.

As for the database, I’ll probably start with one as that seems easiest, but I think with Postgres you can have a multi-master setup? Or maybe CoachroachDB might work?
Edit: Apparently this works with Nextcloud: https://galeracluster.com/

For S3 object storage it might be nice to try SeeweedFS. Otherwise, OpenIO or MinIO seem like good options.

Judging from this it might be still necessary to run Ldap for user accounts:

Or maybe there is a way to share php session storage? Edit: hmm, apparently Redis can do that?