Mesos on coreOS
-
Upload
- -
Category
Technology
-
view
6.135 -
download
0
Transcript of Mesos on coreOS
![Page 1: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/1.jpg)
Mesos on CoreOS Docker Seoul Meetup #4 / Sep 5, 2015
by @subicura (김충섭)
![Page 2: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/2.jpg)
@subicuraPurpleworks Developer Ruby on Rails AngularJS, ReactJS CoreOS, Docker Openframeworks, OpenGL
![Page 3: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/3.jpg)
• Deploy • Capistrano • Docker • CoreOS • Mesos • Mesos on CoreOS
• Demo
![Page 4: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/4.jpg)
!DEPLOY
![Page 5: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/5.jpg)
1. CAPISTRANORemote multi-server automation tool
![Page 6: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/6.jpg)
!1. Get latest source
2. Install dependencies 3. Restart
![Page 7: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/7.jpg)
!1. Get latest source
2. Install dependencies 3. Restart
![Page 8: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/8.jpg)
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…
![Page 9: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/9.jpg)
Googling!!
![Page 10: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/10.jpg)
successfully deploy!!
but,
migration to another server or scale out?
![Page 11: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/11.jpg)
![Page 12: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/12.jpg)
2. DOCKERnew container technology
![Page 13: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/13.jpg)
Docker is an open platform for building, shipping and running distributed applications.
![Page 14: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/14.jpg)
before(capistrano)
!
![Page 15: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/15.jpg)
!after(docker)
!Docker Images
![Page 16: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/16.jpg)
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……
![Page 17: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/17.jpg)
after
docker run -p 80:80 app
![Page 18: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/18.jpg)
MySQL Postgresql MongoDB
Redis RabbitMQ
Nginx Rails Application
…
Let’s start to make docker image!
![Page 19: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/19.jpg)
http://www.slideshare.net/MichaelDucy/the-future-of-everything-37344357
The Future of Everything
http://www.slideshare.net/MichaelDucy/the-future-of-everything-37344357
![Page 20: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/20.jpg)
How to deploy to remote server?
![Page 21: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/21.jpg)
docker -H $TARGET_DEPLOY_TCP pull $DOCKER_REGISTRY_NAME:latest docker -H $TARGET_DEPLOY_TCP stop $DOCKER_APP_NAMEdocker -H $TARGET_DEPLOY_TCP rm $DOCKER_APP_NAMEdocker -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
![Page 22: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/22.jpg)
centurion
![Page 23: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/23.jpg)
3. CoreOSfor container
![Page 24: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/24.jpg)
CoreOS is designed to give you compute
capacity that is dynamically scaled and managed
![Page 25: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/25.jpg)
A Minimal Operating System Painless Updating
Docker Containers Clustered By Default
![Page 26: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/26.jpg)
A highly-available key value store
/services/web/web_1 172.17.8.101:49155
valuekey
directory
![Page 27: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/27.jpg)
Fleet
Distributed init system
![Page 28: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/28.jpg)
![Page 29: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/29.jpg)
Great tools Great features
Powerful
![Page 30: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/30.jpg)
Require install agent (*not ansible) Too many feature
![Page 31: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/31.jpg)
Fleet is enough?
![Page 32: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/32.jpg)
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
![Page 33: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/33.jpg)
4. MesosA distributed systems kernel
![Page 34: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/34.jpg)
Program against your datacenter like it’s a single pool of resources
![Page 35: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/35.jpg)
http://techcrunch.com/2014/06/09/mesosphere-grabs-10m-in-series-a-funding-to-transform-datacenters/
![Page 36: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/36.jpg)
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
![Page 37: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/37.jpg)
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
![Page 38: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/38.jpg)
Mesos on CoreOS
![Page 39: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/39.jpg)
bootstrapping a cluster system
Fleet
![Page 40: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/40.jpg)
DEMO
![Page 41: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/41.jpg)
Master
Slave
Slave
Slave
zookeeper mesos master(5050) marathon(8080)
![Page 42: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/42.jpg)
Master
Slave
Slave
Slave
mesos slave
mesos slave
mesos slave
zookeeper mesos master(5050) marathon(8080)
![Page 43: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/43.jpg)
echo test
Deploy and manage containers
![Page 44: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/44.jpg)
echo test
web server x 3
Deploy and manage containers
![Page 45: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/45.jpg)
echo test
web server x 3
fleet-ui
Deploy and manage containers
![Page 46: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/46.jpg)
Service Discovery
![Page 47: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/47.jpg)
172.17.8.101:31524
172.17.8.102:31512
172.17.8.103:31533
![Page 48: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/48.jpg)
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
![Page 49: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/49.jpg)
Master
Slave
Slave
Slave
mesos slave
mesos slave
mesos slave
registrator
registrator
registrator
zookeeper mesos master(5050) marathon(8080)
![Page 50: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/50.jpg)
172.17.8.101:31524
172.17.8.102:315
172.17.8.103:315
/services
"
CHANGE!?
![Page 51: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/51.jpg)
confd
172.17.8.101:31524
172.17.8.102:315
172.17.8.103:315
/services
"
CHANGE!?
Update Config
Reloadwhoami.sample.com -172.17.8.101:31524 -172.17.8.102:31512 -172.17.8.103:31533
![Page 52: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/52.jpg)
Master
Slave
Slave
Slave
mesos slave
mesos slave
mesos slavenginx-confd(80)
registrator
registrator
registrator
zookeeper mesos master(5050) marathon(8080)
![Page 53: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/53.jpg)
Thank you!
![Page 54: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/54.jpg)
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
![Page 55: Mesos on coreOS](https://reader031.fdocumento.com/reader031/viewer/2022022413/58ef7db31a28ab19268b45a7/html5/thumbnails/55.jpg)
Sample Source
✓ https://github.com/subicura/mesos-on-coreos