Docker Swarm Nedir?
Docker Swarm, Docker'ın dahili bir özelliği olan ve konteyner tabanlı uygulamaları yönetmek ve dağıtmak için kullanılan bir konteyner yönetim ve orkestrasyon aracıdır. Swarm, bir grup Docker ana bilgisayarını birbirine bağlayarak tek bir sanal Docker ana bilgisayarı gibi davranmalarını sağlar. Bu, Swarm'a bağlı konteynerlerin, Docker host'ları arasında otomatik olarak dağıtılmasını ve yönetilmesini sağlar.
#Docker Swarm status:
docker info
docker info | grep Swarm
#Swarm is Activate:
#By default (3) manager is recommended
#To enable the Swarm manager to identify itself to other nodes: (IP)
docker swarm init --advertise-addr 10.5.10.22
#Joining a new node as Docker Swarm (***Manager): (command) and (token)
docker swarm join-token manager
#Joining a new node as Docker Swarm (***Worker): (command) and (token)
docker swarm join-token worker
#List all nodes in a Docker Swarm cluster
docker node ls
#Remove node from Swarm
#docker swarm leave
#docker swarm leave --force
#Remove node from remote Swarm
#docker node rm <id>
#Swarm Node Role Update (Demote-Promote)
docker node update --role manager dockernode-3
docker node update --role worker dockernode-1
#Create 5 copies of httpd services on "All Swarm Nodes!!!"
#docker service create --name pantera --replicas=5 -p 3535:80 nginx
#Ensure that the service is distributed (only Worker Nodes)
docker service create --name pantera --replicas=5 --constraint 'node.role==worker' -p 3333:80 httpd
#Scale service (Replicated Mode):
docker service scale pantera=14
docker service scale pantera=7
#Scale service (Global Mode):
docker service create --name webserver --mode=global -p 80:80 nginx
#Listing services in Docker Swarm:
docker service ls
#Delete services:
docker service rm pantera
#List details of the service: (tasks)
docker service ps pantera
Saygılarımla – Best Regards
This post is licensed under CC BY 4.0 by the author.