mozilla / vinz-clortho

INACTIVE - http://mzl.la/ghe-archive - BrowserID Keymaster for LDAP enabled Identity Providers
16 stars 21 forks source link

Implement `__heartbeat__` #17

Closed lloyd closed 11 years ago

lloyd commented 11 years ago

This should actually ping LDAP to make sure we can properly bind - this will make a node's health contingent on proper IP access to the LDAP server and the special LDAP headless credentials (required to support email aliases). ELBs and dynamic DNS should hit the heartbeat url to check node/region health.

mostlygeek commented 11 years ago

We actually need two levels of monitoring:

For ELB monitoring we can use the endpoing /elb-health which should just return 200 OK. The ELB is in charge of redirecting traffic to healthy nodes. A healthy node qualifies when node.js is returning responses.

For site monitoring (a region), we will use /status. This endpoint actually checks that the LDAP link is OK. If it isn't it will return a HTTP 503 Service Unavailable response. If there is an issue the body will be:

Error: Short message
Additional Information about what appears to be broken

If everything is OK:

OK

The Content-Type should be plain/text. This will allow any network monitoring service/tool to easily parse and raise error conditions if required.

mostlygeek commented 11 years ago

Instead of __heartbeat__ I implemented two routes: node_health and ldap_health. One is for the load balancer between servers, the other is for DNS load balancing and fail over.