abh / geodns

DNS server with per-client targeted responses
Apache License 2.0
1.39k stars 193 forks source link

Health-check for endpoints #85

Open vteslia opened 9 years ago

vteslia commented 9 years ago

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"}] ] ] }
abligh commented 9 years ago

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

vteslia commented 9 years ago

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.

sspans commented 8 years ago

Any progress on this?

AnoopAlias commented 6 years ago

These features look really good. @abh - Please would you merge the same

arhue commented 5 years ago

@abh Any updates?