swarm manager does not connect to nodes' docker daemons on AWS











up vote
1
down vote

favorite












I'm trying to configure on AWS a docker swarm example.



I have three machines: two nodes and on manager, created by using docker-machine:



docker-machine create --driver amazonec2 --amazonec2-region eu-central-1 swarm-manager
docker-machine create --driver amazonec2 --amazonec2-region eu-central-1 docker1
docker-machine create --driver amazonec2 --amazonec2-region eu-central-1 docker2


I set up docker1 and 2 like this:



set up /etc/default/docker:



DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"


rebooted docker and then:



sudo docker run -d swarm join --addr=172.31.5.27:2375 token://<token>



and checked it:



ubuntu@docker1:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a4ae06e827a6 swarm "/swarm join --addr=1" 28 minutes ago Up 28 minutes 2375/tcp admiring_blackwell


on the swarm machine:



sudo docker run -dP swarm manage token://


and I added my nodes:



ubuntu@swarm-manager:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
67f55fda2eba swarm "/swarm manage token:" 16 minutes ago Up 16 minutes 0.0.0.0:32768->2375/tcp trusting_dijkstra

ubuntu@swarm-manager:~$ docker -H tcp://127.0.0.1:32768 info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: swarm/1.2.5
Role: primary
Strategy: spread
Filters: health, port, containerslots, dependency, affinity, constraint
Nodes: 2
(unknown): 172.31.11.143:2375
└ ID:
└ Status: Pending
└ Containers: 0
└ Reserved CPUs: 0 / 0
└ Reserved Memory: 0 B / 0 B
└ Labels:
└ Error: Cannot connect to the Docker daemon. Is the docker daemon running on this host?
└ UpdatedAt: 2016-10-29T16:34:28Z
└ ServerVersion:
(unknown): 172.31.5.27:2375
└ ID:
└ Status: Pending
└ Containers: 0
└ Reserved CPUs: 0 / 0
└ Reserved Memory: 0 B / 0 B
└ Labels:
└ Error: Cannot connect to the Docker daemon. Is the docker daemon running on this host?
└ UpdatedAt: 2016-10-29T16:34:38Z
└ ServerVersion:
Plugins:
Volume:
Network:
Swarm:
NodeID:
Is Manager: false
Node Address:
Security Options:
Kernel Version: 4.2.0-18-generic
Operating System: linux
Architecture: amd64
CPUs: 0
Total Memory: 0 B
Name: 67f55fda2eba
Docker Root Dir:
Debug Mode (client): false
Debug Mode (server): false
WARNING: No kernel memory limit support


I can't undersrtand why imy nodes are still pending. The private IPs I used seem to be correct, plus the two nodes are listes. Any hint?










