Setup swarm mode cluster, with managers and worker nodes
I have used GCP for creating compute engines as we get 300$ free credit. You can follow steps in https://cloud.google.com/compute/docs/quickstart-linux to get started with the creation of vm's. Make sure that you select f1.micro instances to be in the free tier limit. More details on GCP free tier:https://cloud.google.com/free/. However you can spin instance either in GCP, Azure or Aws to get started quickly. Once after creation on VM, install docker using yum install docker -y ( I have used CentOS distribution).We will start by creating a Docker swarm cluster with one master node and one working node. Docker swarm comes by default with docker installation and doesn't require any additional installations. Execute the command docker swarm init to initialize docker swarm in the manager node. We get a swarm token to run on the node and also for adding another manager
Adding a worker node to the swarm cluster -
Once after creating cluster, the workers and managers can be viewed by executing the command docker node ls on the manager. Running the command docker node ls on nodes throws an error responce saying Worker nodes can't be used to view or modify cluster state.
Sir is there anyway I can have a chat with u
ReplyDeleteThe walkthrough gives a clear starting point for building a Docker Swarm cluster on cloud-based virtual machines, using GCP compute instances and a CentOS environment as the example. The progression from creating the VMs to installing Docker and initializing the first manager node makes the relationship between the underlying infrastructure and the Swarm cluster easy to follow.
ReplyDeleteThe docker swarm init step is particularly important because the manager generates the token needed to join additional nodes to the cluster. A Cloud Computing Projects for Final Year can provide a useful practical context for experimenting with distributed deployments, cloud instances, container orchestration, and multi-node application architectures.
The example also highlights the flexibility of using different cloud providers for the underlying virtual machines, while keeping Docker Swarm as the orchestration layer. Once managers and workers are configured, this model provides a foundation for studying distributed container deployment and the networking considerations involved. A Cloud Security Projects perspective is also valuable because securing manager access, worker communication, credentials, and cloud network boundaries becomes increasingly important as the cluster grows.
ReplyDelete