SirIle / sirile.github.io

4 stars 1 forks source link

Comments for Swarm scaling post #9

Open SirIle opened 9 years ago

nikitamarchenko commented 8 years ago

HI. Can you explain what is 172.17.42.1 in your scripts? Thank you.

SirIle commented 8 years ago

Hi, that's the Docker bridge address which is used as the DNS server provided by Consul. Basically every node is running a Consul instance which then acts as a DNS server so that containers can then find a service from an address like rest.service.consul for the HAProxy. That IP is useful as it's the same locally on all nodes.

-----Original Message----- From: "Nikita Marchenko" notifications@github.com Sent: ‎25.‎11.‎2015 11:13 To: "SirIle/sirile.github.io" sirile.github.io@noreply.github.com Cc: "Ilkka Anttonen" ilkka.anttonen@gmail.com Subject: Re: [sirile.github.io] Comments for Swarm scaling post (#9)

HI. Can you explain what is 172.17.42.1 in your scripts? Thank you. — Reply to this email directly or view it on GitHub.

Laxman-SM commented 8 years ago

HI, Nice scripting for repository and swarm cluster creation, unable to get location of file to execute command. ./startExtService.sh hello/v1 sirile/node-test

startService.sh is correct command to start the test container.

SirIle commented 8 years ago

@Laxman-SM Ohh, thanks for notifying, I changed the files, but forgot to update the blog post. I used to have to different commands, but rolled them into just one for simplicity which first checks the local repo and then downloads from the external if not found. I'll update the post.

raarts commented 8 years ago

How do you make sure that every node in the swarm runs exactly one consul/cadvisor etc container? And that swarm restarts it on the same host if it fails? Thanks.

SirIle commented 8 years ago

@raarts Hi, the scripts target each node individually while starting the services instead of going through swarm. I considered using labels, but just targeting the nodes directly was a lot easier. For restarts I would use the --restart flag, I'm not sure if that's now set in the scripts or not as they haven't really been production hardened or anything.

raarts commented 8 years ago

@SirIle Just wondering if Swarm knows that a container was started through swarm or directly on the node, and treats it differently somehow. I know that docker will restart a container on the same node if it crashed, but what happens if the node crashes? Will swarm try to restart it on another node? Ending up with two consul instances for example?