クラスタリングは複数のRabbitMQノードを単一の論理的なブローカーに接続します — スケーラビリティと(レプリケートされたキューを使用した場合の)高可用性のために。クラスタリングとその微妙な点を理解することは、RabbitMQを確実にスケーリング・運用するために重要です。
クラスタとは
A RabbitMQ CLUSTER = multiple nodes acting as ONE logical broker:
→ nodes share METADATA (queue/exchange definitions, bindings, users, vhosts) across the cluster
→ clients can connect to any node; load is distributed across nodes
→ scales connection/channel capacity and distributes load
クラスタ内のキュー(重要な微妙な点)
⚠️ By default, a queue's DATA lives on ONE node (the node where it was declared):
→ other nodes know about the queue (metadata) but route to the owning node
→ if that node FAILS → the queue (and its messages) is UNAVAILABLE
→ so CLUSTERING ALONE does NOT make queues highly available!
→ for HA → use REPLICATED queues (QUORUM QUEUES) that replicate data across nodes
