This error occurs when attempting to use Redis Cluster commands on a standalone Redis instance. Enable cluster mode in your redis.conf configuration file and restart the instance to resolve it.
Redis Cluster provides distributed data storage and automatic failover across multiple nodes. When you try to use cluster-specific commands (like CLUSTER, ASKING, or READONLY) on a non-clustered instance, Redis rejects the operation with this error. This typically happens when your application is configured for cluster mode but your Redis server is running as a standalone instance.
Connect to your Redis instance and verify the cluster setting:
redis-cli CONFIG GET cluster-enabledIf the response is (integer) 0, cluster mode is disabled.
Edit your redis.conf file and locate the cluster-enabled setting. Change it from no to yes:
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
appendonly yesThe cluster-config-file specifies where Redis stores cluster state. The cluster-node-timeout is the maximum milliseconds a node can be unavailable before failover.
Stop and restart Redis to apply the configuration changes:
# If using systemd
sudo systemctl restart redis
# If running manually
pkill -f redis-server
redis-server /path/to/redis.confIf you need an actual cluster, set up the minimum 3 master nodes and use redis-cli to initialize:
redis-cli --cluster create 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 --cluster-replicas 0For production, Redis recommends at least 6 nodes (3 masters + 3 replicas).
Ensure your Redis client is configured for cluster mode if needed. For example, in Node.js with ioredis:
const Redis = require("ioredis");
const cluster = new Redis.Cluster(
[
{ host: "127.0.0.1", port: 7000 },
{ host: "127.0.0.1", port: 7001 },
{ host: "127.0.0.1", port: 7002 },
],
{ enableReadyCheck: false }
);If you do not actually need cluster mode (single-instance Redis), you can safely ignore this error by disabling cluster mode in your client library. For example, in some Redis clients, set forceClusterMode: false or similar. AWS ElastiCache and other managed services have different cluster mode configurations—check your provider's documentation to enable cluster mode if required. Note that switching between cluster-enabled and disabled requires stopping Redis and reconfiguring, as it changes the internal data structure.
ERR Unbalanced XREAD list of streams
How to fix "ERR Unbalanced XREAD list" in Redis
ERR syntax error
How to fix "ERR syntax error" in Redis
ConnectionError: Error while reading from socket
ConnectionError: Error while reading from socket in redis-py
ERR unknown command
How to fix ERR unknown command in Redis
Command timed out
How to fix 'Command timed out' in ioredis