Creating a Swarm Cluster

To create a Swarm cluster:

Procedure

  1. Navigate to the folder docker-deploy/onprem/swarm/manifest-onprem-swarm.
  2. Execute the following command:
    ./create-local-swarm-cluster.sh
    This creates a local Swarm cluster consisting of 1 master node, which is also a Swarm manager and worker node (node-1).
  3. Configure Docker client to talk to Swarm manager on the current working terminal. Execute the following command from the working terminal:
    eval "$(docker-machine env master)"
  4. Verify that cluster is created successfully by running the following command. Status should be ready for all the nodes. Do not proceed until all the nodes are in active status.
    docker node ls
    Sample output:

  5. Login to the Docker registry:
    docker login <registry host> -u <user> -p <password>
    Note: Make sure login is successful before proceeding.
  6. If the Swarm cluster is created successfully, create an Overlay network ml5 for the containers networking.
    docker network create -d overlay --attachable ml5