docker swarm 使用

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

 1 . swarm 初始化

docker swarm init

Swarm initialized: current node (gzek8cjk644jnuslg13vkyb4n) is now a manager.

To add a worker to this swarm, run the following command:

    docker swarm join --token SWMTKN-1-4f3zyy0dkznd1e2yllby324n284xfcjml0btalr8zkwxrchfv7-axzdbiwf4vclqae8iyk7hp7u0 192.168.175.139:2377

To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.

2 . 显示 worker or manager join-token

docker swarm join-token worker

To add a worker to this swarm, run the following command:

    docker swarm join --token SWMTKN-1-4f3zyy0dkznd1e2yllby324n284xfcjml0btalr8zkwxrchfv7-axzdbiwf4vclqae8iyk7hp7u0 192.168.175.139:2377

 docker swarm join-token manager

To add a manager to this swarm, run the following command:

    docker swarm join --token SWMTKN-1-4f3zyy0dkznd1e2yllby324n284xfcjml0btalr8zkwxrchfv7-a5wg4xpr4li4pgwcl29sg03bt 192.168.175.139:2377

3 . leave swarm

docker swarm leave --force

Node left the swarm.

 

转载于:https://my.oschina.net/u/4038454/blog/2963867

你可能感兴趣的:(docker swarm 使用)