• What we do
  • The People
  • About Us
  • Why Innovation Africa
  • Contact Us
Innovation AfricaCreating the Future Today
  • Feature Articles
  • Innovation
  • Agriculture
  • ICT
  • Technology
  • Entrepreneurship
  • Health
  • Store
  • Contact Us
Menu
  • Feature Articles
  • Innovation
  • Agriculture
  • ICT
  • Technology
  • Entrepreneurship
  • Health
  • Store
  • Contact Us
  • How to create a Swarm cluster with Docker

    March 29, 2015 Editor 0

    Buy Docker Cookbook.

    Buy Docker Cookbook.

    Editor’s note: this is an Early Release excerpt from Chapter 7 of Docker Cookbook by Sébastien Goasguen. The recipes in this book will help developers go from zero knowledge to distributed applications packaged and deployed within a couple of chapters. One of the key value propositions of Docker is app portability. The following will show you how to use Docker Machine to create a Swarm cluster across cloud providers.

    Problem

    You understand how to create a Swarm cluster manually (see Recipe 7.3), but you would like to create one with nodes in multiple public Cloud Providers and keep the UX experience of the local Docker CLI.

    Solution

    Use Docker Machine to start Docker hosts in several Cloud providers and bootstrap them automatically to create a swarm cluster.

    Warning

    This is an experimental feature in Docker Machine and is subject to change.

    The first thing to do is to obtain a swarm discovery token. This will be used during the bootstrapping process when starting the nodes of the cluster. As explained in Recipe 7.3, swarm features multiple discovery process. In this recipe, we used the service hosted by Docker, Inc. A discovery token is obtained by running a container based on the swarm image and running the create command. Assuming we do not have access to a Docker host already, we use docker-machine to create one solely for this purpose.

    [crayon-55183ef352347823919505/]

    With the token in hand, we can use docker-machine and multiple public Cloud drivers to start worker nodes. We can start a swarm head node on VirtualBox, a worker on DigitalOcean and another one on Azure.

    Tip

    Do not start a swarm head in a public cloud and a worker on your localhost with VirtualBox. Chances are the head will not be able to route network traffic to your local worker node. It is possible to do, but you would have to open ports on your local router.

    [crayon-55183ef352358549825019/]

    Your swarm cluster is now ready. Your swarm head node is running locally in a Virtualbox VM, one worker node is running in DigitalOcean and another one in Azure. You can set the local docker-machine binary to use the head node running in VirtualBox and start using the swarm subcommands:

    [crayon-55183ef352361589042139/]

    Discussion

    If you start a container, swarm will schedule it in round-robin fashion on the cluster. For example, starting three nginx container in a for loop with:

    [crayon-55183ef352369103904211/]

    Will lead to three nginx container on the three nodes in your cluster. Remember that you will need to open port 80 on the instances running in the Cloud to access the container.

    [crayon-55183ef352370279358638/]

    Tip

    Do not forget to remove the machine you started in the Cloud.

    See Also

    • Using Docker machine with Docker swarm.

    Editor’s note: if you’re interested in learning more about networking at scale, you’ll want to check out Jay Edwards’ Distributed Systems training session at Velocity in Santa Clara May 27-29, 2015.


    Go to Source

    Related articles across the web

    • Creating Development Environments with Vagrant

    Related Posts

    • Constructing a multilevel spatial approach in ethnic entrepreneurship studies
    • Tackling Inequalities in Development PoliciesTackling Inequalities in Development Policies
    • Africa: Sony Introduces “Shake 7”Africa: Sony Introduces “Shake 7”
    • How to Improve Your Business WritingHow to Improve Your Business Writing
    • How Banks Should Finance the Social Sector
    • Africa: How Mobile Phones Increased the Digital DivideAfrica: How Mobile Phones Increased the Digital Divide
    Sovrn
    Share

    Categories: Technology

    Tags: Docker, Docker Machine

    How You Can Reach 300,000 Tanzanians with Proven Family Planning Information Redefining power distribution using big data

    Leave a Reply Cancel reply

    You must be logged in to post a comment.

Subscribe to our stories


 

Recent Posts

  • Entrepreneurial Alertness, Innovation Modes, And Business Models in Small- And Medium-Sized Enterprises December 30, 2021
  • The Strategic Role of Design in Driving Digital Innovation June 10, 2021
  • Correction to: Hybrid mosquitoes? Evidence from rural Tanzania on how local communities conceptualize and respond to modified mosquitoes as a tool for malaria control June 10, 2021
  • BRIEF FOCUS: Optimal spacing for groundnuts in smallholder farming systems June 9, 2021
  • COVID-19 pandemic: impacts on the achievements of Sustainable Development Goals in Africa June 9, 2021

Categories

Archives

Popular Post-All time

  • A review on biomass-based... 1k views
  • Can blockchain disrupt ge... 807 views
  • Apply Now: $500,000 for Y... 806 views
  • Test Your Value Propositi... 759 views
  • Prize-winning projects pr... 726 views

Recent Posts

  • Entrepreneurial Alertness, Innovation Modes, And Business Models in Small- And Medium-Sized Enterprises
  • The Strategic Role of Design in Driving Digital Innovation
  • Correction to: Hybrid mosquitoes? Evidence from rural Tanzania on how local communities conceptualize and respond to modified mosquitoes as a tool for malaria control
  • BRIEF FOCUS: Optimal spacing for groundnuts in smallholder farming systems
  • COVID-19 pandemic: impacts on the achievements of Sustainable Development Goals in Africa
  • Explicit knowledge networks and their relationship with productivity in SMEs
  • Intellectual property issues in artificial intelligence: specific reference to the service sector
  • Africa RISING publishes a livestock feed and forage production manual for Ethiopia
  • Transforming crop residues into a precious feed resource for small ruminants in northern Ghana
  • Photo report: West Africa project partners cap off 2020 with farmers field day events in Northern Ghana and Southern Mali

Tag Cloud

    africa African Agriculture Business Business model Business_Finance Company Crowdsourcing data Development East Africa economics Education Entrepreneur entrepreneurs Entrepreneurship ethiopia ghana Health_Medical_Pharma ict Information technology Innovation kenya knowledge Knowledge Management Leadership marketing mobile Mobile phone nigeria Open innovation Organization Research rwanda science Science and technology studies social enterprise social entrepreneurship south africa Strategic management strategy tanzania Technology Technology_Internet uganda

Categories

Archives

  • A review on biomass-based hydrogen production for renewable energy supply 1k views
  • Can blockchain disrupt gender inequality? 807 views
  • Apply Now: $500,000 for Your Big Data Innovations in Agriculture 806 views
  • Test Your Value Proposition: Supercharge Lean Startup and CustDev Principles 759 views
  • Prize-winning projects promote healthier eating, smarter crop investments 726 views

Copyright © 2005-2020 Innovation Africa Theme created by PWT. Powered by WordPress.org