Docker Swarm Cluster Setup



Estimated reading time: 2 minutes

After you complete the tutorial setup steps, you’re readyto create a swarm. Make sure the Docker Engine daemon is started on the hostmachines.

The docker compose recipe will expose PostgreSQL on port 25432 (to prevent potential conflicts with any local database instance you may have). Example usage: docker-compose up -d Note: The docker-compose recipe above will not persist your data on your local disk, only in a docker volume. Connect via psql. Of course,these ASIPs are encapsulated in individual docker container and available to Kubernetes (K8s) from container repository. Let's say now that you want to deploy this on Google's GKE K8s. To implement sustained availability, each ASIP instance (replica) is deployed on different nodes (VM) where each VM has it's own cloud internal IP address.

  1. Open a terminal and ssh into the machine where you want to run your managernode. This tutorial uses a machine named manager1. If you use Docker Machine,you can connect to it via SSH using the following command:

  2. Run the following command to create a new swarm:

    Note: If you are using Docker Desktop for Mac or Docker Desktop for Windows to testsingle-node swarm, simply run docker swarm init with no arguments. There is noneed to specify --advertise-addr in this case. To learn more, see the topicon how toUse Docker Desktop for Mac or Docker Desktop for Windowswith Swarm.

    In the tutorial, the following command creates a swarm on the manager1machine:

    The --advertise-addr flag configures the manager node to publish itsaddress as 192.168.99.100. The other nodes in the swarm must be ableto access the manager at the IP address.

    The output includes the commands to join new nodes to the swarm. Nodes willjoin as managers or workers depending on the value for the --tokenflag.

  3. Run docker info to view the current state of the swarm:

  4. Run the docker node ls command to view information about nodes:

    Torrent downloader for mac catalina. The * next to the node ID indicates that you’re currently connected onthis node.

    Docker Engine swarm mode automatically names the node for the machine hostname. The tutorial covers other columns in later steps.

What’s next?

In the next section of the tutorial, we add two more nodes tothe cluster.

Docker Swarm Install Cluster

Cluster

Docker Swarm Cluster Setup Commands

tutorial, cluster management, swarm mode