concept node in category docker

appears as: node, nodes, nodes, node
Learn Docker in a Month of Lunches

This is an excerpt from Manning's book Learn Docker in a Month of Lunches.

This application is another REST API. In the final application stage, the steps expose the HTTP port and specify the node command line as the startup command. The last thing is to create a working directory and copy in the application artifacts. The downloaded dependencies are copied from the builder stage, and the source code is copied from the host computer. The src folder contains the JavaScript files, including server.js , which is the entry point started by the Node.js process.

Drain mode means slightly different things for workers and managers. In both cases all the replicas running on the node are shut down and no more replicas will be scheduled for the node. Manager nodes are still part of the management group though, so they still synchronize the cluster database, provide access to the management API, and can be the leader. Figure 14.11 shows my cluster with two drained nodes.

Figure 14.11 Entering drain mode removes all containers and lets you run maintenance on the node.
# on node1 - forcibly leave the Swarm:
 docker swarm leave --force
 
 # on node 2 - make the worker node available again:
 docker node update --availability active node5
 
 # promote the worker to a manager:
 docker node promote node5
 
 # check the nodes:
 docker node ls

There are two ways a node can leave the Swarm--a manager can initiate it with the node rm command or the node itself can do it with swarm leave . If the node leaves by itself, that’s a similar situation to the node going offline--the Swarm managers think it should still be there, but it’s not reachable. You can see that in my output in figure 14.12. The original node1 is still listed as a manager, but the status is Down and the manager status is Unreachable .

Figure 14.12 Node management keeps your Swarm fully available even when nodes are offline.

Now the swarm has three managers again, which gives it high availability. If node1 had gone offline unexpectedly, when it came back online I could return one of the other managers to the worker pool by running node demote . Those are pretty much the only commands you need to manage a Docker Swarm cluster.

Docker in Action, Second Edition

This is an excerpt from Manning's book Docker in Action, Second Edition.

NodePort publishing is a term we’ve used here to match Docker and other ecosystem projects. The Node portion is an inference to the host as typically a node in a larger cluster of machines.

You have many options for building a swarm from a cluster of nodes. The examples in this chapter use a Swarm cluster with five nodes, though most of the examples work on a single node, such as Docker for Mac. You may provision a Swarm cluster however you like. Because of the wide variety of provisioning options and the rate of change, we recommend you follow an up-to-date guide to provision a Swarm cluster on your favorite infrastructure provider. Many people deploy test clusters with docker-machine on cloud providers such as DigitalOcean and Amazon Web Services.

sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest