Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created June 17, 2020 05:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/1ece8a4a15e765c0bac2b08c3ad41c70 to your computer and use it in GitHub Desktop.
Save velotiotech/1ece8a4a15e765c0bac2b08c3ad41c70 to your computer and use it in GitHub Desktop.
Velotio - HashiCorp Consul Part 2 - Discovering MongoDB Primary node from Django container
root@82857c424b15:/web/tweeter# dig @127.0.0.1 mongo-primary.service.consul
; <<>> DiG 9.10.3-P4-Debian <<>> @127.0.0.1 mongo-primary.service.consul
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8369
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 2
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;mongo-primary.service.consul. IN A
;; ANSWER SECTION:
mongo-primary.service.consul. 0 IN A 33.10.0.3
;; ADDITIONAL SECTION:
mongo-primary.service.consul. 0 IN TXT "consul-network-segment="
;; Query time: 139 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Apr 01 11:50:45 UTC 2019
;; MSG SIZE rcvd: 109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment