SlideShare a Scribd company logo
Build your own clouds
with Chef & MCollective


Jonathan Weiss
Who am I?

Working for Peritor in Berlin, Germany

Written, maintain, or involved in
   Webistrano
   Capistrano
   SimplyStored
   Happening
   The great fire of London

http://github.com/jweiss

@jweiss




                                         2
Scalarium


Amazon EC2 Cluster Management
   Auto-Config
   Self-Healing
   Auto-Scaling
   One-click-deployment




www.scalarium.com




                                3
Cloud Computing




         Cloud Computing


                           4
5
6
What you get

             Open
             Solaris       Oracle                 Suse

                                       Windows
   Linux
                  Ubuntu


                              CentOS             Red
           IBM
                                                 Hat




                 Infrastructure as a Service
What you really want

    Load
   balancer



  App server



   Database

       Fully configured stack of servers, dependencies, firewalls, …
                                     +
                      your own application deployed
Automation is
    needed for

     • Configuration
     • Healing

     • Scaling

     • Deployment




flickr.com/photos/torek/3788181603
Automation Solutions
Reasons to build your own


  In-house capacity



  Governance: Security and regulations



  Flexibility (or lack of…)




                                          11
Ingredients




              12
Components

                  Communication	

   Host
configuration	

                                     Command &
                                      Control
Command & Control


Responsibilities:
   Communication with IaaS API


   User Interface (Web, CLI, API):
    Query, deploy, start, stop


   Repository of projects &configuration


   Controls which hosts do what&when




                                           14
Command & Control


Responsibilities:                          Implementation:
   Communication with IaaS API               Fog & other API implemenations


   User Interface (Web, CLI, API):           Rails
    Query, deploy, start, stop


   Repository of projects &configuration      CouchDB


   Controls which hosts do what&when         Async wokers & agents




                                                                           15
Communication


Responsibilities:
   Distribute commands and responses
    in a scalable & fault tolerant way




                                         16
Communication


Responsibilities:                        Implementation:
   Distribute commands and responses       MCollective / ActiveMQ
    in a scalable & fault tolerant way




                                                                      17
Host Configuration


Responsibilities:
   Actually executes commands


   Responds to cluster changes


   Ensures local host is configured
   according to commands:
   Install software, start/stop services, ...




                                                18
Host Configuration


Responsibilities:                               Implementation:
   Actually executes commands                     Chef


   Responds to cluster changes                    MCollective Agents


   Ensures local host is configured
   according to commands:
   Install software, start/stop services, ...




                                                                         19
Host Configuration
Bootstrapping new servers




                            20
Chef


Open Source Provisioning Tool
   Configures your servers
   Cookbooks & recipes
   Ruby DSL




                                21
Chef




       22
Chef Server




              23
Chef Solo




            24
Chef-Solo vs. Chef-Server

Chef-Server
   Complex
   No concept of different environments, e.g. staging vs. production
   Didn‘t want to run one Chef server per project (and env)
   No lifecycle events, e.g. deployment vs. bootstrap
   Pull vs. push




Chef-Solo
   MCollective agents to push cookbooks and Chef runs




                                                                        25
Cookbooks

    Cookbooks	


           apache2	


           memcached	


           mysql	



           rails	

                          26
Memcached Cookbook

    Cookbooks	


           memcachd	


                   attributes	


                   recipes	


                   templates	

                                   27
Memcached Cookbook
   memcached	


         attributes	


                  default.rb	

          recipes	


               service.rb	


                  install.rb	


          templates	


                    default	


                            memcached.conf.erb	

                                                    28
Attributes


cookbooks/memcached/attributes/default.rb




Set default values for variables to use in recipes & templates


                                                                 29
Recipes


cookbooks/memcached/recipes/service.rb




Actual instructions to execute


                                         30
Recipes


cookbooks/memcached/recipes/install.rb




                                         31
Templates
cookbooks/memcached/templates/default/memcached.conf.erb




                                                           32
Chef Solo Run
 Configuration JSON: /etc/chef/solo.json




 Run Chef Solo




                                          33
Available Resources

 Cookbook File   Ifconfig            SCM
 Cron            Link               Script
 Deploy          Log                Service
 Directory       Mdadm              Subversion
 Erlang Call     Mount              Template
 Execute         Package            User
 File            Remote Directory
 Git             Remote File
 Group           Route
 HTTP Request    Ruby Block




                                                 34
Deployment with Chef

Deploy resource
   Compatible with Capistrano layout
   Supports Capistrano hooks via deploy/hook_name.rb
   Handles source checkout & callbacks



Call custom script
   Arbitrary options, e.g:
   Download WAR file
   Compile Source
   …
   Automatically wrapped in Chef error handling & notifications



                                                                  35
Deploy Resource




                  36
Communication
Relaying messages to servers




                               37
Marionette Collective



„a framework to build server orchestration
 or parallel job execution systems“




                                             38
MCollective Architecture




                           39
RPC Calls
 Service: chef-run	

 Service: update-cookbooks	



                                                                    Client	

                                                     Discover 
                                                      agents	

 Service: chef-run	

 Service: update-cookbooks	




                                Message Routing	


    Agents
RPC Calls
 Service: chef-run	

 Service: update-cookbooks	



                                                                 Client	



 Service: chef-run	

 Service: update-cookbooks	

                         Call
                                                     agents	



                                Message Routing	


    Agents
MCollective Agent




                    42
Calling an Agent




                   43
Calling an Agent




                   44
Filters  Facts

Limit responding agents by filters of facts/classes:



Classes
   Arbitary used defined settings  role
   Can be set by userdata

Facts
   Information about local machine
   Plugins for Chef/Ohai, Puppet/Facter
   Examples: Linux version, installed packages, ....




                                                        45
Filters on the Command Line




                              46
Filters in Code




                  47
MCollective  Chef

Call Chef action on remote agents/machines




                                             48
MCollective  Chef

Agent running Chef




                     49
Security

Clients
   Stomp / ActiveMQ user
   AES+RSA plugins: encrypt  sign every message
   SSL plugin: sign every message
   TLS for connection encryption

Middleware
   Topic permissions and subclusters

Agents
   All client security measures available
   RPC authorization and auditing




                                                    50
Scalability  Redundancy


ActiveMQ offers different means
   Network of brokers
   Broker clusters
   Master/Slave




                                  51
Command  Control
Controlling the cloud




                        52
Command Software

General capabilities
   Stores cluster model
   Interacts with IaaS API (EC2, VMWare  friends)
   Handles recovery  presence
   Integrates communication solution
   Generates host configuration / Chef events



Custom requirements
   User management  authorization
   Business rules  processes
   Deployment recipes  scripts



                                                      53
Server Roles




               54
Command Software




                   55
Experiences

Chef
   Flexible and powerful
   Easy to learn first steps - easy to write spaghetti recipes
   Some annoyances: pseudo idempotent and 2 phases
   “Write once, test everywhere”



MCollective
   Simple and robust
   Missing presences and events
    (Nanite has them but has different problems)
   Integrated with Puppet in the future?



                                                                 56
QA
Peritor GmbH
Blücherstr. 22, Hof III Aufgang 6
10961 Berlin
Tel.: +49 (0)30 69 20 09 84 0
Fax: +49 (0)30 69 20 09 84 9
Internet: www.peritor.com
E-Mail: info@peritor.com



© Peritor GmbH - Alle Rechte vorbehalten
Idempotent

Bug or feature?




                  58
Will never happen, even if
/data/logs/redhat will be created!




                              59
Two Phases of Chef

1) Compile

   Load all attributesrecipes and build list of actions/dependencies

   Compute attribute tree



2) Run                                   Random Ruby Code runs here
   Actually execute the resources




                                                                        60
Two Phases of Chef

 Use only_if and not_if




 Tell Chef to execute your ressource during compile phase




                                                             61

More Related Content

DOCX
Respiracion de las tortugas
PPT
Anatomia y fisiologia circulatoria en peces
PDF
Catálogo para protozoarios
PPTX
Bovinos imfo
KEY
Write php deploy everywhere
PPTX
Puppet at Scale – Case Study of PayPal's Learnings - PuppetConf 2013
PDF
Masterless puppet
PDF
Puppet Camp Tokyo 2014: Why we stopped using Puppet Agent Daemon
Respiracion de las tortugas
Anatomia y fisiologia circulatoria en peces
Catálogo para protozoarios
Bovinos imfo
Write php deploy everywhere
Puppet at Scale – Case Study of PayPal's Learnings - PuppetConf 2013
Masterless puppet
Puppet Camp Tokyo 2014: Why we stopped using Puppet Agent Daemon

Viewers also liked (6)

PDF
Demystifying puppet
PDF
Puppet Camp DC 2014: Managing Puppet with MCollective
PDF
Introduction to orchestration using Mcollective
PDF
Continuous Deployment Applied at MyHeritage
PDF
PuppetConf track overview: Modern Infrastructure
KEY
11 Ways to Hack Puppet for Fun and Productivity - Luke Kanies - Velocity 2012
Demystifying puppet
Puppet Camp DC 2014: Managing Puppet with MCollective
Introduction to orchestration using Mcollective
Continuous Deployment Applied at MyHeritage
PuppetConf track overview: Modern Infrastructure
11 Ways to Hack Puppet for Fun and Productivity - Luke Kanies - Velocity 2012
Ad

Similar to Build your own clouds with Chef and MCollective (20)

