echo '["abcdef123458"]' /var/consul/serf/local.keyring
service consul restart
# config
/etc/consul/config.json
/etc/consul/consul.d/*
# log
/var/log/syslogCLI
consul catalog datacenters
consul catalog nodes
consul catalog services
consul monitor
consul validate /etc/consul/config.json
consul operator raft list-peers
UI listen on external
https://stackoverflow.com/questions/35132687/how-to-access-externally-to-consul-ui
# Redirect UI to localhost
ssh -L 8500:localhost:8500 root@node1.example.com -N
# cat /etc/consul/config.json
{
...
"addresses": {
"dns": "127.0.0.1",
"grpc": "127.0.0.1",
"http": "0.0.0.0",
"https": "127.0.0.1"
},
...Remove service from specific node
ssh node1
consul services deregister -id=prometheus
Remove node
https://www.consul.io/commands/force-leave
consul force-leave com52-dev
checks
https://www.consul.io/api/agent/check.html
Get service state
https://consul.example.com/v1/agent/service/neutron
Icinga / Nagios checks
for SERVICE in $(consul catalog services); do
echo ${SERVICE}
/usr/lib/nagios/plugins/check_consul_service.py ${SERVICE}
echo
done
Ansible module
https://docs.ansible.com/ansible/latest/modules/consul_module.html
Consul data directory
/var/consul/*
ESP
# remove service