How to setup clustering

Hi there,

I found the clustering option in appsettings. changed it from development to MongoDB, and I now have a dashboard. (/orleans)

Question is now… how do I actually setup my second node to talk to the first? Can’t seem to find documentation on this, any help would be appreciated. :slight_smile:

(have a second small issue that I am hosting in a subfolder in iis, so the cluster config page points to /orleans and therefore does not work directly … does work if I change url manually)

The nodes write their address into a mongodb collection and they ping each other to see if they are ready and live.

Can you provide a PR for /orleans problem?

Wow! what a quick response, thank you :slight_smile:

Ok, so they both need to point to the same mongodb? (have mongo installed on the same server as the iis running squidex. so basically 2 servers with squidex and mongo. thinking orleans would do the syncing.

Yes, will do :slight_smile:

Ok, so they both need to point to the same mongodb? (have mongo installed on the same server as the iis running squidex. so basically 2 servers with squidex and mongo. thinking orleans would do the syncing.

No, it is not master<->master replication. I think clustering makes only sense if you have at least 7 servers

2x load balancer
2x IIS
3x mongoDB replica (you can co-host mongodb of course)

otherwise you will always have a single point of failure

I get that. to give you a bit more info on the current setup:

  • 2 servers on 2 different locations
  • load balancer in between that redirects user to either a or b
  • no way to put mongo on different server :frowning:

So we setup server a with squidex+mongo and server b with squidex+mongo
Now we want to make sure that they are ‘basically’ in sync with eachother.

What I gather from your response is that clustering isn’t the way to go. Any ideas/input on how to get our scenario to work though?

The problem is MongoDB. You need at least 3 members for leader election when a node goes down. You need at least another mini server with a mongodb arbiter installed: https://docs.mongodb.com/manual/tutorial/add-replica-set-arbiter/

Ah thanks. yes I see now. yikes.

so however I turn it… i need to have at least 2 nodes. or have just one and forget about replication/clustering completely

I meant atleast 3 ofcourse.