PPTX
1 DevOp vs 1.000 servers - Amazon EC2 and Chef automation intro
PDF
Infrastructure Automation with Chef
PDF
Priming Your Teams For Microservice Deployment to the Cloud
PDF
SF DevOps: Introducing Vagrant
PDF
Big Gains With Little Virtual Machines Sumeet Mehra
PDF
Getting Started with MariaDB with Docker
PDF
Aws sdk-php-guide
PDF
Scalr Demo
PDF
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
PPTX
Kubernetes workshop -_the_basics
PPTX
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
PPTX
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
PPTX
VMworld 2015: Build and Run Cloud Native Apps in your Software Defined Data C...
PDF
Red Hat and kubernetes: awesome stuff coming your way
PDF
Kubernetes Clusters as a Service with Gardener
PDF
Operator Framework Overview
PDF
Zero to Serverless in 60s - Anywhere
PDF
Apache Kafka 2.3 + Confluent Platform 5.3 => What's New?
ODP
DevOps and Chef improve your life
PPTX
Project Gardener - EclipseCon Europe - 2018-10-23
1 DevOp vs 1.000 servers - Amazon EC2 and Chef automation intro
Infrastructure Automation with Chef
Priming Your Teams For Microservice Deployment to the Cloud
SF DevOps: Introducing Vagrant
Big Gains With Little Virtual Machines Sumeet Mehra
Getting Started with MariaDB with Docker
Aws sdk-php-guide
Scalr Demo
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
Kubernetes workshop -_the_basics
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
VMworld 2015: Build and Run Cloud Native Apps in your Software Defined Data C...
Red Hat and kubernetes: awesome stuff coming your way
Kubernetes Clusters as a Service with Gardener
Operator Framework Overview
Zero to Serverless in 60s - Anywhere
Apache Kafka 2.3 + Confluent Platform 5.3 => What's New?
DevOps and Chef improve your life
Project Gardener - EclipseCon Europe - 2018-10-23
Ad

More from Jonathan Weiss (20)

PDF
Docker on AWS OpsWorks
PDF
ChefConf 2014 - AWS OpsWorks Under The Hood
PDF
AWS OpsWorks & Chef at the Hamburg Chef User Group 2014
PPTX
DevOpsDays Amsterdam - Observations in the cloud
PDF
Amazon SWF and Gordon
PDF
Introduction to Backbone.js
PDF
Scalarium and CouchDB
PDF
NoSQL - Motivation and Overview
PDF
NoSQL - An introduction to CouchDB
PDF
Running on Amazon EC2
PDF
Amazon EC2 in der Praxis
PDF
Rails in the Cloud
PDF
EventMachine
PDF
CouchDB on Rails
PDF
Rails in the Cloud - Experiences from running on EC2
PDF
CouchDB on Rails - RailsWayCon 2010
PDF
CouchDB on Rails - FrozenRails 2010
PDF
NoSQL - Post-Relational Databases - BarCamp Ruhr3
PDF
Ruby on CouchDB - SimplyStored and RockingChair
PDF
No SQL - BarCamp Nürnberg 2010
Docker on AWS OpsWorks
ChefConf 2014 - AWS OpsWorks Under The Hood
AWS OpsWorks & Chef at the Hamburg Chef User Group 2014
DevOpsDays Amsterdam - Observations in the cloud
Amazon SWF and Gordon
Introduction to Backbone.js
Scalarium and CouchDB
NoSQL - Motivation and Overview
NoSQL - An introduction to CouchDB
Running on Amazon EC2
Amazon EC2 in der Praxis
Rails in the Cloud
EventMachine
CouchDB on Rails
Rails in the Cloud - Experiences from running on EC2
CouchDB on Rails - RailsWayCon 2010
CouchDB on Rails - FrozenRails 2010
NoSQL - Post-Relational Databases - BarCamp Ruhr3
Ruby on CouchDB - SimplyStored and RockingChair
No SQL - BarCamp Nürnberg 2010

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Getting Started with Data Integration: FME Form 101
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Encapsulation_ Review paper, used for researhc scholars
Reach Out and Touch Someone: Haptics and Empathic Computing
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Spectral efficient network and resource selection model in 5G networks
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
cloud_computing_Infrastucture_as_cloud_p
SOPHOS-XG Firewall Administrator PPT.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Getting Started with Data Integration: FME Form 101
Per capita expenditure prediction using model stacking based on satellite ima...
MIND Revenue Release Quarter 2 2025 Press Release
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Machine learning based COVID-19 study performance prediction
Unlocking AI with Model Context Protocol (MCP)
Heart disease approach using modified random forest and particle swarm optimi...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
OMC Textile Division Presentation 2021.pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...

Build your own clouds with Chef and MCollective