Geo redundant

This may of been answered in a different thread or something close to it, but I was curious what the best way to have a geo redundant cluster would be. My idea is MySQL replication to the other instance running in a different datacenter but how do you avoid every process being duplicated? Would I just stop the n8n service on the standby machine and turn it on if needed?

For the moment you can only run a single main instance to avoid double scheduling etc.
So you’d need to script or manually run a failover of the main node. However you can run as many webhook and worker nodes as you desire.

1 Like

Kinda what I assumed, thanks! I may keep the second instance in a stopped state and start it if needed, the mysql sync does work well though.

I had the same problem than you and I wanted to do a VIP with active / passive server and when one goes down the keepalived activate the passive into active.

Of course, the synchronisation of the database between both server had to be in place.

What do you think, is that configuration can work ?

im going to have the second instance in a stopped state and bring it up manually. But the database replication seemed to be instant.

1 Like

@Kent1 @bschnitker

I assume you’re both using queue mode? How are you planning to do HA Redis?

My current deployment is attempting to be HA across two datacentres where main, webhook, and worker nodes can connect to either site.

That is a leader-follower Postgres cluster with repmgr and a pgpool per-site that each site will use to point to the currently active member. It also has a repmgr witness server running at a 3rd site for quorum. This works, n8n components don’t need to be cluster aware. :+1:

As for redis, I can’t see a way to have a sentinel/cluster and failover seamlessly between. Any ideas?

The only workable solution for me was to make n8n itself support sentinel (relatively small change)… you can see that here ✨ Add Redis Sentinel support by pemontto · Pull Request #5350 · n8n-io/n8n · GitHub

We dont have a big enough workload for redis or queue mode just yet.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.