3 ms·
> how you would implement master election for applications running within a docker container using etcd. You build master election on top of the test and set f
by philips 13y ago
> how you would implement master election for applications running within a docker container using etcd.
You build master election on top of the test and set functionality of etcd which gives you a cluster wide locking mechanism. The plan is to provide a simplified master election REST api as a module, just like the dashboard in this release is a module.
But, nothing is stopping a regular etcd client from building master election on top of the current API.
Something I would like to add to etcdctl is a config file generator which reads from the keys of etcd and fills in fields. You could add the entire file but it is more reasonable to simply add the metadata that is dynamic into etcd and ship a template around. Another example of this is this chef integration: https://github.com/coderanger/etcd-chef https://github.com/coderanger/etcd-chef
For some applications, like load balancers, you may want to have the process itself interacting with an etcd cluster. e.g. this HTTP load balancer prototype: https://github.com/calavera/active-proxy https://github.com/calavera/active-proxy
- ash 13y ago> You build master election on top of the test and set functionality of etcd which gives you a cluster wide locking mechanism... But, nothing is stopping a regular etcd client from building master election on top of the current API. Could you give some pointers on how to implement master election on top of test-and-set? What is the algorithm? I've tried searching for it, but I've likely missed correct keywords.
- ash 13y agoI've got reply here: https://github.com/coreos/etcd/issues/225 https://github.com/coreos/etcd/issues/225