docker swarm集群创建
docker swarm集群创建
sudo docker swarm init --advertise-addr 127.0.0.1
控制台展示
Swarm initialized: current node (kgjpg7onmysbxvkufdc2l25xy) is now a manager.
To add a worker to this swarm, run the following command:
docker swarm join --token SWMTKN-1-4oz3hqg78o8kko7ddtkje5ek5b1krs70wo29tr2u0faqnymbus-99w8ffz2vz0jrq8mkiu8f8cpf 127.0.0.1:2377
To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
docker swarm创建nginx应用
docker service create --replicas 3 -p 8081:80 --name nginx nginx:1.22
控制台展示
overall progress: 0 out of 3 tasks
1/3: preparing
2/3: preparing
3/3: preparing