Docker Swarm Commands
Tech-Today

Docker Swarm Commands


This tutorial requires connection to the internet as swarm creation and management needs Docker Hub.

Requirements


*Needless to say, a docker for windows must be running.


docker run swarm create
--Download the swarm image locally. Returns a unique id that is required to create a cluster. Example: TOKEN_ID.

docker-machine create -d hyperv --swarm --swarm-master --swarm-discovery token://TOKEN_ID swarm-master
--Create the swarm. controller.

docker-machine create -d hyperv --swarm --swarm-discovery token://TOKEN_ID swarm-node-01
docker-machine create -d hyperv --swarm --swarm-discovery token://TOKEN_ID swarm-node-02
--Add swarm nodes

Use --virtualbox-no-vtx-check, if you're going to use virtualbox

--List all the running machines
docker-machine ls
docker run swarm list token://TOKEN_ID

--Remove from the swarm
docker node rm swarm-node-01

--Demote a swarm master so it can be deleted
docker node demote swarm-master

--Remove the node docker machine
docker-machine rm swarm-node-01

--connect to the master node
docker-machine ssh swarm-master

--must be executed on master node
--creates a swarm
docker swarm init --advertise-addr <SWARM-MASTER-IP>

--login to swarm-node-01 and swarm-node-02 and perform the join command below
--join a machine as a node to the swarm
docker swarm join --token TOKEN_ID <swarm-master-ip>:2377

--what if we forgot the token for joining the swarm?
docker swarm join-token worker

--displays the information about the swarm
docker node ls

Reference





- Microservices In Spring
And so I was trying to learn microservices and since I'm from the JavaEE background it's given that I will first check: http://wildfly-swarm.io/tutorial. I found the code too complicated, how can I focus on the business problem if it's...

- Apache Cassandra Clustering
This tutorial will help us configure an Apache Cassandra's ring with 2 nodes. It will not explain what Cassandra is, use Google for that. There are actually not too many properties that we must update in order to set up the cluster. Note that in...

- Run Wildfly And Postgresql In Docker
Docker is a great tool to simulate a development environment. Not only that but it also makes that environment portable by having a docker/docker-compose configuration file. And that is what this blog is all about. We will launch a pre-configured docker...

- Angular-cli, Node, Npm Most Used Commands
Below is a summary of the most used commands, specially when starting up or debugging an angular project tested on node server. Note that to execute the commands below, you need to install node first. // check node and npm versions node --version npm...

- How To Create A Glassfish Cluster
This tutorial will attempt to explain, how to create a Glassfish cluster using the Glassfish's admin interface. To do this, you must have download, install and configured Glassfish's domain1 to start. Steps: 1.) Create nodes (What are nodes? See...



Tech-Today








.