This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ export PATH="$PATH:/path/to/consul" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ consul agent -dev | |
==> Starting Consul agent... | |
==> Consul agent running! | |
Version: 'v1.4.2' | |
Node ID: 'ef46ebb7-3496-346f-f67a-30117cfec0ad' | |
Node name: 'devcube' | |
Datacenter: 'dc1' (Segment: '<all>') | |
Server: true (Bootstrap: false) | |
Client Addr: [127.0.0.1] (HTTP: 8500, HTTPS: -1, gRPC: 8502, DNS: 8600) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ consul members | |
Node Address Status Type Build Protocol DC Segment | |
devcube 127.0.0.1:8301 alive server 1.4.0 2 dc1 <all> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl localhost:8500/v1/catalog/nodes | |
[ | |
{ | |
"ID": "ef46ebb7-3496-346f-f67a-30117cfec0ad", | |
"Node": "devcube", | |
"Address": "127.0.0.1", | |
"Datacenter": "dc1", | |
"TaggedAddresses": { | |
"lan": "127.0.0.1", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ dig @127.0.0.1 -p 8600 devcube.node.consul | |
; <<>> DiG 9.11.3-1ubuntu1.5-Ubuntu <<>> @127.0.0.1 -p 8600 devcube.node.consul | |
; (1 server found) | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42215 | |
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 2 | |
;; WARNING: recursion requested but not available |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir ./consul.d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ echo '{"service": {"name": "web", "tags": ["django"], "port": 80}}' \ | |
> ./consul.d/web.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ consul agent -dev -config-dir=./consul.d | |
==> Starting Consul agent... | |
==> Consul agent running! | |
Version: 'v1.4.2' | |
Node ID: '810f4804-dbce-03b1-056a-a81269ca90c1' | |
Node name: 'devcube' | |
Datacenter: 'dc1' (Segment: '<all>') | |
Server: true (Bootstrap: false) | |
Client Addr: [127.0.0.1] (HTTP: 8500, HTTPS: -1, gRPC: 8502, DNS: 8600) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ dig @127.0.0.1 -p 8600 web.service.consul | |
; <<>> DiG 9.11.3-1ubuntu1.5-Ubuntu <<>> @127.0.0.1 -p 8600 web.service.consul | |
; (1 server found) | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51488 | |
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 2 | |
;; WARNING: recursion requested but not available |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ dig @127.0.0.1 -p 8600 web.service.consul SRV | |
; <<>> DiG 9.11.3-1ubuntu1.5-Ubuntu <<>> @127.0.0.1 -p 8600 web.service.consul SRV | |
; (1 server found) | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 712 | |
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 3 | |
;; WARNING: recursion requested but not available |