|
|
|
|
|
by vidarh
4468 days ago
|
|
I don't like the container linking because it is basically tied to one server without extra complexity. CoreOS' "fleet" ( https://coreos.com/docs/launching-containers/launching/launc... ) gives a cluster-wide solution. But even without using fleet, the overall mechanism is fairly easy to adapt: Either use systemd dependencies like in their example, or have a script that queries docker on each host to spot changes in running containers, and update an etcd instance (or whichever your preferred config server is). |
|
Your services need to read something to get the IP, which ultimately comes from an ENV variable. In the linked container scenario Docker sets that variable. Otherwise you set it manually. That's the only extra complexity.
I was worried about this too, so I tried it out[1]. In this case I have a YAML config file, which can be overridden by ENV variables (which may come from Docker).
This isn't as automatic as CoreOS (eg, no failover etc), but it is a lot less complex.
[1] https://github.com/nlothian/Acuitra/blob/master/services/que...