Back to articles
AI & Cloud

Guide to Deploying n8n Advanced Queue Mode with Redis Sentinel on 3-Cloud-Server Cluster for Cost Efficiency

A detailed guide on deploying n8n with Advanced Queue Mode using Redis Sentinel on a 3-server cloud cluster, ensuring high availability and performance for automation workflows.

DPTCloud Engineering4 min read
Guide to Deploying n8n Advanced Queue Mode with Redis Sentinel on 3-Cloud-Server Cluster for Cost Efficiency

Image credit: ClickerHappy · Pixabay Content License

Introduction to n8n and Advanced Queue Mode

n8n is an open-source automation workflow platform that enables users to create automated processes between various applications and services. With Advanced Queue Mode, n8n supports task processing through a queue system, ensuring consistency and scalability as the number of tasks increases. To deploy this mode in a production environment, using Redis Sentinel ensures high availability and automatic failover in case of failures.

System Requirements and Prerequisites

To deploy n8n with Advanced Queue Mode on a 3-server cloud cluster, you need:

  • 3 Cloud servers (VPS or Dedicated Server) with at least 4GB RAM.
  • Operating system: Ubuntu 20.04/22.04.
  • Redis 6.x or higher installed on all servers.
  • Redis Sentinel configured for monitoring and automatic failover.
  • Node.js 16.x or higher.
  • SSH access and root or sudo privileges.

Deploying Redis Sentinel on a 3-Server Cluster

Redis Sentinel is a monitoring and management system for Redis that ensures high availability by automatically failing over to a slave if the master fails. Below is a basic configuration:

# On each server, install Redis
sudo apt update
sudo apt install redis-server -y

# Configure Redis Sentinel (create file /etc/redis/redis-sentinel.conf)
cat < /etc/redis/redis-sentinel.conf
port 26379
dir /var/lib/redis
daemonize yes
sentinel monitor mymaster 192.168.1.10 6379 2
sentinel down-after-milliseconds mymaster 5000
sentinel failover-timeout mymaster 10000
sentinel parallel-syncs mymaster 1
EOF

# Start Redis Sentinel
sudo systemctl restart redis-server
sudo systemctl enable redis-server

Deploying n8n with Advanced Queue Mode

Using Redis Sentinel as the queue, n8n can efficiently process automation tasks. Configure n8n using environment variables:

# Install n8n
npm install -g n8n

# Start n8n with Advanced Queue Mode
n8n start --queue-mode advanced --queue-redis-host 192.168.1.10 --queue-redis-port 6379 --queue-redis-sentinel-enabled true --queue-redis-sentinel-master-name mymaster

Verification and Testing

To verify the system's availability:

  • Access the n8n interface via browser: http://:5678
  • Run a simple workflow to test queue functionality.
  • Simulate a master Redis server failure to check if Sentinel automatically fails over to a slave.

Troubleshooting

If you encounter issues:

  • Redis Sentinel fails to start: Check the configuration file and permissions.
  • n8n cannot connect to Redis: Verify network connectivity and Redis port.
  • Workflows do not run: Check n8n and Redis logs for errors.

References

Related infrastructure & engineering guides: High-RAM Cloud VPS for Self-Hosted LLMs & API Gateways

DPTCloud Tier III Infrastructure

High-RAM Cloud VPS Plans Optimized for AI, Databases & Cache

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02Recommended

VPS-4E

297.000 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe
ECO · vn-02

VPS-5E

614.900 ₫ / mo

10% VAT included

  • CPU: 8 vCPU
  • RAM: 16 GB
  • SSD: 100 GB NVMe
ADVANCED · vn-03Recommended

VPS-4T

548.900 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478