Skip to main content

Cluster Configuration

YedMQ supports clustering to provide high availability and scalability. This section describes how to configure cluster nodes and communication.

[cluster]
cluster_name = "YedMQ"
node_id = 1001
heartbeat_interval = 10
store_dir = "./store"
session_ttl = 10

[[cluster.nodes]]
id = 1001
rpc_address = "127.0.0.1:3457"
api_address = "127.0.0.1:3456"

[cluster.rpc]
external = "0.0.0.0:3457"

Main Settings​

  • cluster_name: A logical name for the cluster. All nodes in the same cluster must share this name.
  • node_id: A unique numeric identifier for the current node.
  • heartbeat_interval: Interval (in seconds) for nodes to exchange heartbeats.
  • store_dir: Directory for storing Raft logs and cluster state.
  • session_ttl: Time-to-live for sessions in the cluster (in seconds).

Cluster Nodes​

The nodes list defines the membership of the cluster.

  • id: The unique ID of the node.
  • rpc_address: Internal RPC address used for inter-node communication and Raft consensus.
  • api_address: The external REST API address of the node.

RPC Settings​

  • external: The address and port the current node listens on for cluster RPC requests.