How to fix ERR This instance is not in cluster mode in Redis
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.
Quick fix
Fixes ERR This instance is not in cluster mode
redis-cli CONFIG GET cluster-enabled- Check the current Redis configuration
- Enable cluster mode in redis.conf
- Restart the Redis instance
- Create a cluster with multiple nodes (optional)
redis-cli CONFIG GET cluster-enabledERR This instance is not in cluster mode
What this error means
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.
Typical symptoms
- CLUSTER commands fail with "ERR This instance is not in cluster mode"
- Application crashes when attempting cluster-aware operations
- Client libraries expecting cluster support receive connection errors
- Deployment scripts fail when initializing cluster topology
Common causes
- The redis.conf file does not have "cluster-enabled yes" configured
- Redis instance was started before cluster-enabled was set in configuration
- Incorrect Redis version deployed (cluster mode requires Redis 3.0+)
- Connection is pointing to a standalone replica in a cluster topology
- Using a managed Redis service (ElastiCache, Redis Cloud) that does not have cluster mode enabled
How to fix "ERR This instance is not in cluster mode"
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 }
);Advanced notes
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.
Frequently asked questions
- What does "ERR This instance is not in cluster mode" mean?
- 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.
- How do I fix "ERR This instance is not in cluster mode"?
- 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.
- What causes "ERR This instance is not in cluster mode"?
- The redis.conf file does not have "cluster-enabled yes" configured Redis instance was started before cluster-enabled was set in configuration Incorrect Redis version deployed (cluster mode requires Redis 3.0+)
- Is the "ERR This instance is not in cluster mode" error serious?
- It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- 📚Redis Official Documentation
- 📖Redis Docs - Scale with Redis Cluster(Official Docs)
- 📖Redis Cluster Specification(Official Docs)
- 📖AWS - Redis Cluster Modes(Official Docs)