Back

[CLOSED] Kubernetes (And swarm) Cluster Configuration

  • 1
  • Databases
  • Web
  • Self Hosted
Hexi
18 Jul, 2023, 11:26

I was wondering if it would be possible to cluster multiple instances of Appwrite and load balancing them and having the SQL/Database itself on one of those cluster so there is 1 database but multiple instances of appwrite

TL;DR
The user wants to cluster multiple instances of Appwrite and load balance them using Kubernetes or Swarm. The solution is to create one master node with the database and set the server IP as the endpoint for other nodes. Mounting the storage and accessing it through SSH is also necessary. There is a guide on decentralization available. It is possible to use ARM, but it is not necessary. Google buckets can be used as an alternative. Multiple managers can be used in the cluster, but the swarm requires a majority to roll an update. An issue with the .env file can be resolved by removing the x-logging part. There is also an
Binyamin
18 Jul, 2023, 12:50

Yes you can This called decentralization and I'm planning to write about it here https://appwrite.bool-code.org/guide/decentralization

For now you'll need the way to go is to create one master node (with the DB) and in all other nodes put that server IP as the databases (mariadb, influxdb, redis) endpoint.

Also, you'll need to mount the storage as bind and let other nodes access it using ssh, for example

TypeScript
 appwrite-uploads:
  driver: local
  driver_opts:
   o: "bind"
   device: "/nfs/appwrite-uploads"
Drake
19 Jul, 2023, 00:14
Hexi
19 Jul, 2023, 06:38

Are only arm computers supported?

Hexi
19 Jul, 2023, 06:39

Because my whole cluster runs on Ryzen and Intel...

Olivier Pavie
19 Jul, 2023, 07:27

@Binyamin are you using docusaurus for creating that Appwrite book ? or something else?

Binyamin
19 Jul, 2023, 12:14

From what I know the ARM is only necessary to br able to follow the tutorial.

Hexi
19 Jul, 2023, 12:15

Oh alright I will do another aprouch anyways: Google buckets

Binyamin
19 Jul, 2023, 12:15

It's Vue's VitePress with some custom-made components https://vitepress.dev/

Hexi
19 Jul, 2023, 12:15

so we can have multiple managers in our cluster and so if 1 is down then it will still operate as normal

Binyamin
19 Jul, 2023, 12:17

Yes. And the swarm will keep run as long as you have a running manager.

But if you nees to roll an update you need to have the majority.

Hexi
19 Jul, 2023, 15:15

ehm?

Hexi
19 Jul, 2023, 15:15

am I missing something

Hexi
19 Jul, 2023, 15:15
Hexi
19 Jul, 2023, 15:21

ah forgot the .env file but now i get this issue

Binyamin
19 Jul, 2023, 15:22

Remove all the x-logging part From the beginning of the file and inside each service.

Hexi
19 Jul, 2023, 15:23

Yeah was already trying that, but thanks

Hexi
19 Jul, 2023, 15:23

hope it will work now

Hexi
19 Jul, 2023, 15:23

Now it goes to this chaching folder

Binyamin
19 Jul, 2023, 15:25

Is the caching folder exists?

Hexi
19 Jul, 2023, 15:25
Hexi
19 Jul, 2023, 15:25
Binyamin
19 Jul, 2023, 15:26

Also, I'll write it like so

TypeScript
 appwrite-cache:
  driver: local
  driver_opts:
   o: "bind"
   device: "/root/mount-folder/appwrite/cache"

You can try it.

Hexi
19 Jul, 2023, 15:26

Ah alright will do that soon. (gotta go for a few min)

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more