Skip to content

Instantly share code, notes, and snippets.

@brijesh-deb
Last active June 27, 2018 01:19
Show Gist options
  • Save brijesh-deb/6a75b8e01af7c00b333009ea29f44681 to your computer and use it in GitHub Desktop.
Save brijesh-deb/6a75b8e01af7c00b333009ea29f44681 to your computer and use it in GitHub Desktop.
#Docker #Swarm

Docker Swarm setup in EC2 instance

Setup Initial node

  • Launch a new EC2 instance
  • Add TCP/2377 to security group
  • Install docker on the instance
  • Command
    • docker swarm init --advertise-addr [EC2 instance private IP]:2377 --listen-addr [EC2 instance private IP]:2377

Add Manager node

  • Launch a new EC2 instance
  • Add TCP/2377 to security group
  • Install docker on the instance
  • Execute command in initial manager node to get manager token
    • docker swarm join-token manager
  • Execute manager token in current node

Add Worker node

  • Launch a new EC2 instance
  • Add TCP/2377 to security group
  • Install docker on the instance
  • Execute command in initial manager node to get worker token
    • docker swarm join-token worker
  • Execute worker token in current node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment