Failover / Multiple Instances of n8n in different datacenters

Describe the issue/error/question

We are leaning on n8n more and more (it’s a fantastic product) but we want to make sure we have high availability in the event a server or datacenter goes down.

Ideally, we’d like to have an instance of n8n running in two of the datacenters we have a presence in. Right now, we run in regular mode but we may run n8n in queue mode as the demand grows.

Our current idea is just to do MySQL replication between our main instance and the backup instance. The other instance would not have n8n running (we use pm2) but would have the environment config set up and ready in the event we need to failover to it. That way all we would need to do is start n8n on the failover instance and update DNS in the event of an outage.

Is this a feasible way to replicate data and provide some failover ability? Any caveats that we should be aware of?

Thanks in advance,

Hey @jhambach,

That will do the job, There could be issues with binary data if using the file mode and if you are running in queue mode you also have the Redis component to think about as well.

Oddly I think this same sort of question has come up 3 or 4 times this week which is good to see and might mean we should create some documentation on it and give it a test.

1 Like

Appreciate the feedback Jon! How can I tell what mode I’m using for files? Should we set N8N_DEFAULT_BINARY_DATA_MODE to filesystem?

The filesystem method might be better and you could replicate that as well although chances are if you are downloading files and the workflow fails you would need to rerun the workflow anyway.

1 Like

I think we’ll change that to filesystem and see how that works. As always, thanks for all of your help @Jon !

1 Like

in full transparency we work together we are just exploring 2 different approaches to it.

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