Docker1.12 Worker not able to join in cluster(Swarm: Pending)

后端 未结 6 1066
南旧
南旧 2021-01-13 23:56

Manager Version Docker version 1.12.0-rc5, build a3f2063,

Worker version Docker version 1.12.0-rc5, build a3f2063.

Created Swarm m

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-14 00:29

    The thing is, I was trying to join with wrong "port" (As docker swarm init shown in output).

    1) Before "docker swarm init", the docker running on port "4243" only. I have checked with netstat -tulp | grep docker. So I advertised with that port!

    root@veeru:~# netstat -tulpn | grep docker
    tcp6       0      0 :::4243                 :::*                    LISTEN      8750/dockerd 
    
    root@veeru:~# docker swarm init --advertise-addr "172.25.30.2:4243"
    Swarm initialized: current node (exvwgj0pu4cd124ljnblt9xff) is now a manager.
    
    To add a worker to this swarm, run the following command:
        docker swarm join \
        --token SWMTKN-1-5j9mpo8hepue6g1sjdas33thr92w1o9hlef5auwqpbxs3glt39-6zomhgu204m9alq51f632nzas \
        172.25.30.2:4243
    
    To add a manager to this swarm, run the following command:
        docker swarm join \
        --token SWMTKN-1-5j9mpo8hepue6g1sjdas33thr92w1o9hlef5auwqpbxs3glt39-axhgqgo4jqw4hv38x578m44wh \
        172.25.30.2:4243
    

    2) After docker swarm init, the docker is running with 4 port including the port 2377(netstat -tupln | grep docker).

    root@veeru:~# netstat -tulp | grep docker
    tcp6       0      0 [::]:2377               [::]:*                  LISTEN      8750/dockerd    
    tcp6       0      0 [::]:7946               [::]:*                  LISTEN      8750/dockerd    
    tcp6       0      0 [::]:4243               [::]:*                  LISTEN      8750/dockerd    
    udp6       0      0 [::]:7946               [::]:*                              8750/dockerd
    

    In point 1, it is telling to run docker swarm join with port 4243 in worker. Previously I did run like that!.(It wont work!)

    Later I did docker swarm leave and joined with port 2377. Now I am able to join!

    docker swarm join --token SWMTKN-1-5j9mpo8hepue6g1sjdas33thr92w1o9hlef5auwqpbxs3glt39-6zomhgu204m9alq51f632nzas 172.25.30.2:2377
    

提交回复
热议问题