Creating a Swarm Cluster in AWS
To create a Swarm cluster in AWS:
- Click Deploy Docker Community Edition (CE) for AWS.
- Click
Next to create stack.
- Create the ssh key pair in AWS portal and save *.pem locally.
- Specify the stack name, number of swarm managers, worker nodes, instance type, etc. Use the key pair name(created in previous step) for
Which ssh key to use.
- Accept the acknowledgment to create the cluster.
Once the cluster is created, you will see a screen similar to this:
- Run the following command:
chmod 400 <*.pem>
Add the ssh key:ssh-add *.pem
- To login to the manager node, find the IP of the manager node in AWS cluster:
ssh -A docker@x.x.81.235
Make sure you are logged in to the manager node. - Copy the images files into the manager node using:
scp -i *.pem /tml*.* docker@x.x.81.235:/home/docker
- Login into the manager node and load all the images:
ssh -A docker@x.x.81.235
- Once the images are being loaded in the master node,
ssh into the each of the worker nodes and
scp the images, and load all the images in the worker node as well:
- Untar the tar
-xvf tml-deploy.tgz:
./compose.sh manifest-aws-swarm.json TML_CLUSTER_NAME: Tibco Mashery Local Reference Cluster TML_CLUSTER_TAG: 169520f85a36e474ea1b06d4c87e111d TML_ZONE_NAME 0: local TML_ZONE_COUNT: 1 TML_RELEASE_VERSION: 5.0.0
- List the nodes:
docker node ls ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION hee56t3jntdm6tfv10y02vpyo * ip-x-x-0-125.us-west-2.compute.internal Ready Active Leader 18.06.1-ce 46uy8lpt1iwyg29j5irft2vc5 ip-x-x-35-149.us-west-2.compute.internal Ready Active 18.06.1-ce
- If the swarm cluster is created successfully, create an Overlay network
ml5 for the containers networking. Execute the following command on the manager node:
docker network create -d overlay --attachable ml5
- Create the cluster:
- Once it is complete, to check which nodes got deployed on Master/slave use:
docker ps
- To login to any pod inside node:
ssh docker@master-ip
docker ps, use docker exec to get into the pod.
Ensure that all the pods are ACTIVE.
Copyright © Cloud Software Group, Inc. All rights reserved.