Centralized Service Registry
Consul enables services to discover each other by storing location information (like IP addresses) in a single registry.
- $ dig @127.0.0.1 -p 8600 web.service.consul
- ; <<>> DiG 9.10.6 <<>> @127.0.0.1 -p 8600 web.service.consul SRV
- ; (1 server found)
- ;; global options: +cmd
- ;; Got answer:
- ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56598
- ;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 3
- ;; WARNING: recursion requested but not available
- ;; OPT PSEUDOSECTION:
- ; EDNS: version: 0, flags:; udp: 4096
- ;; QUESTION SECTION:
- ;web.service.consul. IN SRV
- ;; ANSWER SECTION:
- web.service.consul. 0 IN SRV 1 1 80 Judiths-MBP.lan.node.dc1.consul.
- ;; ADDITIONAL SECTION:
- Judiths-MBP.lan.node.dc1.consul. 0 IN A 127.0.0.1
- Judiths-MBP.lan.node.dc1.consul. 0 IN TXT "consul-network-segment="
- ;; Query time: 2 msec
- ;; SERVER: 127.0.0.1#8600(127.0.0.1)
- ;; WHEN: Tue Jul 16 14:31:13 PDT 2019
- ;; MSG SIZE rcvd: 150