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.

Mesos on coreOS

8,475 views

Published on

Why deploy mesos with CoreOS?
How to deploy mesos with CoreOS?

Published in: Technology

Mesos on coreOS

  1. 1. Mesos on CoreOS Docker Seoul Meetup #4 / Sep 5, 2015 by @subicura (김충섭)
  2. 2. @subicura Purpleworks Developer Ruby on Rails AngularJS, ReactJS CoreOS, Docker Openframeworks, OpenGL
  3. 3. • Deploy • Capistrano • Docker • CoreOS • Mesos • Mesos on CoreOS • Demo
  4. 4. DEPLOY
  5. 5. 1. CAPISTRANO Remote multi-server automation tool
  6. 6. 1. Get latest source 2. Install dependencies 3. Restart
  7. 7. 1. Get latest source 2. Install dependencies 3. Restart
  8. 8. Failed to install dependencies!! Why??? conflicting library version ruby version is too old gcc version is too old 8080 port already in use unknown error…
  9. 9. Googling!!
  10. 10. successfully deploy!! but, migration to another server or scale out?
  11. 11. 2. DOCKER new container technology
  12. 12. Docker is an open platform for building, shipping and running distributed applications.
  13. 13. before(capistrano)
  14. 14. after(docker) Docker Images
  15. 15. before $ cd $ git clone git://github.com/sstephenson/rbenv.git .rbenv $ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc $ echo 'eval "$(rbenv init -)"' >> ~/.zshrc $ exec $SHELL $ mkdir -p ~/.rbenv/plugins $ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build $ git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash $ rbenv install 2.2.2 $ rbenv global 2.2.2 $ ruby install bundler … …
  16. 16. after docker run -p 80:80 app
  17. 17. MySQL Postgresql MongoDB Redis RabbitMQ Nginx Rails Application … Let’s start to make docker image!
  18. 18. http://www.slideshare.net/MichaelDucy/the-future-of-everything-37344357 The Future of Everything http://www.slideshare.net/MichaelDucy/the-future-of-everything-37344357
  19. 19. How to deploy to remote server?
  20. 20. docker -H $TARGET_DEPLOY_TCP pull $DOCKER_REGISTRY_NAME:latest docker -H $TARGET_DEPLOY_TCP stop $DOCKER_APP_NAME docker -H $TARGET_DEPLOY_TCP rm $DOCKER_APP_NAME docker -H $TARGET_DEPLOY_TCP run -d --name $DOCKER_APP_NAME -p 80:80 -p 443:443 -v /data/www:/var/www/upload $DOCKER_REGISTRY_NAME:latest Docker Host docker daemon
  21. 21. centurion
  22. 22. 3. CoreOS for container
  23. 23. CoreOS is designed to give you compute capacity that is dynamically scaled and managed
  24. 24. A Minimal Operating System Painless Updating Docker Containers Clustered By Default
  25. 25. A highly-available key value store /services/web/web_1 172.17.8.101:49155 valuekey directory
  26. 26. Fleet Distributed init system
  27. 27. Great tools Great features Powerful
  28. 28. Require install agent (*not ansible) Too many feature
  29. 29. Fleet is enough?
  30. 30. Fleet Distribute systemd = low-level Difficult cluster resource management (No check CPU/Memory/Storage) Lack of health check option Lack of rolling restarts strategy Lack of GUI tool
  31. 31. 4. Mesos A distributed systems kernel
  32. 32. Program against your datacenter like it’s a single pool of resources
  33. 33. http://techcrunch.com/2014/06/09/mesosphere-grabs-10m-in-series-a-funding-to-transform-datacenters/
  34. 34. Mesos began as a research project in the UC Berkeley RAD Lab Twitter, Facebook, Apple, Airbnb, Netflix, eBay, … using mesos efficient resource isolation and sharing across distributed applications supports a high availability mode (with Marathon) support docker (from 0.20.0) UI available Job Scheduler (with Chronos) support Hadoop, Kafka, Spark
  35. 35. mesos (with marathon) fleet configuration JSON low-level shell command cluster resource management yes no health check http with many option process check rolling restart strategy yes no GUI yes no
  36. 36. Mesos on CoreOS
  37. 37. bootstrapping a cluster system Fleet
  38. 38. DEMO
  39. 39. Master Slave Slave Slave zookeeper mesos master(5050) marathon(8080)
  40. 40. Master Slave Slave Slave mesos slave mesos slave mesos slave zookeeper mesos master(5050) marathon(8080)
  41. 41. echo test Deploy and manage containers
  42. 42. echo test web server x 3 Deploy and manage containers
  43. 43. echo test web server x 3 fleet-ui Deploy and manage containers
  44. 44. Service Discovery
  45. 45. 172.17.8.101:31524 172.17.8.102:31512 172.17.8.103:31533
  46. 46. 172.17.8.101:31524 172.17.8.102:315 172.17.8.103:315 /services ㄴwhoami ㄴ1 - 172.17.8.101:31524 ㄴ2 - 172.17.8.102:31512 ㄴ3 - 172.17.8.103:31533 Registrator
  47. 47. Master Slave Slave Slave mesos slave mesos slave mesos slave registrator registrator registrator zookeeper mesos master(5050) marathon(8080)
  48. 48. 172.17.8.101:31524 172.17.8.102:315 172.17.8.103:315 /services CHANGE!?
  49. 49. confd 172.17.8.101:31524 172.17.8.102:315 172.17.8.103:315 /services CHANGE!? Update Config Reload whoami.sample.com -172.17.8.101:31524 -172.17.8.102:31512 -172.17.8.103:31533
  50. 50. Master Slave Slave Slave mesos slave mesos slave mesos slavenginx-confd(80) registrator registrator registrator zookeeper mesos master(5050) marathon(8080)
  51. 51. Thank you!
  52. 52. Reference ✓ https://www.docker.com/ ✓ http://coreos.com ✓ http://mesos.apache.org/ ✓ https://mesosphere.github.io/marathon/ ✓ https://github.com/gliderlabs/registrator ✓ https://github.com/kelseyhightower/confd
  53. 53. Sample Source ✓ https://github.com/subicura/mesos-on-coreos

×