News for hackers. Stuff that matters.
Re:Docker 1.11: The first OCI-compliant runtime, built on co... by esseti on Thursday April 14, 2016 @03:19AM (#11494852)
> DNS round robin load balancing: It’s now possible to load balance between containers with Docker’s networking. If you give multiple containers the same alias, Docker’s service discovery will return the addresses of all of the containers for round-robin DNS.

wait wait wait. I'm kind of new into docker world. And so far i've been struggling in understanding how to replicate a container in order to scale. For example i want to run the same Django project 3 time as web1, web2, web3. If i do so now i've to expose 3 different ports, one for each. Plus, to make it working, I need to have a load balancing, thus i've to use HAProxy and do a load balancing to point to each of the container. Anytime I add a new machine (e.g., web4) i've to change the conf of HAProxy and restart it. This brings down the system for a moment. (is this the right approach btw?)

Going back to the cite paragraph. Now i can create many containers and dockers automatically does the routing for me? Am I right? or I misunderstood the meaning of the cited point?

I just need to create all of them with a --alias web ?

Re:Docker 1.11: The first OCI-compliant runtime, built on co... by e12e on Thursday April 14, 2016 @07:30AM (#11495721)
> Anytime I add a new machine (e.g., web4) i've to change the conf of HAProxy and restart it. This brings down the system for a moment. (is this the right approach btw?)

You might find this story from a year ago interesting:

"True Zero Downtime HAProxy Reloads" http://engineeringblog.yelp.com/2015/04/true-zero-downtime-h...

HN discussion (with some answers from the post author): https://news.ycombinator.com/item?id=9369051

I'm curious as to how much of an actual issue you experience though. Barring an error that prevents HAproxy from starting, it should be pretty quick? Maybe not quick enough for streaming media/realtime audio-visual communication though.

Re:Docker 1.11: The first OCI-compliant runtime, built on co... by m_mueller on Thursday April 14, 2016 @03:42AM (#11494932)
> (is this the right approach btw?)

This is why I use hipache for load balancing / routing - it is the only solution I've found where you can change the routing or add new backends in a live system without any downtime. Here is the main problem though: Its load balancing isn't exactly smart, for example it won't keep the same client IP on the same replica, thus creating problems when a client writes something on one replica, then gets switched to another that didn't get the update yet.

I'd love a better solution for this btw. Is noone working on Hipache anymore? Other than this problem I find it very elegant.

Re:Docker 1.11: The first OCI-compliant runtime, built on co... by code_research on Thursday April 14, 2016 @07:30AM (#11495725)
you might want to take a look at fabio:

https://github.com/eBay/fabio

Re:Docker 1.11: The first OCI-compliant runtime, built on co... by doublerebel on Thursday April 14, 2016 @10:12AM (#11496843)
I love Fabio. The Consul stack in general is fantastic.

Been watching #consul IRC for a while now though, and the vast majority of the setup problems are due to Docker's weird networking and security. Fabio/Consul run like a charm but Docker throws a wrench in the machine.

Re:Docker 1.11: The first OCI-compliant runtime, built on co... by sanimej on Thursday April 14, 2016 @05:27PM (#11500472)
Yes, for ex: docker run -d --name web1 --net prod --net-alias web <webapp> docker run -d --name web2 --net prod --net-alias web <webapp>

resolution for 'web' will return IPs of both the containers. You might still have to watch out for the DNS caching at the application level.

Re:Docker 1.11: The first OCI-compliant runtime, built on co... by moondev on Thursday April 14, 2016 @09:42AM (#11496568)
Why load balance three copies of a container on the same server? Just set your cpu and memory constraints to what you need for one.
Re:Docker 1.11: The first OCI-compliant runtime, built on co... by esseti on Thursday April 14, 2016 @02:20PM (#11499173)
you got a point indeed. My idea was to handle more things in parallel for services that are not heavy in resources. such as a service that checks the auth of a user from a ID/Key. anyway, with the swarm I could put the containers in various machines.
Re:Docker 1.11: The first OCI-compliant runtime, built on co... by thresh on Thursday April 14, 2016 @09:11AM (#11496330)
You can use nginx to have zero-time redeployments without gross hacks haproxy requires to do that.
Re:Docker 1.11: The first OCI-compliant runtime, built on co... by falcolas on Thursday April 14, 2016 @09:40AM (#11496563)
I would also recommend nginx. For pure proxying it's rather convenient, and offers some nice high level caching if you desire it.
Re:Docker 1.11: The first OCI-compliant runtime, built on co... by esseti on Friday April 15, 2016 @02:36AM (#11502605)
But to use nginx i've to recreate the container to link the new "web4" container. don't I? and then to make it reload the conf. or is there anything else that i can do?