kzvezdarov/ircdd — pull request #92 by kzvezdarov (2014-11-09 06:28:10+00:00)
Title: [DO NOT MERGE - WIP] Cluster conf

Adding `Confd` support which seems to resolve a lot of our configuration & setup worries. Namely:
- Resolves #7
- Resolves #85 (as the cluster auto-joins itself)
- Resolves #84 (as the NSQLookupd instances start, they register themselves, and the NSQD instances automatically update to use all available)
- Resolves #83
- Helps #71

All of this comes from a very simple concept - each service resource has a watcher that registers it in ETCD while it is alive (TODO: add ticket to research properly how to poll health); Confd watches resources registered on ETCD on behalf of consumers; Confd restarts the consumers with the new configuration when it notices a change.

TODO: Adding confd for the `IRCDD` server, so that it can dynamically adjust itself on changes in database hosts (no need to do that for NSQD, as instances are co-located with it).

Pretty cool stuff.

P.S. This makes a bunch of theoretical future stuff easier - load balancers, health monitors, statsd.