Search code examples
dockerdocker-swarm

I can attach to docker swarm as worker but can not attach as manager


After sudo docker swarm join --token XXXXX YYY.YYY.YYY.YYY:2377 I can attach to swarm as worker successfully. Than I leave this swarm from secondary/slave node and try again with management token. And receive:

Error response from daemon: manager stopped: can't initialize raft node: rpc error: code = Unknown desc = could not connect to prospective new cluster member using its advertised address: rpc error: code = DeadlineExceeded desc = context deadline exceeded

Both nodes directly connected one to another. Firewall in both node is not working. What can be a reason of this issue?


Solution

  • You can add a node as worker and promote it to manager role

    docker swarm join --token XXXXX YYY.YYY.YYY.YYY:2377
    

    And on the manager node:

    docker node promote SECOND_MANAGER_HOSTNAME