funwithlinux blog

How to Fix Redis 'This instance has cluster support disabled' Error in WSL: Enable Cluster Support Guide

Redis Cluster is a powerful feature that allows you to shard data across multiple Redis nodes, enabling high availability and scalability. However, if you’ve encountered the error message "This instance has cluster support disabled" while working with Redis in Windows Subsystem for Linux (WSL), don’t worry—this guide will walk you through resolving it step-by-step.

This error occurs when Redis is running in non-cluster mode, meaning it cannot process cluster-specific commands (e.g., CLUSTER INFO, CLUSTER NODES). By the end of this tutorial, you’ll enable cluster support in Redis on WSL, ensuring seamless cluster operations.

2025-12

Table of Contents#

  1. Understanding the "Cluster Support Disabled" Error
  2. Prerequisites
  3. Step-by-Step Guide to Enable Cluster Support
  4. Troubleshooting Common Issues
  5. Conclusion
  6. References

1. Understanding the "Cluster Support Disabled" Error#

Redis Cluster is disabled by default in Redis configurations. The error "This instance has cluster support disabled" appears when you attempt to run cluster-related commands (e.g., CLUSTER INFO) on a Redis instance that hasn’t been configured to support clusters.

For example, running redis-cli CLUSTER INFO on a default Redis setup will return:

(error) CLUSTERDOWN Hash slot not served  

Or directly indicate that cluster support is disabled.

To resolve this, you need to explicitly enable cluster mode in Redis’s configuration file and restart the service.

2. Prerequisites#

Before proceeding, ensure you have the following:

  • WSL Installed: You need Windows Subsystem for Linux (WSL 1 or 2) with a Linux distribution (e.g., Ubuntu) installed. If not, follow Microsoft’s WSL Installation Guide.
  • Redis Installed in WSL: Redis must be installed on your WSL distribution. If not, install it via:
    sudo apt update && sudo apt install redis-server -y  
  • Basic Linux Skills: Familiarity with terminal commands (e.g., nano, sudo, systemctl).

3. Step-by-Step Guide to Enable Cluster Support#

3.1 Verify Redis Installation and Cluster Status#

First, confirm Redis is running and check if cluster support is disabled:

  1. Connect to Redis using the command-line interface (CLI):

    redis-cli  
  2. Run the CLUSTER INFO command to check cluster status:

    127.0.0.1:6379> CLUSTER INFO  

    If cluster support is disabled, you’ll see output like:

    cluster_enabled:0  
    

    (Or an error indicating cluster support is off.)

    Exit the Redis CLI with QUIT.

3.2 Locate the Redis Configuration File#

Redis stores its settings in a configuration file (redis.conf). The location depends on how you installed Redis:

  • Installed via APT (Package Manager): The default path is /etc/redis/redis.conf.
  • Installed from Source: If you compiled Redis from source, the config file is typically in /usr/local/etc/redis.conf or the directory where you built Redis.

To confirm the path, check Redis’s service status:

sudo systemctl status redis-server  

Look for a line like Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled), which may reference the config file path.

Alternatively, search for the file:

sudo find / -name "redis.conf" 2>/dev/null  

3.3 Edit the Configuration File to Enable Cluster Mode#

Once you’ve located redis.conf, edit it to enable cluster support. We’ll use nano (a simple text editor) for this example:

  1. Open the config file with sudo privileges (required to modify system files):

    sudo nano /etc/redis/redis.conf  
  2. Backup the config file (optional but recommended):
    Before editing, create a backup to revert to if needed:

    sudo cp /etc/redis/redis.conf /etc/redis/redis.conf.bak  
  3. Enable cluster mode:
    In the redis.conf file, search for the cluster-enabled directive (use Ctrl+W in nano to search). By default, it’s set to no:

    # cluster-enabled yes  
    cluster-enabled no  

    Uncomment the line (remove # if present) and change no to yes:

    cluster-enabled yes  
  4. Configure cluster辅助 settings (optional but recommended):

    • cluster-config-file nodes.conf: Specifies the path to the cluster configuration file (auto-generated by Redis, stores node metadata). Default: nodes.conf (relative to Redis’s working directory).
    • cluster-node-timeout 5000: Timeout (in milliseconds) for node communication. Default: 5000 (5 seconds).

    Ensure these lines are uncommented and set correctly:

    cluster-config-file nodes.conf  
    cluster-node-timeout 5000  
  5. Save and exit:
    In nano, press Ctrl+O to save, Enter to confirm the filename, and Ctrl+X to exit.

3.4 Restart Redis to Apply Changes#

After editing the config file, restart the Redis service to apply the new settings. Use one of the following commands (depending on your WSL setup):

  • If using systemd (most modern WSL 2 setups):

    sudo systemctl restart redis-server  
  • If systemd is not enabled (older WSL or some distributions):

    sudo service redis-server restart  

Verify Redis is running:

sudo systemctl status redis-server  

You should see active (running) in the output.

3.5 Verify Cluster Support is Enabled#

Finally, confirm cluster support is now enabled:

  1. Connect to Redis CLI again:

    redis-cli  
  2. Run CLUSTER INFO:

    127.0.0.1:6379> CLUSTER INFO  

    You should see cluster_enabled:1 in the output, indicating cluster support is active:

    cluster_state:fail  
    cluster_slots_assigned:0  
    cluster_slots_ok:0  
    cluster_slots_pfail:0  
    cluster_slots_fail:0  
    cluster_known_nodes:1  
    cluster_size:0  
    cluster_current_epoch:0  
    cluster_my_epoch:0  
    cluster_stats_messages_ping_sent:0  
    cluster_stats_messages_pong_sent:0  
    cluster_stats_messages_sent:0  
    cluster_stats_messages_ping_received:0  
    cluster_stats_messages_pong_received:0  
    cluster_stats_messages_meet_received:0  
    cluster_stats_messages_received:0  
    cluster_enabled:1  # <-- This confirms cluster support is enabled  
    

    Note: cluster_state:fail is normal here—this just means no cluster is fully configured yet (you’ll need to add more nodes to form a functional cluster).

4. Troubleshooting Common Issues#

"redis.conf not found"#

  • Cause: Redis may be installed from source (not via apt). Check /usr/local/etc/redis.conf or the directory where you compiled Redis.
  • Fix: Reinstall Redis via apt for easier configuration management:
    sudo apt purge redis-server && sudo apt install redis-server -y  

"Permission denied" when editing redis.conf#

  • Cause: You forgot to use sudo to edit the system config file.
  • Fix: Use sudo when opening the file:
    sudo nano /etc/redis/redis.conf  

Redis fails to restart#

  • Cause: Invalid configuration (e.g., typos in redis.conf).
  • Fix: Check Redis logs for errors:
    sudo tail -f /var/log/redis/redis-server.log  
    Common issues: Misspelled directives (e.g., cluster-enable instead of cluster-enabled) or invalid values.

"cluster-config-file nodes.conf: Permission denied"#

  • Cause: Redis cannot write to nodes.conf (specified in cluster-config-file).
  • Fix: Ensure the Redis user (usually redis) has write permissions to the directory. For example:
    sudo chown -R redis:redis /var/lib/redis/  # Default data directory  

5. Conclusion#

Enabling Redis Cluster support in WSL is straightforward: locate the redis.conf file, set cluster-enabled yes, and restart Redis. This resolves the "cluster support disabled" error and unlocks Redis Cluster functionality for sharding and high availability.

Remember, enabling cluster mode on a single node is just the first step—you’ll need to add more nodes (masters and replicas) to create a fully functional cluster. For that, refer to the Redis Cluster Setup Guide.

6. References#