Changing node to manager in docker swarm – what command should I use

I want to add manager to my docker swarm environment.
I can run update:
docker node update --role manager my_node_name
or promote
docker node promote my_node_name

Is there any difference between those two command?

  • docker container interface not being attached to docker0 bridge in coreos
  • how to find MAX memory from docker stats?
  • How to install python2.6 in alpine container?
  • CPU multithreading of Caffe in a Docker Container
  • docker-compose persisting folder empty
  • Dockerhub Repository Description
  • Docker I’m on:

    docker -v
    Docker version 1.13.0, build 49bf474
    

  • Import host group into Docker container
  • TLS verification issue when setting up remote docker interpreter in pycharm in Windows
  • XDebug could not open the remote debug file '/var/log/apache2/xdebug_remote.log' in Docker
  • Docker Swarm - Schedule container on each machine
  • Docker ERROR: Error processing tar file(exit status 1): unexpected EOF
  • Using Docker to build an image for Node, my Express based Node app, MongoDb, and NodeBB, connected via Passport
  • One Solution collect form web for “Changing node to manager in docker swarm – what command should I use”

    If the node is a worker I think the result of the two commands are the same. The difference is IMO when you use this commands in scripts.

    root@docker-1:~# docker node promote docker-1
    Node 123123123123123 is already a manager.
    root@docker-1:~# echo $?
    0
    root@docker-1:~# docker node update docker-1 --role manager
    docker-1
    root@docker-1:~#
    

    which means the outputs (you can handle if you want) are different. Interesting that promote an already master is not an error.

    Your question’s title is not what you ask in the description by the way. Adding a manager node to the swarm is as simple as using

    docker swarm join --token ...
    

    With a manger token you can add a manager node to the swarm in one step, and you don’t need to promote it. (so this is a third way for creating a manager node)

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.