Different ports used by consul

eldos picture eldos · Jun 6, 2015 · Viewed 26.1k times · Source

What are the different ports used by consul? What is the purpose of each port? Is there any way to configure consul to run using different ports?

Answer

Brrrr picture Brrrr · Jun 7, 2015

When reading the consul documentation you will find following information.

Ports Used

Consul requires up to 4 different ports to work properly, some on TCP, UDP, or both protocols. Below we document the requirements for each port.

  • Server RPC (Default 8300). This is used by servers to handle incoming requests from other agents. TCP only.
  • Serf LAN (Default 8301). This is used to handle gossip in the LAN. Required by all agents. TCP and UDP.
  • Serf WAN (Default 8302). This is used by servers to gossip over the WAN to other servers. TCP and UDP.
  • HTTP API (Default 8500). This is used by clients to talk to the HTTP API. TCP only.
  • DNS Interface (Default 8600). Used to resolve DNS queries. TCP and UDP.

You can configure consul services to run on different ports by editing the config file. For example setting the dns interface on port 53 and the HTTP API on port 80. More details on port configuration is here.

{ 
  "ports": { 
    "dns": 53,
    "http": 80
  } 
}