How to setup clustering?


#1

According to https://pimcore.com/docs/5.x/Development_Documentation/Installation_and_Upgrade/System_Setup_and_Hosting/Cluster_Setup.html I have to mount web/var and var to a shared file system.

What is the correct way to do that?

I imagine on App1 I can…
1-mount web/var and var to NFS.
2-run COMPOSER_MEMORY_LIMIT=3G composer create-project --no-dev pimcore/demo-basic pimcore
3-./vendor/bin/pimcore-install

Then on App2…
1-mount web/var and var to NFS.
2-Problem: I can’t run the create project again
3-Problem: I can’t run install again either

What is the right way to do this?


#2

I made a Dockerfile that seems to work when deployed as a statefulset in Kubernetes.

During build time I move web/var and var.
Then on startup I mount the remote filesystem and rsync them back.
Also I symlink temp files(logs, caches, tmp) to local fs.

Using the Kubernetes postStartup hook I check and run the pimcore-install.
The install should only have once.
I will have to figure out how to do upgrades later.