-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker_swarm.sh
79 lines (39 loc) · 1.82 KB
/
docker_swarm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# inicando docker Swarm
sudo Docker Swarm init
#Delcar o IP com flag --advertise-addr
--advertise-addr IP
sudo docker swarm init --advertise-addr 184.72.85.254
# sudo docker swarm join --token SWMTKN-1-5fjcsctrk5fb6ut2hs55qpte1vqiyhn1t5z4vp6o2i1j00naw9-3ppry5jzoe99bwwg9vjx4nhga 184.72.85.254:2377
docker swarm join --token SWMTKN-1-4f2f83e585klkbpufsou3lt92tm7vfj72j63p5vmcw1rbymkvo-6bc7d4kj79hifif46mysnami8 184.72.85.254:2377 #adcionando o node no maneg
docker swarm join-toker manager #recuperar o tocken
docker info
docker node rm <ID>
docker ps #Listar container
docker rmi imagem #imagem
docker image ls #listar imagens
docker stop imagen #parar imagem
sudo netstart -rn #listar serviços
sudo netstar -i #listar serviços
sudo docker swarm leave -f
#docker service create --name nginxswarm -p 80:80 nginx
docker service create --name nginx1 --publish 80:80 nginx:1.12
docker service create --name nginx1 --replicas 3 --publish 80:80 nginx:1.12
docker service rm nome #deletar um serviço
docker servce ls
docker service inspect <ID>
docker service ps <id>
docker ps -a
sudo docker stack deploy -c docker-compose.yaml nginx #executando para subir em swarm
sudo docker service scale nginx=3 #escalando swarm
sudo docker node update --availability drain <id> #drain é que não recebe task e active elevolta ao nomal
sudo docker node update --availability active <id> #drain é que não recebe task e active elevolta ao nomal
sudo docker service update --image nginx:1.18.0 <ID> #atualizar versão
docker network create --driver overlay swarm
docker network ls
docker service create --name nginx1 --replicas 3 --publish 80:80 --network swarm nginx:1.12
sudo docker node update --network-add swarm <ID>
sudo systemctl status nginx
yum install net-tools
sudo netstat -plnt
sudo docker node ls
sudo docker service ls