Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Clustering Docker with Docker Swarm on openSUSE

470 views

Published on

My slide on openSUSE Asia Summit 2016
Yogyakarta October 1st, 2016

Published in: Technology
  • Be the first to comment

Clustering Docker with Docker Swarm on openSUSE

  1. 1. Clustering Docker with Docker Swarm on openSUSE® Saputro Aryulianto ary@glibogor.or.id / saputroyulianto@gmail.com
  2. 2. 2 Hi, • Ary (not Ari or Arie) • GNU/Linux Bogor Activist @GLiBogor • System Administrator at Pusilkom UI • Student at STIKOM Binaniaga Bogor • Local Commitee at GNOME.Asia Summit 2015 • Amateur Dota2 Player :)
  3. 3. What is Docker?
  4. 4. 4 Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications, whether on laptops, data center VMs, or the cloud.
  5. 5. 5 Virtual Machines vs Containers
  6. 6. Docker Swarm
  7. 7. 7 Docker Swarm is native clustering for Docker. It turns a pool of Docker hosts into a single, virtual Docker host.
  8. 8. 8 Today
  9. 9. 9 • Individually? Why not if you like that • On a cluster with a manager? Yeah!! How can I manage them?
  10. 10. 10 With Docker Swarm
  11. 11. 11 Lab Topology
  12. 12. 12 Install and Setup Docker # zypper in -y docker # sed -i '/DOCKER_OPTS=/s/^/#/g' /etc/sysconfig/docker # echo 'DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --cluster- store=consul://10.2.2.99:8500 --cluster- advertise=10.2.2.XX:2375"' >> /etc/sysconfig/docker # systemctl restart docker.service # systemctl enable docker.service # systemctl status docker.service * XX= node IP
  13. 13. 13 Running consul discovery backend & Swarm manager # docker run -d --restart=always --name=consul -h consul -p 8500:8500 progrium/consul -server -bootstrap # docker run -d --restart=always --name swarm- manager -h swarm-manager -p 4000:4000 swarm manage -H :4000 --replication --advertise 10.2.2.99:4000 consul://10.2.2.99:8500
  14. 14. 14 Join Swarm Nodes # docker run -d --restart=always --name=swarm- node1 -h swarm-node1 swarm join --advertise=10.2.2.100:2375 consul://10.2.2.99:8500 # docker run -d --restart=always --name=swarm- node2 -h swarm-node2 swarm join --advertise=10.2.2.200:2375 consul://10.2.2.99:8500 From Manager node verify # docker -H :4000 info
  15. 15. 15 Create Overlay Network # docker -H :4000 network create --driver overlay --subnet=172.31.0.0/16 overlay # docker -H :4000 network ls # docker -H :4000 network inspect overlay
  16. 16. 16 Verify Create Docker Guest from Manager node # docker -H :4000 run -d --name cirros1 -h cirros1 --net=overlay cirros init # docker -H :4000 run -d --name cirros2 -h cirros2 --net=overlay cirros init From Manager node verify # docker -H :4000 ps -a
  17. 17. 17 Verify (2) Inspect docker guest IP # docker -H :4000 inspect cirros1 | grep "172.31" # docker -H :4000 inspect cirros2 | grep "172.31" Test ping from other guest # docker -H :4000 exec -it cirros1 bash # ping -c 3 172.31.x.x
  18. 18. Shipyard?
  19. 19. 19 Shipyard Composable Docker Management. Built on Docker Swarm, Shipyard gives you the ability to manage Docker resources including containers, images, private registries and more.
  20. 20. 20 Running Shipyard # docker run -ti -d --restart=always -h shipyard- rethinkdb --name shipyard-rethinkdb rethinkdb # docker run -ti -d --restart=always --name shipyard-controller -h shipyard-controller --link shipyard-rethinkdb:rethinkdb --link swarm- manager:swarm -p 8080:8080 shipyard/shipyard:latest server -d tcp://swarm:4000
  21. 21. 21 Next? • On-failure Rescheduling • High Availability, State replication • Load Balancing • Etc.
  22. 22. Questions?
  23. 23. 23 More info • @aryulianto • http://aryulianto.com • http://github.com/aryulianto • http://twitter.com/saputroyulianto • http://facebook.com/saputro19
  24. 24. 24 Reference • https://docs.docker.com/engine/installation/linux/SUSE/ • https://docs.docker.com/engine/userguide/networking/get-starte d-overlay/ • https://docs.docker.com/swarm/install-manual/ • https://shipyard-project.com/docs/deploy/manual/ • http://utian.azoebs.com/2016/06/latihan-membuat-cluster-dock er-dengan.html
  25. 25. Thank you. Join the conversation, contribute & have a lot of fun! www.opensuse.org
  26. 26. 26 Have a Lot of Fun, and Join Us At: www.opensuse.org

×