Skip to content

Latest commit

 

History

History
50 lines (47 loc) · 2.47 KB

second-manager.adoc

File metadata and controls

50 lines (47 loc) · 2.47 KB

Drain Node

This script shows how to add a second manager to the cluster.

  1. Start 4 Amazon instances: aws ec2 run-instances --image-id ami-06116566 --count 4 --instance-type t2.micro --key-name arun@couchbase --security-groups swarm-mode

  2. Create a 3 node Swarm cluster using swarm-mode-amazon.adoc. Check the list of active nodes using docker node ls:

    ID                           HOSTNAME         MEMBERSHIP  STATUS  AVAILABILITY  MANAGER STATUS
    0yyap69qjg76ol5jbf811d5yz *  ip-172-31-14-33  Accepted    Ready   Active        Leader
    4a8oodtjhg017dr0xxjm2cpr4    ip-172-31-14-35  Accepted    Ready   Active
    70xqobszyfxsh6ussr38he6f5    ip-172-31-14-34  Accepted    Ready   Active

    It shows all nodes are active with one leader.

  3. Add 4th node as manager:

    ssh -o StrictHostKeyChecking=no -i /Users/arungupta/.ssh/aruncouchbase.pem ubuntu@<public-ip-master2> "docker swarm join --manager --secret mySecret --listen-addr <private-ip-master2>:2377 <private-ip-master1>:2377"

    This shows:

    Error response from daemon: Your node is in the process of joining the cluster but needs to be accepted by existing cluster member.
    To accept this node into cluster run "docker node accept duiwczeimfrznk9ab7gyi0lfm" in an existing cluster manager. Use "docker info" command to see the current Swarm status of your node.
  4. Check nodes using docker node ls:

    ID                           HOSTNAME        MEMBERSHIP  STATUS   AVAILABILITY  MANAGER STATUS
    2xftpki6053v3esg1uh9116hu    ip-172-31-1-44  Accepted    Ready    Active
    47x45mx43erudzz6lq4xkzmbc *  ip-172-31-1-43  Accepted    Ready    Active        Leader
    d16tvcy99yo8ucqfgckegtzx6    ip-172-31-1-41  Accepted    Ready    Active
    duiwczeimfrznk9ab7gyi0lfm                    Pending     Unknown  Active
  5. Accept the node using master1: docker node accept duiwczeimfrznk9ab7gyi0lfm. Alternatively, udpate existing Swarm manager to auto-accept new managers as docker update swarm --auto-accept manager.

  6. Check nodes again using docker node ls:

    ID                           HOSTNAME        MEMBERSHIP  STATUS  AVAILABILITY  MANAGER STATUS
    2xftpki6053v3esg1uh9116hu    ip-172-31-1-44  Accepted    Ready   Active
    47x45mx43erudzz6lq4xkzmbc *  ip-172-31-1-43  Accepted    Ready   Active        Leader
    d16tvcy99yo8ucqfgckegtzx6    ip-172-31-1-41  Accepted    Ready   Active
    duiwczeimfrznk9ab7gyi0lfm    ip-172-31-1-42  Accepted    Ready   Active        Reachable