Griesba / docker-swarm-100

0 stars 0 forks source link

create a 3-node swarm cluster #1

Open Griesba opened 3 years ago

Griesba commented 3 years ago

Create node with docker-machine command docker-machine create node1 (create vm with busy box)

docker-machine ssh node1 (connect to the machine in ssh mode)

docker-machine env node1

Another option is to use play-with-docker.com

You can user online plateform to create you node. At this point you need to install docker whith script you can found here get.docker.com

Griesba commented 3 years ago

once connected with ssh to nod1 run docker swarm init (to init swarm and get join token )

if ip add is requested: docker swarm init --advertise-addr

copy join command and paste it to node2

come back to node1 and run <> and you should see node2

docker node update --role manager node2

docker swarm join-token manager

create service: (always connected to node1 in ssh mode) docker service create --replicas 3 alpine ping 8.8.8.8 test with : docker service ls docker serice ps