Skip to main content

Overview

When running multiple proxy instances (BungeeCord, Velocity, etc.), Redis enables automatic synchronization of maintenance status and whitelisted players across all connected proxies. This eliminates the need to manually update each proxy when making changes.

Why Use Redis?

Without Redis, each proxy instance maintains its own independent state:
  • Enabling maintenance on one proxy doesn’t affect others
  • Whitelisted players must be added to each proxy separately
  • Server-specific maintenance settings aren’t synchronized
With Redis enabled:
  • All proxies share the same maintenance status (global and per-server)
  • Whitelist changes are instantly synchronized across all proxies
  • Configuration changes propagate automatically

Redis Configuration

redis.enables
boolean
default:"false"
Enables Redis synchronization across multiple proxy instances.
Note the typo in the config key: enables instead of enabled. This is the actual key used in config.yml.
redis.uri
string
default:"redis://localhost:6379"
Redis connection URI. Must be properly formatted according to the Redis URI specification.
Ensure your Redis instance is properly secured with authentication and network restrictions.

Configuration Example

redis:
  enables: true
  uri: "redis://localhost:6379"

URI Format

The Redis URI follows this format:
redis[s]://[[username][:password]@][host][:port][/db-number]

URI Components

ComponentDescriptionRequiredExample
Protocolredis:// for standard connection, rediss:// for SSL/TLSYesredis:// or rediss://
UsernameRedis ACL username (Redis 6.0+)Nomyuser
PasswordRedis authentication passwordNomypassword
HostRedis server hostname or IP addressYeslocalhost, redis.example.com
PortRedis server portNo (defaults to 6379)6379
DatabaseRedis database numberNo (defaults to 0)0, 1, 2

URI Examples

Basic Local Connection

redis:
  enables: true
  uri: "redis://localhost:6379"

Password-Protected Redis

redis:
  enables: true
  uri: "redis://:mypassword@localhost:6379"

SSL/TLS Connection with Authentication

redis:
  enables: true
  uri: "rediss://user:[email protected]:6380"

Remote Redis with Custom Database

redis:
  enables: true
  uri: "redis://:[email protected]:6379/2"

Redis 6.0+ with ACL Username

redis:
  enables: true
  uri: "redis://maintenance-user:secure-password@localhost:6379/0"

Setting Up Redis

1. Install Redis

Ubuntu/Debian

sudo apt update
sudo apt install redis-server

CentOS/RHEL

sudo yum install redis

Docker

docker run -d --name redis -p 6379:6379 redis:latest

2. Secure Redis

Never expose Redis to the public internet without proper security measures. An unsecured Redis instance can be exploited.
Edit your Redis configuration file (usually /etc/redis/redis.conf):
# Set a strong password
requirepass your-strong-password-here

# Bind to specific IP addresses only
bind 127.0.0.1 10.0.0.100

# Disable dangerous commands
rename-command FLUSHDB ""
rename-command FLUSHALL ""
rename-command CONFIG ""
Restart Redis after making changes:
sudo systemctl restart redis

3. Configure Network Access

If your proxies are on different servers, configure firewall rules to allow Redis access:
# Allow Redis port from specific IP addresses
sudo ufw allow from 10.0.0.10 to any port 6379
sudo ufw allow from 10.0.0.11 to any port 6379

4. Update Plugin Configuration

On each proxy instance, update the configuration:
redis:
  enables: true
  uri: "redis://:[email protected]:6379"

5. Reload Plugin

Reload the plugin on each proxy:
/maintenance reload

What Gets Synchronized

When Redis is enabled, the following data is synchronized across all proxy instances:

Global Maintenance Status

# Enable maintenance on one proxy
/maintenance on

# All proxies instantly reflect maintenance mode

Server-Specific Maintenance

# Enable maintenance on specific server
/maintenance on server1

# All proxies know server1 is in maintenance

Whitelisted Players

# Add player on proxy 1
/maintenance add PlayerName

# PlayerName can now join through any proxy

Timer State

Active timers are synchronized:
# Start timer on proxy 1
/maintenance endtimer 1h

# All proxies show the same countdown

Multi-Proxy Setup Example

Let’s say you have 3 proxy instances:
  • Proxy 1: proxy1.example.com (10.0.0.10)
  • Proxy 2: proxy2.example.com (10.0.0.11)
  • Proxy 3: proxy3.example.com (10.0.0.12)
  • Redis Server: redis.example.com (10.0.0.100)

Redis Configuration

On the Redis server:
bind 0.0.0.0
requirepass SuperSecurePassword123
port 6379

Plugin Configuration

On all three proxies, use the same configuration:
redis:
  enables: true
  uri: "redis://:[email protected]:6379"

Workflow

  1. Enable maintenance on Proxy 1:
    /maintenance on
    
  2. All three proxies instantly enter maintenance mode
  3. Add a whitelisted player on Proxy 2:
    /maintenance add BuilderName
    
  4. BuilderName can join through any of the three proxies
  5. Disable maintenance on Proxy 3:
    /maintenance off
    
  6. All three proxies exit maintenance mode

Troubleshooting

Connection Issues

If proxies cannot connect to Redis:
  1. Verify Redis is running:
    redis-cli ping
    # Should return: PONG
    
  2. Test connectivity:
    redis-cli -h redis.example.com -p 6379 -a yourpassword ping
    
  3. Check firewall rules:
    sudo ufw status
    
  4. Review plugin logs for Redis connection errors

Authentication Errors

If you see authentication errors:
  1. Verify the password in your URI matches Redis configuration
  2. Check for special characters that need URL encoding
  3. Ensure the Redis user has appropriate permissions (Redis 6.0+)

Synchronization Delays

If changes don’t propagate instantly:
  1. Check network latency between proxies and Redis
  2. Verify all proxies are connected to the same Redis instance
  3. Ensure all proxies have Redis enabled in their config
  4. Try reloading the plugin: /maintenance reload

SSL/TLS Issues

If using rediss:// and experiencing connection problems:
  1. Verify Redis is configured with SSL/TLS support
  2. Check SSL certificate validity
  3. Ensure the Java version supports the SSL/TLS version used by Redis
  4. Try connecting without SSL first to isolate the issue

Performance Considerations

  • Redis synchronization adds minimal latency (typically less than 10ms on LAN)
  • The plugin uses pub/sub for real-time updates
  • Whitelist changes are batched to reduce network traffic
  • Redis memory usage is negligible (typically less than 1MB)

Security Best Practices

  1. Always use authentication: Set a strong requirepass in Redis
  2. Use SSL/TLS: Enable rediss:// for production environments
  3. Restrict network access: Use firewall rules to limit connections
  4. Use Redis ACLs: Create dedicated users with minimal permissions (Redis 6.0+)
  5. Regular updates: Keep Redis updated to the latest stable version
  6. Monitor access: Enable Redis logging and monitor for unauthorized access
For production environments, consider using Redis Sentinel or Redis Cluster for high availability.

Build docs developers (and LLMs) love