Public | Automated Build

Last pushed: 10 months ago
Short Description
Short description is empty for this repo.
Full Description

consul-master

Docker container that serves as a consul master cluster by retrieving neccessary metadata via AWS.

Docker registry

The image is available as toincrease/consul-master

Maintenance

Enter any of the consul master containers:
docker exec -it consul-server /bin/sh
Then:

/ # consul members
Node        Address          Status  Type    Build  Protocol  DC
i-259aedbe  10.0.2.139:8301  alive   server  0.6.4  2         us-east-1
i-3ae307bd  10.0.1.247:8301  failed  server  0.6.4  2         us-east-1
i-ae1f0234  10.0.0.228:8301  alive   server  0.6.4  2         us-east-1
i-f3c42074  10.0.1.46:8301   alive   server  0.6.4  2         us-east-1
/ # consul force-leave i-3ae307bd
/ # consul members
Node        Address          Status  Type    Build  Protocol  DC
i-259aedbe  10.0.2.139:8301  alive   server  0.6.4  2         us-east-1
i-3ae307bd  10.0.1.247:8301  left    server  0.6.4  2         us-east-1
i-ae1f0234  10.0.0.228:8301  alive   server  0.6.4  2         us-east-1
i-f3c42074  10.0.1.46:8301   alive   server  0.6.4  2         us-east-1

Tricks

Deleting all failed non-server instances:

consul members | grep -v server | grep failed | awk '{print $1}' | xargs -I% consul force-leave %

Deleting all failed instances, including servers:

consul members | grep failed | awk '{print $1}' | xargs -I% consul force-leave %

State of master

alias state='curl localhost:8500/v1/status/leader; echo ""; curl localhost:8500/v1/status/peers; echo ""'
[ec2-user@ip-10-0-2-139 ~]$ state
"10.0.0.108:8300"
["10.0.0.108:8300","10.0.1.247:8300","10.0.2.139:8300"]

All members

for i in 10.0.0.108 10.0.1.247 10.0.2.139; do echo -n "leader of $i is "; curl $i:8500/v1/status/leader; echo ""; done
leader of 10.0.0.108 is "10.0.0.108:8300"
leader of 10.0.1.247 is "10.0.0.108:8300"
leader of 10.0.2.139 is "10.0.0.108:8300"

Docker Pull Command
Owner
toincrease
Source Repository