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 django.web.service.consul | |
; <<>> DiG 9.11.3-1ubuntu1.5-Ubuntu <<>> @127.0.0.1 -p 8600 django.web.service.consul | |
; (1 server found) | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12278 | |
;; 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
$ curl http://localhost:8500/v1/catalog/service/web | |
[ | |
{ | |
"ID": "810f4804-dbce-03b1-056a-a81269ca90c1", | |
"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
$ curl http://localhost:8500/v1/catalog/service/web?passing | |
[ | |
{ | |
"ID": "810f4804-dbce-03b1-056a-a81269ca90c1", | |
"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
$ ps aux | grep [c]onsul | |
pranav 21289 2.4 0.3 177012 54924 pts/2 Sl+ 00:55 0:22 consul agent -dev -config-dir=./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
$ kill -SIGHUP 21289 |
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 reload |
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
... | |
2019/03/04 01:10:46 [INFO] agent: Caught signal: hangup | |
2019/03/04 01:10:46 [INFO] agent: Reloading configuration... | |
2019/03/04 01:10:46 [DEBUG] agent: removed service "web" | |
2019/03/04 01:10:46 [INFO] agent: Synced service "web" | |
2019/03/04 01:10:46 [DEBUG] agent: Node info in sync | |
... |
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
replication: | |
replSetName: "consuldemo" |
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
var config = { | |
_id: "consuldemo", | |
version: 1, | |
members: [{ | |
_id: 0, | |
host: "mongo_1:27017", | |
}, { | |
_id: 1, | |
host: "mongo_2:27017", | |
}, { |
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
mongod --bind_ip_all --port 27017 --dbpath /data/db --replSet "consuldemo" |