Skip to content

Instantly share code, notes, and snippets.

@muresan
Created November 26, 2015 17:57
Show Gist options
  • Save muresan/dd1831fe900d5033c33a to your computer and use it in GitHub Desktop.
Save muresan/dd1831fe900d5033c33a to your computer and use it in GitHub Desktop.
Backup-like feature implemented using consul. cdnhealth.json and webservice.json is on all CDN members which are not backup and backup_webservice.json is on the backup(s)
{
"services": [
{ "id": "webservice-backup",
"name": "webservice",
"tags": ["backup"],
"port": 80,
"checks": [{
"name": "DNS check ",
"script": "/usr/lib64/nagios/plugins/negate -s /usr/lib64/nagios/plugins/check_dns -H cdnhealth.service.cdn.example.com.",
"interval": "5s",
"timeout": "1s"
},
{
"name": "HTTP on port 80",
"http": "http://localhost:80/",
"interval": "5s",
"timeout": "1s"
}]
}]
}
{
"service": {
"name": "cdnhealth",
"tags": ["cdn01"],
"port": 80,
"checks": [{
"name": "HTTP on port 80",
"http": "http://localhost:80/",
"interval": "5s",
"timeout": "1s"
}]
}
}
{
"service": {
"name": "webservice",
"tags": ["cdn01"],
"port": 80,
"checks": [{
"name": "HTTP on port 80",
"http": "http://localhost:80/",
"interval": "5s",
"timeout": "1s"
}]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment