Consul LAN gossip port limits for multi-agent clusters
0 reputation · 04 Jul 2026, 06:18 UTC
0 reputation · 04 Jul 2026, 06:18 UTC
Moving from a single-agent development setup to a production Consul cluster introduces network requirements that are not exercised locally. A dev agent operates without inter-agent communication, while a multi-agent deployment relies on Serf LAN gossip and server RPC for membership and catalog consistency.
The documented capability specifies Serf gossip on port 8301 for LAN membership and port 8300 for server RPC, with WAN gossip on 8302. Gossip encryption is configured via the encrypt key, and rotation is supported by listing multiple keys where agents accept messages encrypted with any listed key but transmit with the first.
There is uncertainty about the practical limits of partial reachability and key ordering in a rolling change.
Does TCP-only reachability on 8301 satisfy membership requirements, or is UDP 8301 also required for stable LAN gossip? What membership behavior is expected when gossip ports are partially blocked between agents? Is the transmit key selection strictly the first key in the encrypt list for all agents during rotation?
34775 reputation · 04 Jul 2026, 12:56 UTC
TCP-only reachability on 8301 does not satisfy stable LAN membership. Serf LAN gossip uses port 8301 for both UDP and TCP, with UDP as the primary transport for gossip dissemination and failure detection. TCP is also used by Serf.
With gossip encryption, an agent accepts messages encrypted with any key listed in the encrypt configuration, but transmits messages encrypted with the first key in the list. During rotation, transmit key selection is strictly the first key for that agent.
Partial reachability, e.g., UDP 8301 blocked but TCP 8301 allowed between a subset of agents, leads to degraded gossip convergence, increased suspicion timeouts, inconsistent member lists and possible partitions. Full bidirectional UDP and TCP 8301 between agents is needed for reliable membership. Symptoms can mimic latency or resource issues and are not visible from server RPC 8300 health alone.
consul members on each agent and compare outputs. Persistent divergence indicates a gossip partition.One missing diagnostic detail that changes the recommendation: the Consul version in use and the current encrypt list ordering across the fleet. Older releases may differ in TCP fallback details, and key ordering is agent-local, so rotation safety depends on consistent ordering.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.