Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Squashing the Heisenbugs

on

  • 1,739 views

Squashing the Heisenbugs (really Bohrbugs) is a talk that I gave at the Chariot CI Event on December 1st, 2010. Feel free to ask me any questions about it via email or twitter. Also, please hire us if ...

Squashing the Heisenbugs (really Bohrbugs) is a talk that I gave at the Chariot CI Event on December 1st, 2010. Feel free to ask me any questions about it via email or twitter. Also, please hire us if you're looking for any devops help.

Statistics

Views

Total Views
1,739
Slideshare-icon Views on SlideShare
1,739
Embed Views
0

Actions

Likes
0
Downloads
11
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Squashing the Heisenbugs Squashing the Heisenbugs Presentation Transcript

    • SQUASHING THE HEISENBUGS Trotter Cashion / Chariot CI Event 2010 http://www.flickr.com/photos/gliuoo/2539512435/sizes/z/in/photostream/
    • BOHRBUGSSQUASHING THE HEISENBUGS Trotter Cashion / Chariot CI Event 2010 http://www.flickr.com/photos/gliuoo/2539512435/sizes/z/in/photostream/
    • SQUASHING THE BOHRBUGS Trotter Cashion / Chariot CI Event 2010 http://www.flickr.com/photos/gliuoo/2539512435/sizes/z/in/photostream/
    • THIS WILL BE ON THE INTERNET!
    • CO-FOUNDER http://mashion.net
    • @CASHION http://www.charlesheflin.com/wp-content/uploads/2010/06/fail-whale.jpg
    • github.com/trotterhttp://gems.github.com/octocat.png
    • AGENDA
    • HEISENBUGS AND BOHRBUGS
    • THE MANUAL PROBLEM
    • CHEF
    • TYING CHEF INTO CI
    • QUESTIONS (AQAFT)
    • HEISENBUGShttp://upload.wikimedia.org/wikipedia/commons/8/84/Hindenburg_burning.jpg
    • OBSERVER EFFECT You Event
    • BOHRBUGS http://en.wikipedia.org/wiki/File:Bohr-atom-PAR.svg
    • MANDELBUGS
    • SCHRÖDINBUGS
    • NOOBBUGS
    • THE MANUAL PROBLEM
    • MYSQL http://www.dolphinsc.com/images/Dolphin.jpg
    • POSTGREShttp://images.buycostumes.com/mgen/merchandiser/32494.jpg
    • APACHE http://www.wallpapers-free.org/34/-/Apache_Longbow_Helicopter/
    • NGINXhttp://www.allbestwallpapers.com/travel-kremlin_and_red_square_fireworks,_moscow,_russia_wallpapers.html
    • Memcached
    • Memcached Redis
    • Memcached Redis Mongodb
    • Memcached Redis Mongodb Riak
    • Memcached Redis Mongodb Riak Cassandra
    • Memcached Redis Mongodb Riak Cassandra Project Voldemort
    • Memcached Redis Mongodb Riak Ubuntu Cassandra Project Voldemort
    • Memcached Redis Redhat Mongodb Riak Ubuntu Cassandra Project Voldemort
    • Memcached Redis Redhat Solaris Mongodb Riak Ubuntu Cassandra Project Voldemort
    • Memcached iptables Redis Redhat Solaris Mongodb Riak Ubuntu Cassandra Project Voldemort
    • Memcached iptables Redis Redhat Solaris Mongodb Riak Ubuntu Cassandra sshd Project Voldemort
    • Memcached iptables Redis Redhat Solaris Mongodb RiakDNS Servers Ubuntu Cassandra sshd Project Voldemort
    • Memcached iptables Redis Redhat Solaris Mongodb RiakDNS Servers Ubuntu Cassandra sshdTCP/IP internals Project Voldemort
    • We Idolize the Artisan Sysadmin
    • ... but what do we end up with?
    • SNOWFLAKES ... that become avalancheshttp://www.enviro-bc.ca/wp-content/uploads/2009/04/bowlake-aval_clair-israelson.jpg
    • BOHRBUGShttp://upload.wikimedia.org/wikipedia/commons/6/6d/Niels_Bohr.jpg
    • NO MORE MONEY! http://assets.troubledteenswizard.com/uploaded/WoW/nomoney1.jpg
    • We’re really left with two choices
    • Automate... or die.
    • Automation is not hard!
    • BASH
    • CFENGINEhttp://hackedgadgets.com/wp-content/2/LEGO_V8_Engine_1.jpg
    • PUPPET http://www.flickr.com/photos/willemvelthoven/381608678/sizes/l/
    • CHEF! http://www.flickr.com/photos/venndiagram/4891510333/sizes/l/
    • WRITTEN BY http://www.opscode.com/
    • WRITTEN IN http://www.prestonlee.com/wp-content/uploads/2008/09/ruby.png
    • Two Delicious Flavors
    • SERVERhttp://upload.wikimedia.org/wikipedia/commons/e/e0/Google%E2%80%99s_First_Production_Server.jpg
    • HOW IT WORKS
    • HOW IT WORKS Your Computer
    • HOW IT WORKS Your Computer Box toProvision
    • HOW IT WORKS Your Computer Box to Chef ServerProvision
    • HOW IT WORKS Your ComputerPrepare Box to Chef Server Provision
    • HOW IT WORKS Your ComputerPrepare What now? Box to Chef Server Provision
    • HOW IT WORKS Your ComputerPrepare Cookbooks What now? Box to Chef Server Provision
    • HOW IT WORKS Your ComputerPrepare Cookbooks What now? Box to Chef Server Provision Run!
    • SOLOhttp://www.pbs.org/parents/supersisters/han_solo-thumb-454x654.jpg
    • HOW IT WORKS
    • HOW IT WORKS YourComputer
    • HOW IT WORKS Your Box toComputer Provision
    • HOW IT WORKS Prepare Your Box toComputer Provision
    • HOW IT WORKS Prepare Your Box toComputer Cookbooks Provision
    • HOW IT WORKS Prepare Your Box toComputer Cookbooks Provision Go!
    • Chef Structure
    • CHEF HEIRARCHY Node Roles CookbooksCookbooks Recipes Attributes Templates Definitions
    • ROLES ARE REUSABLE! config/dev.json config/db.json roles/db.rb
    • GETTING GOINGhttp://www.flickr.com/photos/seandreilinger/959864706/sizes/o/
    • WHAT YOU NEED
    • WHAT YOU NEED Ruby & Rubygems
    • WHAT YOU NEED Ruby & Rubygems`gem install chef` Chef Gem
    • WHAT YOU NEED Ruby & Rubygems `gem install chef` Chef Gem`git clone http://github.com/ Chef Repo opscode/chef-repo.git`
    • COOKBOOKS.OPSCODE.COM http://cookbooks.opscode.com/
    • TERMINAL JUNKIES
    • TERMINAL JUNKIES•spatula search mysql
    • TERMINAL JUNKIES•spatula search mysql•spatula install mysql
    • TERMINAL JUNKIES•spatula search mysql•spatula install mysql•spatula show mysql
    • TERMINAL JUNKIES•spatula search mysql•spatula install mysql•spatula show mysql•... knife has similar functionality
    • GET THE BOX READY ssh db-one.host “install ruby”spatula prepare db-one.host = ssh db-one.host “install chef”
    • GO GO GO! rsync repo to db-one.hostspatula cook db-one.host db = ssh db-one.host “sudo chef-solo -c config/solo.rb -j config/db.json”
    • WITH CHEF SERVER install dependencies turn on client send cookbooks to client
    • DIGGING DEEPER http://media.photobucket.com/image/minecraft/bluekabal/roma/minesofroma.jpg
    • CHEF HEIRARCHY Node Roles CookbooksCookbooks Recipes Attributes Templates Definitions
    • A NODE// ./config/db_one.json{ "run_list": ["role[db]"] } Recipes and Roles go here
    • CHEF HEIRARCHY Node Roles CookbooksCookbooks Recipes Attributes Templates Definitions
    • A ROLE# ./roles/db.rbname "database"description "Be a DB"run_list [ "apache2", "mysql::server" ]
    • A ROLE# ./roles/db.rbname "database" Recipes to rundescription "Be a DB"run_list [ "apache2", "mysql::server" ]
    • A ROLE# ./roles/db.rbname "database"description "Be a DB"run_list [ "apache2", "mysql::server" ] ./cookbooks/apache2/recipes/default.rb
    • A ROLE# ./roles/db.rbname "database"description "Be a DB"run_list [ "apache2", "mysql::server" ] ./cookbooks/mysql/recipes/server.rb
    • CHEF HEIRARCHY Node Roles CookbooksCookbooks Recipes Attributes Templates Definitions
    • ATTRIBUTES# ./cookbooks/mysql/attributes/server.rbdefault[:mysql][:server_debian_password] = secure_passworddefault[:mysql][:server_root_password] = secure_passworddefault[:mysql][:server_repl_password] = secure_passworddefault[:mysql][:bind_address] = ipaddressdefault[:mysql][:datadir] = "/var/lib/mysql"# Tunablesdefault[:mysql][:tunable][:key_buffer] = "250M"default[:mysql][:tunable][:max_connections] = "800"default[:mysql][:tunable][:wait_timeout] = "180"
    • OVERRIDING ATTRIBUTES Node// ./config/db.json{ "mysql": { "server_root_password": "beefcake" },  "recipes": [ "mysql" ] } Role# ./roles/db.rbname "database"description "Be a DB"run_list [ "mysql::server" ]default_attributes :mysql => { :server_root_password => "beefcake" }
    • CHEF HEIRARCHY Node Roles CookbooksCookbooks Recipes Attributes Templates Definitions
    • THE RECIPE... PART 1# ./cookbooks/mysql/recipes/server.rbinclude_recipe "mysql::client"
    • THE RECIPE... PART 2package "mysql-server" do action :installend
    • THE RECIPE... PART 3template "/etc/mysql/my.cnf" do source "my.cnf.erb" owner "root" group "root" mode "0644" notifies :restart, resources(:service => "mysql"), :immediatelyend
    • CHEF HEIRARCHY Node Roles CookbooksCookbooks Recipes Attributes Templates Definitions
    • A TEMPLATE SAMPLEuser = mysqlpid-file = /var/run/mysqld/mysqld.pidsocket = /var/run/mysqld/mysqld.sockdatadir = <%= @datadir %>bind-address = <%= @node[:mysql][:bind_address] %>
    • A TEMPLATE SAMPLEuser = mysqlpid-file = /var/run/mysqld/mysqld.pidsocket = /var/run/mysqld/mysqld.sockdatadir = <%= @datadir %>bind-address = <%= @node[:mysql][:bind_address] %> OMG, ERB!!
    • A TEMPLATE SAMPLEuser = mysqlpid-file = /var/run/mysqld/mysqld.pidsocket = /var/run/mysqld/mysqld.sockdatadir = <%= @datadir %>bind-address = <%= @node[:mysql][:bind_address] %> From Attributes
    • A TEMPLATE SAMPLEuser = mysqlpid-file = /var/run/mysqld/mysqld.pidsocket = /var/run/mysqld/mysqld.sockdatadir = <%= @datadir %> From Templatebind-address = <%= @node[:mysql][:bind_address] %>
    • ASSIGNING VARIABLEStemplate "/etc/mysql/my.cnf" do source "my.cnf.erb" owner "root" group "root" mode "0644" variables :datadir => “/var/lib/mysql”end
    • CHEF HEIRARCHY Node Roles CookbooksCookbooks Recipes Attributes Templates Definitions
    • DEFINITIONSdefine :apache_conf do dir = node[:apache][:dir] template "#{dir}/mods-available/#{params[:name]}.conf" do source "mods/#{params[:name]}.conf.erb" notifies :restart, resources(:service => "apache2") endend# In your recipeapache_conf "mod_ssl"
    • TYING IT INTO CI
    • USE CHEF TO PROVISION CIhttp://images.nationalgeographic.com/wpf/media-live/photos/000/148/custom/heart-ngk0207_14824_470x300.jpg
    • CHEF AS PART OF TEST SCRIPT attribution
    • CONTINUOUS DEPLOYMENT
    • LET’S WRAP IT U Phttp://www.flickr.com/photos/andresthor/3946773501/sizes/l/in/photostream/
    • AUTOMATE EVERYTHING!! http://www.flickr.com/photos/kenfagerdotcom/3409813881/
    • Deploying == Provisioning
    • USE CHEF!!!!! http://www.flickr.com/photos/martin_borjesson/4083726805/sizes/o/
    • ON THE INTERNETS
    • ON THE INTERNETS•twitter - @cashion
    • ON THE INTERNETS•twitter - @cashion•github - http://github.com/trotter
    • ON THE INTERNETS•twitter - @cashion•github - http://github.com/trotter•email - cashion on the gmailz
    • THANK YOU! http://www.flickr.com/photos/dancoulter/21042744/sizes/o/
    • RESOURCES
    • RESOURCES• http://wiki.opscode.com/display/chef/Resources
    • RESOURCES• http://wiki.opscode.com/display/chef/Resources•#chef on freenode
    • RESOURCES• http://wiki.opscode.com/display/chef/Resources•#chef on freenode•cashion@gmail.com