forked from edyoda/docker
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerSwarmLab.txt
More file actions
30 lines (22 loc) · 801 Bytes
/
Copy pathDockerSwarmLab.txt
File metadata and controls
30 lines (22 loc) · 801 Bytes
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
on Master:
yum install docker
service docker start
docker swarm init --advertise-addr $(hostname -i)
yum install git -y
git clone https://github.com/docker/example-voting-app
cd example-voting-app
cat docker-stack.yml
docker stack deploy --compose-file=docker-stack.yml voting_stack
docker stack ls
For each services do ---
docker stack services voting_stack
docker service ps voting_stack_vote
scale a service:
docker service scale voting_stack_vote=5
docker service ls
docker service update --replicas 2 voting_stack_vote
docker service update --replicas 2 voting_stack_redis
On Slave:
yum install docker
service docker start
docker swarm join --token SWMTKN-1-3gs4q4rqygek2dalg3adauucjgqem3d6058yzwwt7rq6kugl01-1s0r6qevn4idfy87nmy11lhvj 192.168.0.28:2377