利用 Mesos 打造高延展性 Container 環境 Frank, Microsoft MTC
About Me Developer @ Yahoo! DevOps @ HTC Technical Architect @ MSFT
Agenda About Docker Manage containers Apache Mesos Mesosphere DC/OS
application = application code + infrastructure code
Multiplicity of hardware environments Multiplicity of Stacks Static website nginx 1.5 + modsecurity + openssl + bootstrap 2 Background workers Python 3.0 + celery + pyredis + libcurl + ffmpeg + libopencv + nodejs + phantomjs User DB postgresql + pgv8 + v8 Web frontend Ruby + Rails + sass + Unicorn Queue Redis + redis-sentinel Analytics DB hadoop + hive + thrift + OpenJDK API endpoint Do services and apps interact appropriately? Python 2.7 + Flask + pyredis + celery + psycopg + postgresql-client Development VM Customer Data Center QA server Public Cloud Disaster recovery Production Servers Production Cluster Contributor s laptop Can I migrate smoothly and quickly?
About Docker Docker allows you to package an application with all of its dependencies into a standardized unit for software development. Light weight Quick scale Secure
Virtual machine VS. Container
The underlying technology Namespaces Control group Union file system
Images and Layers
Demo Run Jenkins container with persistent and sharable volume docker run -t -d -p 80:8080 -p 50000:50000 -v /tmp/my_jenkins_home:/var/jenkins_home jenkins
Docker & Microsoft ASP.NET 5 Windows Container
ASP.NET 5 ASP.NET 5 is a new open-source and cross-platform framework for building modern cloud-based Web applications using.net
Demo Running ASP.NET with linux docker container
Windows Container Window Container & Hyper-V Container Manage by Docker/PowerShell
Ways for Container management Docker Compose Docker Swarm Mesosphere DC/OS
Docker Compose Compose is a tool for defining and running multi-container Docker applications.
Apache Mesos A distributed systems kernel Provides applications (e.g., Hadoop, Spark, Kafka, Elastic Search) with API s for resource management and scheduling across entire datacenter and cloud environments.
Apache Mesos Features Scalability to 10,000s of nodes Fault-tolerant replicated master and slaves using ZooKeeper Support for Docker containers Native isolation between tasks with Linux Containers Multi-resource scheduling (memory, CPU, disk, and ports) Java, Python and C++ APIs for developing new parallel applications Web UI for viewing cluster state
Mesos frameworks Apache Aurora Chronos Marathon There are more
Mesosphere DC/OS The Datacenter Operating System (DC/OS) is a distributed operating system based on theapache Mesos distributed systems kernel. It integrates several battle-tested open-source components to enable the management of multiple machines as if they were a single computer.
Azure Container Service Create an optimized container hosting solution Manage container application with familiar tools: DC/OS or Docker Swarm
Marathon Marathon is a production-grade container orchestration platform for Mesosphere's Datacenter Operating System (DCOS) and Apache Mesos.
orchestrates both apps and frameworks Scaling and fault recovery 1. Scale out search service & rails 2. Fault recovery when underlying resource failure
Marathon Feature High Availability Multiple Container runtimes (mesos container & docker) UI & APIs Stateful apps Constraints Service Discovery & load balancing Event Subscription
Demo: Deploy Stateless app Deploy nginx container with Marathon Rolling update when restart Scale containers
Demo: Deploy nginx to public Agent Deploy nginx container with Marathon on ResourceRole: slave_public and port 80 constraint
Demo: Deploy Stateful application Deploy PostgreSQL with persistent volume
Demo: Service Discovery mesos-dns marathon-lb
Marathon: Healthy Checks
Summarization Get Start with Azure Container Service Explore more with Mesos, DC/OS and Marathon Build your own application PaaS
Q & A
Thank you!