geodns
geodns copied to clipboard
Health-check for endpoints
Hi,
is it possible to implement health-check for endpoints like in consul (https://github.com/hashicorp/consul) for prevent routing traffic to unhealthy nodes?
And add additional field 'check' for records. Something like:
"mongodb": {"a": [ [ "1.2.3.4", "100", "checks": [{"name":"Check Site","script": "/usr/bin/check_mongo.py --host 1.2.3.4 --port 27017","interval": "5s"}] ] ] }
Hi,
I've already implemented (awaiting comments and merge) health tests with this commit: https://github.com/abligh/geodns/commit/0bd80674ebb443aa24afdd74ba7026cad7944a6e which is in this pull request: https://github.com/abh/geodns/pull/73
Assuming the script returns success / failure, that will work as standard using the exec
health test type. Alternatively, you could write your own health test type that calls the consul
API. You might see how I did nodeping
and pingdom
.
Finally, without the health test stuff above, you could always write your own framework to rewrite you JSON files dependent upon the result of your health tests.
Alex
Hi Alex,
thank you very much for your work. I am going to test it right now.
you could always write your own framework to rewrite you JSON files dependent upon the result of your health tests.
I have tried this way at first but my solution was cumbersome.
Any progress on this?
These features look really good. @abh - Please would you merge the same
@abh Any updates?