share|improve this question




























    up vote
    1
    down vote

    favorite












    I'm trying to configure on AWS a docker swarm example.



    I have three machines: two nodes and on manager, created by using docker-machine:



    docker-machine create --driver amazonec2 --amazonec2-region eu-central-1 swarm-manager
    docker-machine create --driver amazonec2 --amazonec2-region eu-central-1 docker1
    docker-machine create --driver amazonec2 --amazonec2-region eu-central-1 docker2


    I set up docker1 and 2 like this:



    set up /etc/default/docker:



    DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"


    rebooted docker and then:



    sudo docker run -d swarm join --addr=172.31.5.27:2375 token://<token>



    and checked it:



    ubuntu@docker1:~$ sudo docker ps
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    a4ae06e827a6 swarm "/swarm join --addr=1" 28 minutes ago Up 28 minutes 2375/tcp admiring_blackwell


    on the swarm machine:



    sudo docker run -dP swarm manage token://


    and I added my nodes:



    ubuntu@swarm-manager:~$ sudo docker ps
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    67f55fda2eba swarm "/swarm manage token:" 16 minutes ago Up 16 minutes 0.0.0.0:32768->2375/tcp trusting_dijkstra

    ubuntu@swarm-manager:~$ docker -H tcp://127.0.0.1:32768 info
    Containers: 0
    Running: 0
    Paused: 0
    Stopped: 0
    Images: 0
    Server Version: swarm/1.2.5
    Role: primary
    Strategy: spread
    Filters: health, port, containerslots, dependency, affinity, constraint
    Nodes: 2
    (unknown): 172.31.11.143:2375
    └ ID:
    └ Status: Pending
    └ Containers: 0
    └ Reserved CPUs: 0 / 0
    └ Reserved Memory: 0 B / 0 B
    └ Labels:
    └ Error: Cannot connect to the Docker daemon. Is the docker daemon running on this host?
    └ UpdatedAt: 2016-10-29T16:34:28Z
    └ ServerVersion:
    (unknown): 172.31.5.27:2375
    └ ID:
    └ Status: Pending
    └ Containers: 0
    └ Reserved CPUs: 0 / 0
    └ Reserved Memory: 0 B / 0 B
    └ Labels:
    └ Error: Cannot connect to the Docker daemon. Is the docker daemon running on this host?
    └ UpdatedAt: 2016-10-29T16:34:38Z
    └ ServerVersion:
    Plugins:
    Volume:
    Network:
    Swarm:
    NodeID:
    Is Manager: false
    Node Address:
    Security Options:
    Kernel Version: 4.2.0-18-generic
    Operating System: linux
    Architecture: amd64
    CPUs: 0
    Total Memory: 0 B
    Name: 67f55fda2eba
    Docker Root Dir:
    Debug Mode (client): false
    Debug Mode (server): false
    WARNING: No kernel memory limit support


    I can't undersrtand why imy nodes are still pending. The private IPs I used seem to be correct, plus the two nodes are listes. Any hint?










    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I'm trying to configure on AWS a docker swarm example.



      I have three machines: two nodes and on manager, created by using docker-machine:



      docker-machine create --driver amazonec2 --amazonec2-region eu-central-1 swarm-manager
      docker-machine create --driver amazonec2 --amazonec2-region eu-central-1 docker1
      docker-machine create --driver amazonec2 --amazonec2-region eu-central-1 docker2


      I set up docker1 and 2 like this:



      set up /etc/default/docker:



      DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"


      rebooted docker and then:



      sudo docker run -d swarm join --addr=172.31.5.27:2375 token://<token>



      and checked it:



      ubuntu@docker1:~$ sudo docker ps
      CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
      a4ae06e827a6 swarm "/swarm join --addr=1" 28 minutes ago Up 28 minutes 2375/tcp admiring_blackwell


      on the swarm machine:



      sudo docker run -dP swarm manage token://


      and I added my nodes:



      ubuntu@swarm-manager:~$ sudo docker ps
      CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
      67f55fda2eba swarm "/swarm manage token:" 16 minutes ago Up 16 minutes 0.0.0.0:32768->2375/tcp trusting_dijkstra

      ubuntu@swarm-manager:~$ docker -H tcp://127.0.0.1:32768 info
      Containers: 0
      Running: 0
      Paused: 0
      Stopped: 0
      Images: 0
      Server Version: swarm/1.2.5
      Role: primary
      Strategy: spread
      Filters: health, port, containerslots, dependency, affinity, constraint
      Nodes: 2
      (unknown): 172.31.11.143:2375
      └ ID:
      └ Status: Pending
      └ Containers: 0
      └ Reserved CPUs: 0 / 0
      └ Reserved Memory: 0 B / 0 B
      └ Labels:
      └ Error: Cannot connect to the Docker daemon. Is the docker daemon running on this host?
      └ UpdatedAt: 2016-10-29T16:34:28Z
      └ ServerVersion:
      (unknown): 172.31.5.27:2375
      └ ID:
      └ Status: Pending
      └ Containers: 0
      └ Reserved CPUs: 0 / 0
      └ Reserved Memory: 0 B / 0 B
      └ Labels:
      └ Error: Cannot connect to the Docker daemon. Is the docker daemon running on this host?
      └ UpdatedAt: 2016-10-29T16:34:38Z
      └ ServerVersion:
      Plugins:
      Volume:
      Network:
      Swarm:
      NodeID:
      Is Manager: false
      Node Address:
      Security Options:
      Kernel Version: 4.2.0-18-generic
      Operating System: linux
      Architecture: amd64
      CPUs: 0
      Total Memory: 0 B
      Name: 67f55fda2eba
      Docker Root Dir:
      Debug Mode (client): false
      Debug Mode (server): false
      WARNING: No kernel memory limit support


      I can't undersrtand why imy nodes are still pending. The private IPs I used seem to be correct, plus the two nodes are listes. Any hint?










      share|improve this question















      I'm trying to configure on AWS a docker swarm example.



      I have three machines: two nodes and on manager, created by using docker-machine:



      docker-machine create --driver amazonec2 --amazonec2-region eu-central-1 swarm-manager
      docker-machine create --driver amazonec2 --amazonec2-region eu-central-1 docker1
      docker-machine create --driver amazonec2 --amazonec2-region eu-central-1 docker2


      I set up docker1 and 2 like this:



      set up /etc/default/docker:



      DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"


      rebooted docker and then:



      sudo docker run -d swarm join --addr=172.31.5.27:2375 token://<token>



      and checked it:



      ubuntu@docker1:~$ sudo docker ps
      CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
      a4ae06e827a6 swarm "/swarm join --addr=1" 28 minutes ago Up 28 minutes 2375/tcp admiring_blackwell


      on the swarm machine:



      sudo docker run -dP swarm manage token://


      and I added my nodes:



      ubuntu@swarm-manager:~$ sudo docker ps
      CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
      67f55fda2eba swarm "/swarm manage token:" 16 minutes ago Up 16 minutes 0.0.0.0:32768->2375/tcp trusting_dijkstra

      ubuntu@swarm-manager:~$ docker -H tcp://127.0.0.1:32768 info
      Containers: 0
      Running: 0
      Paused: 0
      Stopped: 0
      Images: 0
      Server Version: swarm/1.2.5
      Role: primary
      Strategy: spread
      Filters: health, port, containerslots, dependency, affinity, constraint
      Nodes: 2
      (unknown): 172.31.11.143:2375
      └ ID:
      └ Status: Pending
      └ Containers: 0
      └ Reserved CPUs: 0 / 0
      └ Reserved Memory: 0 B / 0 B
      └ Labels:
      └ Error: Cannot connect to the Docker daemon. Is the docker daemon running on this host?
      └ UpdatedAt: 2016-10-29T16:34:28Z
      └ ServerVersion:
      (unknown): 172.31.5.27:2375
      └ ID:
      └ Status: Pending
      └ Containers: 0
      └ Reserved CPUs: 0 / 0
      └ Reserved Memory: 0 B / 0 B
      └ Labels:
      └ Error: Cannot connect to the Docker daemon. Is the docker daemon running on this host?
      └ UpdatedAt: 2016-10-29T16:34:38Z
      └ ServerVersion:
      Plugins:
      Volume:
      Network:
      Swarm:
      NodeID:
      Is Manager: false
      Node Address:
      Security Options:
      Kernel Version: 4.2.0-18-generic
      Operating System: linux
      Architecture: amd64
      CPUs: 0
      Total Memory: 0 B
      Name: 67f55fda2eba
      Docker Root Dir:
      Debug Mode (client): false
      Debug Mode (server): false
      WARNING: No kernel memory limit support


      I can't undersrtand why imy nodes are still pending. The private IPs I used seem to be correct, plus the two nodes are listes. Any hint?







      amazon-web-services amazon-ec2 docker-swarm






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 23 '16 at 11:00









      sendmoreinfo

      546622




      546622










      asked Oct 29 '16 at 16:40









      Bertuz

      96911631




      96911631
























          3 Answers
          3






          active

          oldest

          votes

















          up vote
          0
          down vote













          This may be related to this issue. My understanding is that there's a problem with docker machines created with Docker 1.12.1. The error that I'm getting is



          Error checking TLS connection: "mybox" is not a swarm master. The --swarm flag is intended for use with swarm masters


          after running



          eval $(docker-machine env --swarm mybox)


          You may be arriving at the same problem via slightly different route but I'm having the same issue of the swarm not forming.






          share|improve this answer




























            up vote
            0
            down vote













            You need to login to the swarm manager using docker-machine ssh aws-swarm-mgr, and initiate
            docker-swarm init on the master node first.



            then login to the slave nodes using
            docker-machine ssh docker1



            Please note the token to join the master here, example output



            docker swarm join --token SWMTKN-1-65v85za1nnkg4u09e1jbgtk86b3pl8ntawj0ha6m6upzbyho5z-4fasp7wt5f13ts16arypbrpa1 192.168.99.100:2377


            and run from docker1 node and docker2 node



            docker swarm join --token xxxLOREMIPSUMTOKENx ip:2377


            To confirm the above, login to the master node



            docker-machine ssh aws-swarm-mgr


            From within, the master aws node



            aws-swarm-mgr> docker node ls


            That should do it.






            share|improve this answer




























              up vote
              0
              down vote













              I have a docker swarm on AWS with three nodes. I should see my web page through any three public IP address. I have opened the required security group stated on docker doc. I think they have this bug for their overlay driver...






              share|improve this answer





















                Your Answer






                StackExchange.ifUsing("editor", function () {
                StackExchange.using("externalEditor", function () {
                StackExchange.using("snippets", function () {
                StackExchange.snippets.init();
                });
                });
                }, "code-snippets");

                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "1"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f40321302%2fswarm-manager-does-not-connect-to-nodes-docker-daemons-on-aws%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes








                up vote
                0
                down vote













                This may be related to this issue. My understanding is that there's a problem with docker machines created with Docker 1.12.1. The error that I'm getting is



                Error checking TLS connection: "mybox" is not a swarm master. The --swarm flag is intended for use with swarm masters


                after running



                eval $(docker-machine env --swarm mybox)


                You may be arriving at the same problem via slightly different route but I'm having the same issue of the swarm not forming.






                share|improve this answer

























                  up vote
                  0
                  down vote













                  This may be related to this issue. My understanding is that there's a problem with docker machines created with Docker 1.12.1. The error that I'm getting is



                  Error checking TLS connection: "mybox" is not a swarm master. The --swarm flag is intended for use with swarm masters


                  after running



                  eval $(docker-machine env --swarm mybox)


                  You may be arriving at the same problem via slightly different route but I'm having the same issue of the swarm not forming.






                  share|improve this answer























                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    This may be related to this issue. My understanding is that there's a problem with docker machines created with Docker 1.12.1. The error that I'm getting is



                    Error checking TLS connection: "mybox" is not a swarm master. The --swarm flag is intended for use with swarm masters


                    after running



                    eval $(docker-machine env --swarm mybox)


                    You may be arriving at the same problem via slightly different route but I'm having the same issue of the swarm not forming.






                    share|improve this answer












                    This may be related to this issue. My understanding is that there's a problem with docker machines created with Docker 1.12.1. The error that I'm getting is



                    Error checking TLS connection: "mybox" is not a swarm master. The --swarm flag is intended for use with swarm masters


                    after running



                    eval $(docker-machine env --swarm mybox)


                    You may be arriving at the same problem via slightly different route but I'm having the same issue of the swarm not forming.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Oct 29 '16 at 17:56









                    sas

                    2,37621730




                    2,37621730
























                        up vote
                        0
                        down vote













                        You need to login to the swarm manager using docker-machine ssh aws-swarm-mgr, and initiate
                        docker-swarm init on the master node first.



                        then login to the slave nodes using
                        docker-machine ssh docker1



                        Please note the token to join the master here, example output



                        docker swarm join --token SWMTKN-1-65v85za1nnkg4u09e1jbgtk86b3pl8ntawj0ha6m6upzbyho5z-4fasp7wt5f13ts16arypbrpa1 192.168.99.100:2377


                        and run from docker1 node and docker2 node



                        docker swarm join --token xxxLOREMIPSUMTOKENx ip:2377


                        To confirm the above, login to the master node



                        docker-machine ssh aws-swarm-mgr


                        From within, the master aws node



                        aws-swarm-mgr> docker node ls


                        That should do it.






                        share|improve this answer

























                          up vote
                          0
                          down vote













                          You need to login to the swarm manager using docker-machine ssh aws-swarm-mgr, and initiate
                          docker-swarm init on the master node first.



                          then login to the slave nodes using
                          docker-machine ssh docker1



                          Please note the token to join the master here, example output



                          docker swarm join --token SWMTKN-1-65v85za1nnkg4u09e1jbgtk86b3pl8ntawj0ha6m6upzbyho5z-4fasp7wt5f13ts16arypbrpa1 192.168.99.100:2377


                          and run from docker1 node and docker2 node



                          docker swarm join --token xxxLOREMIPSUMTOKENx ip:2377


                          To confirm the above, login to the master node



                          docker-machine ssh aws-swarm-mgr


                          From within, the master aws node



                          aws-swarm-mgr> docker node ls


                          That should do it.






                          share|improve this answer























                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            You need to login to the swarm manager using docker-machine ssh aws-swarm-mgr, and initiate
                            docker-swarm init on the master node first.



                            then login to the slave nodes using
                            docker-machine ssh docker1



                            Please note the token to join the master here, example output



                            docker swarm join --token SWMTKN-1-65v85za1nnkg4u09e1jbgtk86b3pl8ntawj0ha6m6upzbyho5z-4fasp7wt5f13ts16arypbrpa1 192.168.99.100:2377


                            and run from docker1 node and docker2 node



                            docker swarm join --token xxxLOREMIPSUMTOKENx ip:2377


                            To confirm the above, login to the master node



                            docker-machine ssh aws-swarm-mgr


                            From within, the master aws node



                            aws-swarm-mgr> docker node ls


                            That should do it.






                            share|improve this answer












                            You need to login to the swarm manager using docker-machine ssh aws-swarm-mgr, and initiate
                            docker-swarm init on the master node first.



                            then login to the slave nodes using
                            docker-machine ssh docker1



                            Please note the token to join the master here, example output



                            docker swarm join --token SWMTKN-1-65v85za1nnkg4u09e1jbgtk86b3pl8ntawj0ha6m6upzbyho5z-4fasp7wt5f13ts16arypbrpa1 192.168.99.100:2377


                            and run from docker1 node and docker2 node



                            docker swarm join --token xxxLOREMIPSUMTOKENx ip:2377


                            To confirm the above, login to the master node



                            docker-machine ssh aws-swarm-mgr


                            From within, the master aws node



                            aws-swarm-mgr> docker node ls


                            That should do it.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 17 '17 at 12:30









                            Magnus Melwin

                            3711616




                            3711616






















                                up vote
                                0
                                down vote













                                I have a docker swarm on AWS with three nodes. I should see my web page through any three public IP address. I have opened the required security group stated on docker doc. I think they have this bug for their overlay driver...






                                share|improve this answer

























                                  up vote
                                  0
                                  down vote













                                  I have a docker swarm on AWS with three nodes. I should see my web page through any three public IP address. I have opened the required security group stated on docker doc. I think they have this bug for their overlay driver...






                                  share|improve this answer























                                    up vote
                                    0
                                    down vote










                                    up vote
                                    0
                                    down vote









                                    I have a docker swarm on AWS with three nodes. I should see my web page through any three public IP address. I have opened the required security group stated on docker doc. I think they have this bug for their overlay driver...






                                    share|improve this answer












                                    I have a docker swarm on AWS with three nodes. I should see my web page through any three public IP address. I have opened the required security group stated on docker doc. I think they have this bug for their overlay driver...







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Nov 19 at 18:53









                                    Chen Yu Hsieh

                                    11




                                    11






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Stack Overflow!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.





                                        Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                        Please pay close attention to the following guidance:


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f40321302%2fswarm-manager-does-not-connect-to-nodes-docker-daemons-on-aws%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        404 Error Contact Form 7 ajax form submitting

                                        How to know if a Active Directory user can login interactively

                                        Refactoring coordinates for Minecraft Pi buildings written in Python