Understanding the Redis Cluster Bus and Node Communication
This article explains how Redis cluster nodes use a TCP-based gossip protocol and a dedicated cluster bus to discover each other, detect failures, synchronize configuration, and automatically redirect client commands to the correct node, illustrated with practical command‑line examples.
In a Redis cluster, each node stores data and also holds information about other nodes to map keys to the appropriate node.
The nodes can automatically discover each other, detect failed nodes, and promote replicas to masters.
All nodes connect to each other via a TCP bus using a binary protocol, known as the Redis Cluster Bus.
Each node establishes connections through the cluster bus and uses a gossip protocol for fault detection, node discovery, and configuration synchronization. Nodes periodically send their status to randomly selected peers, and through multiple propagations the entire cluster learns the overall state.
Thus, cluster information is not stored on a single node but continuously exchanged among nodes to keep the cluster state complete.
Because of the cluster bus, each node has a bus port, which defaults to the data port plus 10,000 (e.g., 16379).
Clients do not need to maintain cluster state; they connect to any node and the cluster redirects commands to the correct node.
Example demonstration:
127.0.0.1:7000> cluster keyslot fullstack (integer) 15274 127.0.0.1:7000> set fullstack good -> Redirected to slot [15274] located at 127.0.0.1:7002 OK
In this example, the client connects to node 7000, but the key fullstack belongs to slot 15274, which is not served by 7000, so the request is automatically redirected to node 7002.
Therefore, the client only needs to connect to any node, and the cluster handles the rest.
The author emphasizes that detailed technical understanding, rather than high‑level architecture diagrams, is crucial for development, maintenance, and interview preparation.
Future articles will cover Kafka, MySQL, Java, CI/CD, Docker, distributed transactions, AI, etc.
Note: The following command is claimed to show the cluster bus status, though it may not exist in current Redis versions:
redis-cli -h host -p port CLUSTER BUS LIST
The author acknowledges possible inaccuracies and advises not to over‑rely on AI for technical information.
Full-Stack Internet Architecture
Introducing full-stack Internet architecture technologies centered on Java
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.