SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Downloaden Sie, um offline zu lesen
Hadoop	
  in	
  Box	
  




 From	
  Playground	
  to	
  Produc5on	
  –	
  
Using	
  Vagrant,	
  Puppet,	
  Tes5ng	
  and	
  
               Hadoop.	
  	
  
Who	
  am	
  I?	
  
•  Dennis	
  Matotek	
  
	
  	
  	
  	
  Technical	
  Lead,	
  PlaForms	
  
	
  	
  	
  	
  Experian	
  Hitwise	
  
	
  
	
  	
  Co-­‐Author:	
  	
  
         	
  Pro	
  Linux	
  System	
  Administra5on:	
  Turnbull,	
  Lieverdink,	
  
             Matotek,	
  Apress	
  2009	
  
	
  	
  Technical	
  Reviewer:	
  	
  
         	
  Pulling	
  Strings	
  with	
  Puppet:	
  Turnbull,	
  Apress	
  2008	
  
What	
  are	
  we	
  solving?	
  
•  We	
  have	
  a	
  group	
  of	
  developers...	
  
They	
  want	
  to	
  build	
  something	
  cool!	
  
We	
  don’t	
  want	
  to	
  end	
  up	
  with	
  
                 this..	
  
So	
  let’s	
  get	
  together	
  early	
  in	
  the	
  
                       design	
  
How	
  can	
  we	
  help?	
  
•  Don’t	
  put	
  implementa5on	
  plans	
  at	
  the	
  end	
  of	
  a	
  
   project.	
  
•  Everyone	
  gets	
  involved	
  in	
  wri5ng	
  infrastructure	
  
   code	
  
•  Infrastructure	
  code	
  should	
  be	
  included	
  in	
  the	
  
   development	
  build	
  pipeline	
  and	
  have	
  to	
  pass	
  
   tests.	
  
•  Push	
  infrastructure	
  code	
  from	
  playground	
  to	
  
   produc5on.	
  Design,	
  test	
  and	
  deploy	
  your	
  
   infrastructure	
  code	
  like	
  your	
  applica5on	
  code.	
  
How	
  can	
  we	
  do	
  it?	
  
•  As	
  administrators	
  we	
  can	
  help	
  build	
  the	
  
   development	
  environment	
  for	
  projects.	
  	
  
•  Infrastructure	
  on	
  the	
  desktop	
  
    –  A	
  lot	
  of	
  the	
  concep5on	
  phase	
  coding	
  work	
  can	
  be	
  
       done	
  on	
  the	
  desktop.	
  
        •  What	
  packages	
  are	
  needed	
  for	
  the	
  project?	
  	
  
        •  What	
  configura5on	
  should	
  they	
  be	
  in?	
  
        •  How	
  can	
  you	
  share	
  your	
  ideas?	
  
Choices	
  
•  Virtualiza5on	
  technologies	
  to	
  choose	
  from	
  
      –  Virtual	
  Box	
  
      –  LXC	
  
      –  KVM/XEN	
  
•  Configura5on	
  management	
  tools	
  	
  
      –  Puppet	
  	
  
      –  Chef	
  
      –  SaltStack	
  
•  Tes5ng	
  tools	
  
      –  Cucumber-­‐puppet	
  
      –  Rspec	
  
•  CI	
  tools	
  
      –  Jenkins	
  
Let’s	
  look	
  at	
  Vagrant	
  
What’s	
  it	
  about?	
  
•  A	
  project	
  on	
  Github	
  wriaen	
  in	
  Ruby	
  to	
  manage	
  Oracle’s	
  VirtualBox	
  virtual	
  
       machines	
  (	
  originators:	
  Mitchell	
  Hashimoto	
  and	
  John	
  Bender,	
  2010).	
  	
  
•  You	
  can	
  build	
  and	
  distribute	
  projects	
  amongst	
  teams	
  or	
  colleagues.	
  
        •  Download	
  	
  ‘boxes’	
  and	
  build	
  project	
  environments	
  that	
  are	
  the	
  same	
  
        •  Boxes	
  are	
  reusable	
  testbeds.	
  When	
  you	
  are	
  ready,	
  push	
  your	
  
              development	
  code	
  environment	
  to	
  others.	
  
        •  Take	
  those	
  environments	
  and	
  run	
  them	
  against	
  Jenkins	
  or	
  other	
  CI	
  
              tools.	
  
        •  Sandbox,	
  develop,	
  test	
  and	
  push	
  your	
  infrastructure	
  code	
  into	
  
              produc5on.	
  
•  How	
  easy	
  is	
  it?	
  
   	
  $	
  vagrant	
  box	
  add	
  base	
  hap://files.vagrantup.com/lucid32.box	
  
   	
  $	
  vagrant	
  init	
  
   	
  $	
  vagrant	
  up	
  
Vagrant	
  boxes	
  
•  What’s	
  a	
  box?	
  
        •  Boxes	
  come	
  from	
  standard	
  VirtualBox	
  instances.	
  	
  With	
  
           specific	
  configura5ons	
  that	
  Vagrant	
  requires.	
  	
  
        •  What	
  ever	
  VirtualBox	
  supports,	
  so	
  does	
  Vagrant.	
  
        •  Boxes	
  are	
  basically	
  a	
  tar	
  of	
  an	
  exported	
  VirtualBox.	
  
            •  Configured	
  harddisks,	
  CPU,	
  RAM,	
  Networks.	
  
        •  You	
  can	
  create	
  them	
  yourself	
  or	
  use	
  ones	
  that	
  others	
  have	
  
           created	
  and	
  distributed.	
  	
  
•  How	
  to	
  build	
  a	
  box	
  is	
  documented	
  here:	
  
   	
  hap://vagrantup.com/docs/base_boxes.html	
  
Launching	
  a	
  box	
  
Install	
  VirtualBox,	
  install	
  Ruby,	
  install	
  vagrant.	
  
Create	
  your	
  own	
  box	
  or	
  find	
  one	
  that	
  is	
  distributed	
  already	
  
    $	
  mkdir	
  project	
  ;	
  cd	
  project	
  
    $	
  vagrant	
  box	
  add	
  <box_name>	
  <url	
  or	
  file_path>	
  

This	
  adds	
  and	
  makes	
  it	
  available	
  to	
  the	
  vagrant	
  init	
  command	
  

    $	
  vagrant	
  box	
  list	
  
    hadoop_in_a_box	
  
    $	
  vagrant	
  	
  init	
  <box_name>	
  	
  

You	
  will	
  now	
  have	
  the	
  default	
  Vagran2ile	
  created	
  in	
  your	
  directory	
  
    $	
  ls	
  	
  
    VagranFile	
  
    $	
  vagrant	
  up	
  
    $	
  vagrant	
  ssh	
  
VagranFile	
  
Vagrant::Config.run	
  do	
  |config|	
  
	
  
	
  	
  #	
  All	
  Vagrant	
  configura5on	
  is	
  done	
  here.	
  The	
  most	
  common	
  configura5on	
  
	
  	
  #	
  op5ons	
  are	
  documented	
  and	
  commented	
  below.	
  For	
  a	
  complete	
  reference,	
  
	
  	
  #	
  please	
  see	
  the	
  online	
  documenta5on	
  at	
  vagrantup.com.	
  
	
  
	
  	
  #	
  Every	
  Vagrant	
  virtual	
  environment	
  requires	
  a	
  box	
  to	
  build	
  off	
  of.	
  
	
  
	
  	
  config.vm.box	
  =	
  "hadoop_in_a_box"	
  
	
  
	
  	
  config.ssh.private_key_path	
  =	
  "./.ssh/vagrant.key"	
  
	
  
	
  	
  #	
  shared_folders	
  -­‐	
  this	
  folder	
  must	
  exist	
  in	
  your	
  project	
  directory	
  
	
  	
  config.vm.share_folder("shared_folder",	
  "/shared",	
  "./shared_folder")	
  
	
  
end	
  
Vagrant::Config.run	
  do	
  |config|	
  
	
  
	
  	
  #	
  general	
  setngs:	
  
	
  	
  #	
  config.vm.boot_mode	
  =	
  :gui	
  
	
  	
  	
  	
  config.vm.customize	
  [	
  "modifyvm",	
  :id,	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "-­‐-­‐memory",	
  "512"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ]	
  
	
  
	
  	
  #	
  ssh	
  setngs:	
  
	
  	
  #	
  Set	
  the	
  following	
  to	
  point	
  to	
  your	
  ssh	
  key	
  
	
  	
  config.ssh.private_key_path	
  =	
  "./.ssh/vagrant.key"	
  
	
  
	
  	
  #	
  Change	
  these	
  to	
  suit,	
  some5mes	
  it	
  takes	
  awhile	
  to	
  the	
  virtual	
  box	
  to	
  respond	
  
	
  	
  config.ssh.max_tries	
  =	
  25	
  
	
  	
  config.ssh.5meout	
  =	
  3	
  
	
  	
  	
  
	
  	
  #	
  shared_folders	
  -­‐	
  this	
  folder	
  must	
  exist	
  in	
  your	
  project	
  directory	
  
	
  	
  config.vm.share_folder("shared_folder",	
  "/shared",	
  "./shared_folder“)	
  
	
  
	
  	
  #	
  Below	
  is	
  an	
  example	
  of	
  a	
  mul5ple	
  VM	
  	
  
	
  	
  	
  config.vm.define	
  :node1	
  do	
  |base_config|	
  
	
  	
  	
  	
  	
  base_config.vm.box	
  =	
  "my_base"	
  
	
  	
  	
  	
  	
  base_config.vm.forward_port	
  22,	
  2102	
  
	
  	
  	
  	
  	
  base_config.vm.network	
  :hostonly,	
  "192.168.222.10"	
  
	
  	
  	
  end	
  
	
  	
  	
  
	
  	
  	
  #	
  config.vm.define	
  :node2	
  do	
  |base_config|	
  
	
  	
  	
  #	
  	
  	
  base_config.vm.box	
  =	
  "my_base"	
  
	
  	
  	
  #	
  	
  	
  base_config.vm.forward_port	
  22,	
  2103	
  
	
  	
  	
  #	
  	
  	
  base_config.vm.network	
  :hostonly,	
  "192.168.222.11"	
  
	
  	
  	
  #	
  end	
  
end	
  
Provisioning	
  Your	
  Box	
  
•  Ruby	
  plugins	
  for	
  Vagrant	
                   •  Chef	
  Solo/Chef	
  Server	
  
                                                         	
  
       –  Build	
  your	
  own	
  specific	
              config.vm.provision	
  :chef_solo	
  do	
  |chef|	
  	
  
          plugins	
  that	
  make	
                      	
  	
  chef.add_recipe("apache")	
  	
  
          provisioning	
  easy	
  for	
  you	
           	
  	
  chef.add_recipe("php")	
  	
  
                                                         end	
  
•  Shell	
  provisioning	
  
       –  Bash	
  shell	
  scripts	
  or	
  
          commands	
                                     •  Puppet/Puppet	
  Server	
  
	
                                                       	
  

base_config.vm.provision	
  :shell	
  do	
  |shell|	
     config.vm.provision	
  :puppet,	
  do	
  |puppet|	
  
	
  	
  shell.inline	
  =	
  "hostname	
  $1“	
          	
  	
  puppet.manifests_path	
  =	
  “manifests"	
  
	
  	
  shell.args	
  	
  	
  =	
  “node1“	
             	
  	
  puppet.manifest_file	
  =	
  "default.pp“	
  
end	
                                                    end	
  
Provision	
  with	
  Puppet	
  
Vagrant	
  and	
  Puppet	
  
•  You	
  can	
  use	
  a	
  Puppet	
  Master	
  or	
  locally	
  apply	
  
   Puppet	
  modules	
  and	
  manifests	
  to	
  provision	
  
   your	
  Vagrant	
  nodes.	
  
        –  Locally	
  applied	
  Puppet	
  modules	
  and	
  manifests:	
  
	
  
base_config.vm.provision	
  :puppet,	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  :module_path	
  =>	
  ["puppet_modules","puppet_modules_private"],	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  :op5ons	
  =>	
  "-­‐-­‐verbose"	
  do	
  |basepuppet|	
  
	
  	
  	
  	
  basepuppet.manifests_path	
  =	
  "puppet_manifests“	
  
	
  	
  	
  	
  basepuppet.manifest_file	
  =	
  "default.pp“	
  
	
  	
  	
  	
  basepuppet.pp_path	
  =	
  "/tmp/vagrant-­‐puppet“	
  
end	
  
Vagrant	
  and	
  Puppet	
  
Cont’d	
  

       –  Using	
  Puppet	
  Master	
  to	
  provision:	
  
       –  Point	
  your	
  configura5on	
  at	
  your	
  local	
  Puppet	
  
          Master	
  
Vagrant::Config.run	
  do	
  |config|	
  
....	
  
<snip>	
  	
  
....	
  
	
  	
  base_config.vm.provision	
  :puppet_server	
  do	
  |puppet|	
  	
  
	
  	
  	
  	
  	
  	
  puppet.puppet_server	
  =	
  "puppet.yourdomain.com"	
  	
  
	
  	
  end	
  	
  
end	
  
	
  
Puppet	
  Manifest	
  design	
  
•  The	
  basic	
  manifest	
  is	
  made	
  up	
  of	
  the	
  following	
  
   components:	
  
    /etc/puppet	
  -­‐	
  
    	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐	
  manifests/site.pp	
  
    	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐	
  manifests/nodes.pp	
  
    	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐	
  modules/<module_name>/manifests	
  
    	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐	
  modules/<module_name>/files	
  
    	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐	
  modules/<module_name>/templates	
  
    	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐	
  modules/<module_name>/lib	
  
Think	
  about	
  using	
  ‘environments’	
  
•  Puppet	
  allows	
  you	
  to	
  use	
  environments.	
  
   Environments	
  are	
  separate	
  namespaces	
  where	
  
   you	
  can	
  run	
  and	
  test	
  your	
  code	
  on	
  the	
  same	
  
   puppet	
  master.	
  
    –  Namespaces	
  like	
  produc5on,	
  staging,	
  tes5ng,	
  etc	
  
•  The	
  puppet.conf	
  file	
  needs	
  the	
  following:	
  
modulepath	
  =	
  /etc/puppet/environments/
   $environments	
  
Environments	
  cont’d	
  
•  Allows	
  you	
  to	
  checkout	
  code	
  under	
  the	
  /etc/
   puppet/environments/<checkout>	
  and	
  then	
  
   pass	
  the	
  following	
  to	
  the	
  client	
  
   $	
  puppet	
  agent	
  -­‐-­‐test	
  	
  -­‐-­‐noop	
  -­‐-­‐environment	
  
        <checkout>	
  
•  Test	
  changes	
  against	
  systems	
  before	
  pushing	
  
   code	
  to	
  produc5on	
  
Things	
  to	
  think	
  about	
  in	
  Module	
  
                            Design	
  
•  Puppet	
  modules	
  are	
  a	
  collec5on	
  of	
  resources	
  to	
  install,	
  
   configure	
  and	
  manage	
  a	
  specific	
  applica5on	
  or	
  perform	
  
   some	
  kind	
  of	
  func5on.	
  	
  
     –  Eg,	
  install	
  and	
  configure	
  the	
  hapd	
  service	
  for	
  your	
  applica5ons.	
  
•  Keep	
  modules	
  separate.	
  Don’t	
  have	
  hapd	
  resources	
  being	
  
   managed	
  from	
  your	
  postgresql	
  module.	
  
•  Keep	
  data	
  separate	
  from	
  code.	
  	
  
     –  Have	
  a	
  separate	
  class	
  that	
  contains	
  your	
  data	
  (	
  class	
  modname::data	
  
        {	
  }	
  )	
  
     –  Use	
  an	
  external	
  node	
  classifier	
  (ENC).	
  That	
  is	
  a	
  CMDB	
  like	
  service	
  that	
  
        Puppet	
  can	
  extract	
  and	
  build	
  configura5ons	
  from.	
  
•  Keep	
  an	
  ear	
  on	
  the	
  Puppet	
  User	
  list	
  as	
  many	
  design	
  
   ques5ons	
  are	
  asked	
  and	
  answered	
  there.	
  
Manage	
  nodes?	
  
•  Nodes	
  are	
  tedious	
  to	
  manage.	
  
       nodes.pp	
  
       node	
  base	
  {	
  
       	
  	
  include	
  yum	
  
       }	
  
       node	
  node1	
  inherits	
  base	
  {	
  
       	
  	
  include	
  hapd	
  
       }	
  

•  Just	
  have	
  this:	
  
       node	
  default	
  {	
  	
  include	
  roles	
  }	
  

•  Group	
  nodes	
  based	
  on	
  Facts	
  or	
  other	
  data.	
  
	
  
Roles,	
  everything	
  has	
  a	
  role	
  
•  If	
  it	
  doesn’t	
  have	
  a	
  role,	
  it	
  has	
  a	
  default	
  role.	
  
•  Roles	
  decide	
  what	
  the	
  node	
  has.	
  
     –  Easier	
  to	
  manage	
  than	
  node	
  and	
  doesn’t	
  rely	
  on	
  
        ‘inheritance’.	
  
             •  Commonly,	
  inheritance	
  is	
  not	
  like	
  programming	
  inheritance.	
  	
  
     –  Roles	
  with	
  Hiera.	
  
     class	
  roles	
  {	
  
     	
  	
  $my_role	
  =	
  hiera(‘my_role’)	
  
     	
  	
  if	
  $my_role	
  ==	
  ‘webservice’	
  {	
  
     	
  	
  	
  	
  include	
  roles::webservices	
  
     	
  	
  }	
  
     }	
  
Tes5ng	
  Modules	
  
Tes5ng,	
  phhhuu!	
  
•  Why	
  test?	
  
    –  As	
  your	
  module	
  complexity	
  grows	
  you	
  need	
  to	
  
       make	
  sure	
  that	
  it	
  will	
  work.	
  
    –  Puppet	
  is	
  CONSTANTLY	
  changing	
              	
  	
  
         •  Ensure	
  your	
  code	
  is	
  keeping	
  up	
  with	
  new	
  puppet	
  
            versions	
  
    –  Your	
  infrastructure	
  code	
  is	
  code	
  –	
  why	
  not	
  test	
  it?	
  
    –  Test	
  driven	
  code	
  is	
  beaer	
  code,	
  helps	
  to	
  think	
  
       about	
  what	
  the	
  outcome	
  should	
  be.	
  
Introducing	
  the	
  tools	
  
•  RSpec	
  –	
  
    –  hap://rspec-­‐puppet.com/	
  
•  Cucumber-­‐Puppet	
  –	
  
    –  haps://github.com/nistude/cucumber-­‐puppet	
  
•  Both	
  tools	
  do	
  the	
  same	
  thing	
  and	
  are	
  based	
  on	
  
   common	
  tes5ng	
  frameworks.	
  
•  Both	
  tools	
  support	
  Business	
  Driven	
  Development	
  
•  How	
  do	
  I	
  use	
  it?	
  
    –  RSpec	
  tests	
  the	
  modules	
  
    –  Cucumber	
  tests	
  the	
  manifests	
  as	
  a	
  whole	
  
RSpec	
  	
  
class	
  hadoop::namenode::config	
  {	
  
	
  	
  require	
  hadoop::config	
  
	
  	
  include	
  hadoop::install::namenode	
  
	
  	
  include	
  hadoop::namenode::cluster_config_files	
  
	
  
#	
  realise	
  the	
  user	
  and	
  group	
  and	
  the	
  configfiles	
  
	
  	
  Group	
  <|	
  tag	
  ==	
  'hadoop_node'	
  |>	
  -­‐>	
  
<snip>	
  
	
  	
  file	
  {	
  '/usr/lib/hadoop-­‐0.20/logs/SecurityAuth.audit':	
  
	
  	
  	
  	
  ensure	
  	
  =>	
  present,	
  
<snip>	
  
	
  	
  	
  	
  require	
  =>	
  Package['hadoop-­‐0.20-­‐namenode']	
  
	
  	
  }	
  -­‐>	
  
	
  	
  Exec	
  <|	
  tags	
  ==	
  'common_execs'	
  |>	
  -­‐>	
  
	
  	
  hadoop::namenode::create_namenode_dirs	
  {$hadoop::config::hadoop_default_dirs:	
  	
  }	
  	
  -­‐>	
  
	
  	
  class	
  {"hadoop::namenode::namenode_format":	
  	
  }	
  
}	
  #end	
  class	
  
RSpec	
  
require	
  'spec_helper'	
  
	
  
describe	
  'hadoop::namenode::config'	
  do	
  
	
  	
  let(:facts)	
  {	
  {:hostname	
  =>	
  'node2',	
  :hadoop_node	
  =>	
  'namenode',	
  :role	
  =>	
  
              'hadoop_namenode'	
  }	
  }	
  
	
  
	
  	
  let(:5tle)	
  {	
  'config'	
  }	
  
	
  
	
  	
  it	
  {	
  should	
  include_class('hadoop::install::namenode')	
  }	
  
	
  
	
  	
  it	
  {	
  should	
  contain_file('/usr/lib/hadoop-­‐0.20/logs/SecurityAuth.audit')	
  }	
  
	
  	
  it	
  {	
  should	
  contain_file('/etc/hadoop-­‐0.20/conf.default/core-­‐site.xml')	
  }	
  
	
  
	
  	
  it	
  {	
  should	
  contain_service('hadoop-­‐0.20-­‐namenode').with_ensure('present')	
  }	
  
	
  
end	
  
Cucumber-­‐Puppet	
  
•  Does	
  the	
  catalog	
  compile	
  for	
  your	
  nodes?	
  
    –  Tests	
  run	
  on	
  the	
  master	
  (or	
  alterna5ve)	
  
    –  When	
  nodes	
  check	
  in,	
  Puppet	
  creates	
  a	
  yaml	
  file	
  
       in	
  /var/lib/puppet/yaml/node	
  
    –  cucumber-­‐puppet	
  uses	
  the	
  output,	
  the	
  node	
  
       cache	
  file,	
  from	
  the	
  last	
  puppet	
  run	
  
    –  In	
  Puppet	
  v3	
  this	
  changes	
  some	
  what	
  as	
  you	
  can	
  
       use	
  the	
  puppet	
  node	
  find	
  interface	
  to	
  retrieve	
  the	
  
       same	
  informa5on.	
  	
  
Cucumber	
  Basics	
  
	
  
Feature:	
  General	
  policy	
  for	
  all	
  catalogs	
  
	
  	
  In	
  order	
  to	
  ensure	
  applicability	
  of	
  a	
  host's	
  catalog	
  
	
  	
  As	
  a	
  manifest	
  developer	
  
	
  	
  I	
  want	
  all	
  catalogs	
  to	
  obey	
  some	
  general	
  rules	
  
	
  
	
  	
  Scenario	
  Outline:	
  Compile	
  and	
  verify	
  catalog	
  
	
  	
  	
  	
  Given	
  a	
  node	
  specified	
  by	
  "features/yaml/<hostname>.mylocal.yaml"	
  
	
  	
  	
  	
  When	
  I	
  compile	
  its	
  catalog	
  
	
  	
  	
  	
  Then	
  compila5on	
  should	
  succeed	
  
	
  	
  	
  	
  And	
  all	
  resource	
  dependencies	
  should	
  resolve	
  
	
  
	
  	
  	
  	
  Examples:	
  
	
  	
  	
  	
  	
  	
  |	
  hostname	
  	
  |	
  
	
  	
  	
  	
  	
  	
  |	
  puppet	
  |	
  
	
  	
  	
  	
  	
  	
  |	
  node2	
  |	
  
	
  	
  	
  	
  	
  	
  |	
  node3	
  |	
  
	
  	
  	
  	
  	
  	
  |	
  node4	
  |	
  
	
  
Cucumber-­‐Puppet	
  
       	
  
       Then	
  /^service	
  "([^"]*)"	
  should	
  be	
  "([^"]*)"$/	
  do	
  |name,	
  state|	
  
       	
  	
  steps	
  %Q{	
  
       	
  	
  	
  	
  Then	
  there	
  should	
  be	
  a	
  resource	
  "Service[#{name}]"	
  
       	
  	
  }	
  
       	
  	
  if	
  state	
  ==	
  "disabled"	
  
       	
  	
  	
  	
  steps	
  %Q{	
  
       	
  	
  	
  	
  	
  	
  Then	
  the	
  service	
  should	
  have	
  "enable"	
  set	
  to	
  "false"	
  
       	
  	
  	
  	
  }	
  
       	
  	
  elsif	
  state	
  ==	
  "running"	
  
       	
  	
  	
  	
  steps	
  %Q{	
  
       	
  	
  	
  	
  	
  	
  Then	
  the	
  state	
  should	
  be	
  "#{state}"	
  
       	
  	
  	
  	
  }	
  
       	
  	
  end	
  
       end	
  
	
  
Automa5ng	
  Tes5ng	
  
Jenkins	
  
•  Helps	
  maintain	
  build	
  pipelines	
  
•  Push	
  your	
  infrastructure	
  into	
  the	
  soƒware	
  
   project	
  pipelines.	
  
•  Con5nuous	
  integra5on	
  used	
  main	
  by	
  soƒware	
  
   projects,	
  not	
  oƒen	
  by	
  infrastructure	
  
•  Get	
  greater	
  certainty	
  of	
  your	
  infrastructure	
  
   deployments.	
  
Useful	
  plugins	
  
Demonstra5on	
  
Success	
  

Weitere ähnliche Inhalte

Was ist angesagt?

Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Software, Inc.
 
Velocity 2011 Chef OpenStack Workshop
Velocity 2011 Chef OpenStack WorkshopVelocity 2011 Chef OpenStack Workshop
Velocity 2011 Chef OpenStack WorkshopChef Software, Inc.
 
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Chef
 
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...Chef Software, Inc.
 
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Software, Inc.
 
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2Chef
 
Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5Chef
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAlberto Molina Coballes
 
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with ChefOpscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with ChefChef Software, Inc.
 
Common configuration with Data Bags - Fundamentals Webinar Series Part 4
Common configuration with Data Bags - Fundamentals Webinar Series Part 4Common configuration with Data Bags - Fundamentals Webinar Series Part 4
Common configuration with Data Bags - Fundamentals Webinar Series Part 4Chef
 
Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3Chef
 
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...Chef Software, Inc.
 
Chef for OpenStack: OpenStack Spring Summit 2013
Chef for OpenStack: OpenStack Spring Summit 2013Chef for OpenStack: OpenStack Spring Summit 2013
Chef for OpenStack: OpenStack Spring Summit 2013Matt Ray
 
Building a PaaS using Chef
Building a PaaS using ChefBuilding a PaaS using Chef
Building a PaaS using ChefShaun Domingo
 
Chef for OpenStack: Grizzly Roadmap
Chef for OpenStack: Grizzly RoadmapChef for OpenStack: Grizzly Roadmap
Chef for OpenStack: Grizzly RoadmapMatt Ray
 
Boston/NYC Chef for OpenStack Hack Days
Boston/NYC Chef for OpenStack Hack DaysBoston/NYC Chef for OpenStack Hack Days
Boston/NYC Chef for OpenStack Hack DaysMatt Ray
 
Atlanta OpenStack 2014 Chef for OpenStack Deployment Workshop
Atlanta OpenStack 2014 Chef for OpenStack Deployment WorkshopAtlanta OpenStack 2014 Chef for OpenStack Deployment Workshop
Atlanta OpenStack 2014 Chef for OpenStack Deployment WorkshopMatt Ray
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with DockerDocker, Inc.
 

Was ist angesagt? (20)

Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of Chef
 
Velocity 2011 Chef OpenStack Workshop
Velocity 2011 Chef OpenStack WorkshopVelocity 2011 Chef OpenStack Workshop
Velocity 2011 Chef OpenStack Workshop
 
Chef: Smart infrastructure automation
Chef: Smart infrastructure automationChef: Smart infrastructure automation
Chef: Smart infrastructure automation
 
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
 
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
 
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation Setup
 
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
 
Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
 
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with ChefOpscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with Chef
 
The unintended benefits of Chef
The unintended benefits of ChefThe unintended benefits of Chef
The unintended benefits of Chef
 
Common configuration with Data Bags - Fundamentals Webinar Series Part 4
Common configuration with Data Bags - Fundamentals Webinar Series Part 4Common configuration with Data Bags - Fundamentals Webinar Series Part 4
Common configuration with Data Bags - Fundamentals Webinar Series Part 4
 
Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3
 
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
 
Chef for OpenStack: OpenStack Spring Summit 2013
Chef for OpenStack: OpenStack Spring Summit 2013Chef for OpenStack: OpenStack Spring Summit 2013
Chef for OpenStack: OpenStack Spring Summit 2013
 
Building a PaaS using Chef
Building a PaaS using ChefBuilding a PaaS using Chef
Building a PaaS using Chef
 
Chef for OpenStack: Grizzly Roadmap
Chef for OpenStack: Grizzly RoadmapChef for OpenStack: Grizzly Roadmap
Chef for OpenStack: Grizzly Roadmap
 
Boston/NYC Chef for OpenStack Hack Days
Boston/NYC Chef for OpenStack Hack DaysBoston/NYC Chef for OpenStack Hack Days
Boston/NYC Chef for OpenStack Hack Days
 
Atlanta OpenStack 2014 Chef for OpenStack Deployment Workshop
Atlanta OpenStack 2014 Chef for OpenStack Deployment WorkshopAtlanta OpenStack 2014 Chef for OpenStack Deployment Workshop
Atlanta OpenStack 2014 Chef for OpenStack Deployment Workshop
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with Docker
 

Andere mochten auch

Puppet Camp Sydney 2015: The (Im)perfect Puppet Module
Puppet Camp Sydney 2015: The (Im)perfect Puppet ModulePuppet Camp Sydney 2015: The (Im)perfect Puppet Module
Puppet Camp Sydney 2015: The (Im)perfect Puppet ModulePuppet
 
Puppet Camp Atlanta 2014: Continuous Deployment of Puppet Modules
Puppet Camp Atlanta 2014: Continuous Deployment of Puppet ModulesPuppet Camp Atlanta 2014: Continuous Deployment of Puppet Modules
Puppet Camp Atlanta 2014: Continuous Deployment of Puppet ModulesPuppet
 
Puppet Development Workflow
Puppet Development WorkflowPuppet Development Workflow
Puppet Development WorkflowJeffery Smith
 
Devops, Dungeons & Dragons
Devops, Dungeons & Dragons Devops, Dungeons & Dragons
Devops, Dungeons & Dragons David Lutz
 
Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014Puppet
 
Puppet - Configuration Management Made Eas(ier)
Puppet - Configuration Management Made Eas(ier)Puppet - Configuration Management Made Eas(ier)
Puppet - Configuration Management Made Eas(ier)Aaron Bernstein
 
A Introduction of Packer
A Introduction of PackerA Introduction of Packer
A Introduction of PackerFreyr Lin
 
EC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerEC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerGeorge Miranda
 
Packer, where DevOps begins
Packer, where DevOps beginsPacker, where DevOps begins
Packer, where DevOps beginsJeff Hung
 
Usecase examples of Packer
Usecase examples of Packer Usecase examples of Packer
Usecase examples of Packer Hiroshi SHIBATA
 
C#: Globalization and localization
C#: Globalization and localizationC#: Globalization and localization
C#: Globalization and localizationRohit Vipin Mathews
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationGiacomo Vacca
 
Superb Supervision of Short-lived Servers with Sensu
Superb Supervision of Short-lived Servers with SensuSuperb Supervision of Short-lived Servers with Sensu
Superb Supervision of Short-lived Servers with SensuPaul O'Connor
 
Puppet Conf 2012 - Managing Network Devices with Puppet
Puppet Conf 2012 - Managing Network Devices with PuppetPuppet Conf 2012 - Managing Network Devices with Puppet
Puppet Conf 2012 - Managing Network Devices with PuppetNan Liu
 
Deploying puppet code at light speed
Deploying puppet code at light speedDeploying puppet code at light speed
Deploying puppet code at light speedTomas Doran
 
Dates aghhhh!!?!?!?!
Dates aghhhh!!?!?!?!Dates aghhhh!!?!?!?!
Dates aghhhh!!?!?!?!Tomas Doran
 
Docker Architecture (v1.3)
Docker Architecture (v1.3)Docker Architecture (v1.3)
Docker Architecture (v1.3)rajdeep
 

Andere mochten auch (20)

Puppet Camp Sydney 2015: The (Im)perfect Puppet Module
Puppet Camp Sydney 2015: The (Im)perfect Puppet ModulePuppet Camp Sydney 2015: The (Im)perfect Puppet Module
Puppet Camp Sydney 2015: The (Im)perfect Puppet Module
 
Puppet Camp Atlanta 2014: Continuous Deployment of Puppet Modules
Puppet Camp Atlanta 2014: Continuous Deployment of Puppet ModulesPuppet Camp Atlanta 2014: Continuous Deployment of Puppet Modules
Puppet Camp Atlanta 2014: Continuous Deployment of Puppet Modules
 
Puppet Development Workflow
Puppet Development WorkflowPuppet Development Workflow
Puppet Development Workflow
 
Devops, Dungeons & Dragons
Devops, Dungeons & Dragons Devops, Dungeons & Dragons
Devops, Dungeons & Dragons
 
Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014
 
Puppet - Configuration Management Made Eas(ier)
Puppet - Configuration Management Made Eas(ier)Puppet - Configuration Management Made Eas(ier)
Puppet - Configuration Management Made Eas(ier)
 
Docker
Docker Docker
Docker
 
Docker internals
Docker internalsDocker internals
Docker internals
 
A Introduction of Packer
A Introduction of PackerA Introduction of Packer
A Introduction of Packer
 
EC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerEC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and Packer
 
Packer, where DevOps begins
Packer, where DevOps beginsPacker, where DevOps begins
Packer, where DevOps begins
 
Usecase examples of Packer
Usecase examples of Packer Usecase examples of Packer
Usecase examples of Packer
 
C#: Globalization and localization
C#: Globalization and localizationC#: Globalization and localization
C#: Globalization and localization
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous Integration
 
Connascence
ConnascenceConnascence
Connascence
 
Superb Supervision of Short-lived Servers with Sensu
Superb Supervision of Short-lived Servers with SensuSuperb Supervision of Short-lived Servers with Sensu
Superb Supervision of Short-lived Servers with Sensu
 
Puppet Conf 2012 - Managing Network Devices with Puppet
Puppet Conf 2012 - Managing Network Devices with PuppetPuppet Conf 2012 - Managing Network Devices with Puppet
Puppet Conf 2012 - Managing Network Devices with Puppet
 
Deploying puppet code at light speed
Deploying puppet code at light speedDeploying puppet code at light speed
Deploying puppet code at light speed
 
Dates aghhhh!!?!?!?!
Dates aghhhh!!?!?!?!Dates aghhhh!!?!?!?!
Dates aghhhh!!?!?!?!
 
Docker Architecture (v1.3)
Docker Architecture (v1.3)Docker Architecture (v1.3)
Docker Architecture (v1.3)
 

Ähnlich wie Using Vagrant, Puppet, Testing & Hadoop

Using Vagrant
Using VagrantUsing Vagrant
Using Vagrantandygale
 
Avoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and VagrantAvoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and Vagrantandygale
 
Automated Infrastructure and Application Management
Automated Infrastructure and Application ManagementAutomated Infrastructure and Application Management
Automated Infrastructure and Application ManagementClark Everetts
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packerfrastel
 
Vagrant and Chef on FOSSASIA 2014
Vagrant and Chef on FOSSASIA 2014Vagrant and Chef on FOSSASIA 2014
Vagrant and Chef on FOSSASIA 2014Michael Lihs
 
Automate your Development Environment with Vagrant & Chef
Automate your Development Environment with Vagrant & ChefAutomate your Development Environment with Vagrant & Chef
Automate your Development Environment with Vagrant & Chef Michael Lihs
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerMaking Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerJohn Rofrano
 
Vagrant for Virtualized Development
Vagrant for Virtualized DevelopmentVagrant for Virtualized Development
Vagrant for Virtualized DevelopmentAdam Culp
 
Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015ice799
 
Powering Development and Testing Environments with Vagrant
Powering Development and Testing Environments with VagrantPowering Development and Testing Environments with Vagrant
Powering Development and Testing Environments with VagrantCoen Jacobs
 
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)Puppet Camp LA 2015: Package Managers and Puppet (Beginner)
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)Puppet
 
Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015ice799
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Michael Lihs
 
Toplog candy elves - HOCM Talk
Toplog candy elves - HOCM TalkToplog candy elves - HOCM Talk
Toplog candy elves - HOCM TalkPatrick LaRoche
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modulesKris Buytaert
 
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding APIDevoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding APIHendrik Ebbers
 
Improved development workflows using vagrant
Improved development workflows using vagrantImproved development workflows using vagrant
Improved development workflows using vagrantMakis Asimidis
 
Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Hendrik Ebbers
 

Ähnlich wie Using Vagrant, Puppet, Testing & Hadoop (20)

Using Vagrant
Using VagrantUsing Vagrant
Using Vagrant
 
Avoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and VagrantAvoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and Vagrant
 
Automated Infrastructure and Application Management
Automated Infrastructure and Application ManagementAutomated Infrastructure and Application Management
Automated Infrastructure and Application Management
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packer
 
Vagrant For DevOps
Vagrant For DevOpsVagrant For DevOps
Vagrant For DevOps
 
Vagrant and Chef on FOSSASIA 2014
Vagrant and Chef on FOSSASIA 2014Vagrant and Chef on FOSSASIA 2014
Vagrant and Chef on FOSSASIA 2014
 
Automate your Development Environment with Vagrant & Chef
Automate your Development Environment with Vagrant & ChefAutomate your Development Environment with Vagrant & Chef
Automate your Development Environment with Vagrant & Chef
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerMaking Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and Docker
 
Vagrant for Virtualized Development
Vagrant for Virtualized DevelopmentVagrant for Virtualized Development
Vagrant for Virtualized Development
 
Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015
 
Powering Development and Testing Environments with Vagrant
Powering Development and Testing Environments with VagrantPowering Development and Testing Environments with Vagrant
Powering Development and Testing Environments with Vagrant
 
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)Puppet Camp LA 2015: Package Managers and Puppet (Beginner)
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)
 
Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
Toplog candy elves - HOCM Talk
Toplog candy elves - HOCM TalkToplog candy elves - HOCM Talk
Toplog candy elves - HOCM Talk
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modules
 
Vagrant & Docker
Vagrant & DockerVagrant & Docker
Vagrant & Docker
 
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding APIDevoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
 
Improved development workflows using vagrant
Improved development workflows using vagrantImproved development workflows using vagrant
Improved development workflows using vagrant
 
Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013
 

Mehr von Puppet

Puppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet
 
Puppetcamp r10kyaml
Puppetcamp r10kyamlPuppetcamp r10kyaml
Puppetcamp r10kyamlPuppet
 
2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)Puppet
 
Puppet camp vscode
Puppet camp vscodePuppet camp vscode
Puppet camp vscodePuppet
 
Modules of the twenties
Modules of the twentiesModules of the twenties
Modules of the twentiesPuppet
 
Applying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance codeApplying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance codePuppet
 
KGI compliance as-code approach
KGI compliance as-code approachKGI compliance as-code approach
KGI compliance as-code approachPuppet
 
Enforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationEnforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationPuppet
 
Keynote: Puppet camp compliance
Keynote: Puppet camp complianceKeynote: Puppet camp compliance
Keynote: Puppet camp compliancePuppet
 
Automating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNowAutomating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNowPuppet
 
Puppet: The best way to harden Windows
Puppet: The best way to harden WindowsPuppet: The best way to harden Windows
Puppet: The best way to harden WindowsPuppet
 
Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020Puppet
 
Accelerating azure adoption with puppet
Accelerating azure adoption with puppetAccelerating azure adoption with puppet
Accelerating azure adoption with puppetPuppet
 
Puppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael PinsonPuppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael PinsonPuppet
 
ServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin ReeuwijkServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin ReeuwijkPuppet
 
Take control of your dev ops dumping ground
Take control of your  dev ops dumping groundTake control of your  dev ops dumping ground
Take control of your dev ops dumping groundPuppet
 
100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy SoftwarePuppet
 
Puppet User Group
Puppet User GroupPuppet User Group
Puppet User GroupPuppet
 
Continuous Compliance and DevSecOps
Continuous Compliance and DevSecOpsContinuous Compliance and DevSecOps
Continuous Compliance and DevSecOpsPuppet
 
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick MaludyThe Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick MaludyPuppet
 

Mehr von Puppet (20)

Puppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepo
 
Puppetcamp r10kyaml
Puppetcamp r10kyamlPuppetcamp r10kyaml
Puppetcamp r10kyaml
 
2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)
 
Puppet camp vscode
Puppet camp vscodePuppet camp vscode
Puppet camp vscode
 
Modules of the twenties
Modules of the twentiesModules of the twenties
Modules of the twenties
 
Applying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance codeApplying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance code
 
KGI compliance as-code approach
KGI compliance as-code approachKGI compliance as-code approach
KGI compliance as-code approach
 
Enforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationEnforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automation
 
Keynote: Puppet camp compliance
Keynote: Puppet camp complianceKeynote: Puppet camp compliance
Keynote: Puppet camp compliance
 
Automating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNowAutomating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNow
 
Puppet: The best way to harden Windows
Puppet: The best way to harden WindowsPuppet: The best way to harden Windows
Puppet: The best way to harden Windows
 
Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020
 
Accelerating azure adoption with puppet
Accelerating azure adoption with puppetAccelerating azure adoption with puppet
Accelerating azure adoption with puppet
 
Puppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael PinsonPuppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael Pinson
 
ServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin ReeuwijkServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin Reeuwijk
 
Take control of your dev ops dumping ground
Take control of your  dev ops dumping groundTake control of your  dev ops dumping ground
Take control of your dev ops dumping ground
 
100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software
 
Puppet User Group
Puppet User GroupPuppet User Group
Puppet User Group
 
Continuous Compliance and DevSecOps
Continuous Compliance and DevSecOpsContinuous Compliance and DevSecOps
Continuous Compliance and DevSecOps
 
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick MaludyThe Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
 

Using Vagrant, Puppet, Testing & Hadoop

  • 1. Hadoop  in  Box   From  Playground  to  Produc5on  –   Using  Vagrant,  Puppet,  Tes5ng  and   Hadoop.    
  • 2. Who  am  I?   •  Dennis  Matotek          Technical  Lead,  PlaForms          Experian  Hitwise        Co-­‐Author:      Pro  Linux  System  Administra5on:  Turnbull,  Lieverdink,   Matotek,  Apress  2009      Technical  Reviewer:      Pulling  Strings  with  Puppet:  Turnbull,  Apress  2008  
  • 3. What  are  we  solving?   •  We  have  a  group  of  developers...  
  • 4. They  want  to  build  something  cool!  
  • 5. We  don’t  want  to  end  up  with   this..  
  • 6. So  let’s  get  together  early  in  the   design  
  • 7. How  can  we  help?   •  Don’t  put  implementa5on  plans  at  the  end  of  a   project.   •  Everyone  gets  involved  in  wri5ng  infrastructure   code   •  Infrastructure  code  should  be  included  in  the   development  build  pipeline  and  have  to  pass   tests.   •  Push  infrastructure  code  from  playground  to   produc5on.  Design,  test  and  deploy  your   infrastructure  code  like  your  applica5on  code.  
  • 8. How  can  we  do  it?   •  As  administrators  we  can  help  build  the   development  environment  for  projects.     •  Infrastructure  on  the  desktop   –  A  lot  of  the  concep5on  phase  coding  work  can  be   done  on  the  desktop.   •  What  packages  are  needed  for  the  project?     •  What  configura5on  should  they  be  in?   •  How  can  you  share  your  ideas?  
  • 9. Choices   •  Virtualiza5on  technologies  to  choose  from   –  Virtual  Box   –  LXC   –  KVM/XEN   •  Configura5on  management  tools     –  Puppet     –  Chef   –  SaltStack   •  Tes5ng  tools   –  Cucumber-­‐puppet   –  Rspec   •  CI  tools   –  Jenkins  
  • 10. Let’s  look  at  Vagrant  
  • 11. What’s  it  about?   •  A  project  on  Github  wriaen  in  Ruby  to  manage  Oracle’s  VirtualBox  virtual   machines  (  originators:  Mitchell  Hashimoto  and  John  Bender,  2010).     •  You  can  build  and  distribute  projects  amongst  teams  or  colleagues.   •  Download    ‘boxes’  and  build  project  environments  that  are  the  same   •  Boxes  are  reusable  testbeds.  When  you  are  ready,  push  your   development  code  environment  to  others.   •  Take  those  environments  and  run  them  against  Jenkins  or  other  CI   tools.   •  Sandbox,  develop,  test  and  push  your  infrastructure  code  into   produc5on.   •  How  easy  is  it?    $  vagrant  box  add  base  hap://files.vagrantup.com/lucid32.box    $  vagrant  init    $  vagrant  up  
  • 12. Vagrant  boxes   •  What’s  a  box?   •  Boxes  come  from  standard  VirtualBox  instances.    With   specific  configura5ons  that  Vagrant  requires.     •  What  ever  VirtualBox  supports,  so  does  Vagrant.   •  Boxes  are  basically  a  tar  of  an  exported  VirtualBox.   •  Configured  harddisks,  CPU,  RAM,  Networks.   •  You  can  create  them  yourself  or  use  ones  that  others  have   created  and  distributed.     •  How  to  build  a  box  is  documented  here:    hap://vagrantup.com/docs/base_boxes.html  
  • 13. Launching  a  box   Install  VirtualBox,  install  Ruby,  install  vagrant.   Create  your  own  box  or  find  one  that  is  distributed  already   $  mkdir  project  ;  cd  project   $  vagrant  box  add  <box_name>  <url  or  file_path>   This  adds  and  makes  it  available  to  the  vagrant  init  command   $  vagrant  box  list   hadoop_in_a_box   $  vagrant    init  <box_name>     You  will  now  have  the  default  Vagran2ile  created  in  your  directory   $  ls     VagranFile   $  vagrant  up   $  vagrant  ssh  
  • 14. VagranFile   Vagrant::Config.run  do  |config|        #  All  Vagrant  configura5on  is  done  here.  The  most  common  configura5on      #  op5ons  are  documented  and  commented  below.  For  a  complete  reference,      #  please  see  the  online  documenta5on  at  vagrantup.com.        #  Every  Vagrant  virtual  environment  requires  a  box  to  build  off  of.        config.vm.box  =  "hadoop_in_a_box"        config.ssh.private_key_path  =  "./.ssh/vagrant.key"        #  shared_folders  -­‐  this  folder  must  exist  in  your  project  directory      config.vm.share_folder("shared_folder",  "/shared",  "./shared_folder")     end  
  • 15. Vagrant::Config.run  do  |config|        #  general  setngs:      #  config.vm.boot_mode  =  :gui          config.vm.customize  [  "modifyvm",  :id,                                                      "-­‐-­‐memory",  "512"                                                  ]        #  ssh  setngs:      #  Set  the  following  to  point  to  your  ssh  key      config.ssh.private_key_path  =  "./.ssh/vagrant.key"        #  Change  these  to  suit,  some5mes  it  takes  awhile  to  the  virtual  box  to  respond      config.ssh.max_tries  =  25      config.ssh.5meout  =  3            #  shared_folders  -­‐  this  folder  must  exist  in  your  project  directory      config.vm.share_folder("shared_folder",  "/shared",  "./shared_folder“)        #  Below  is  an  example  of  a  mul5ple  VM          config.vm.define  :node1  do  |base_config|            base_config.vm.box  =  "my_base"            base_config.vm.forward_port  22,  2102            base_config.vm.network  :hostonly,  "192.168.222.10"        end              #  config.vm.define  :node2  do  |base_config|        #      base_config.vm.box  =  "my_base"        #      base_config.vm.forward_port  22,  2103        #      base_config.vm.network  :hostonly,  "192.168.222.11"        #  end   end  
  • 16. Provisioning  Your  Box   •  Ruby  plugins  for  Vagrant   •  Chef  Solo/Chef  Server     –  Build  your  own  specific   config.vm.provision  :chef_solo  do  |chef|     plugins  that  make      chef.add_recipe("apache")     provisioning  easy  for  you      chef.add_recipe("php")     end   •  Shell  provisioning   –  Bash  shell  scripts  or   commands   •  Puppet/Puppet  Server       base_config.vm.provision  :shell  do  |shell|   config.vm.provision  :puppet,  do  |puppet|      shell.inline  =  "hostname  $1“      puppet.manifests_path  =  “manifests"      shell.args      =  “node1“      puppet.manifest_file  =  "default.pp“   end   end  
  • 18. Vagrant  and  Puppet   •  You  can  use  a  Puppet  Master  or  locally  apply   Puppet  modules  and  manifests  to  provision   your  Vagrant  nodes.   –  Locally  applied  Puppet  modules  and  manifests:     base_config.vm.provision  :puppet,                                  :module_path  =>  ["puppet_modules","puppet_modules_private"],                                  :op5ons  =>  "-­‐-­‐verbose"  do  |basepuppet|          basepuppet.manifests_path  =  "puppet_manifests“          basepuppet.manifest_file  =  "default.pp“          basepuppet.pp_path  =  "/tmp/vagrant-­‐puppet“   end  
  • 19. Vagrant  and  Puppet   Cont’d   –  Using  Puppet  Master  to  provision:   –  Point  your  configura5on  at  your  local  Puppet   Master   Vagrant::Config.run  do  |config|   ....   <snip>     ....      base_config.vm.provision  :puppet_server  do  |puppet|                puppet.puppet_server  =  "puppet.yourdomain.com"        end     end    
  • 20. Puppet  Manifest  design   •  The  basic  manifest  is  made  up  of  the  following   components:   /etc/puppet  -­‐                                                -­‐  manifests/site.pp                                                -­‐  manifests/nodes.pp                                                -­‐  modules/<module_name>/manifests                                                -­‐  modules/<module_name>/files                                                -­‐  modules/<module_name>/templates                                                -­‐  modules/<module_name>/lib  
  • 21. Think  about  using  ‘environments’   •  Puppet  allows  you  to  use  environments.   Environments  are  separate  namespaces  where   you  can  run  and  test  your  code  on  the  same   puppet  master.   –  Namespaces  like  produc5on,  staging,  tes5ng,  etc   •  The  puppet.conf  file  needs  the  following:   modulepath  =  /etc/puppet/environments/ $environments  
  • 22. Environments  cont’d   •  Allows  you  to  checkout  code  under  the  /etc/ puppet/environments/<checkout>  and  then   pass  the  following  to  the  client   $  puppet  agent  -­‐-­‐test    -­‐-­‐noop  -­‐-­‐environment   <checkout>   •  Test  changes  against  systems  before  pushing   code  to  produc5on  
  • 23. Things  to  think  about  in  Module   Design   •  Puppet  modules  are  a  collec5on  of  resources  to  install,   configure  and  manage  a  specific  applica5on  or  perform   some  kind  of  func5on.     –  Eg,  install  and  configure  the  hapd  service  for  your  applica5ons.   •  Keep  modules  separate.  Don’t  have  hapd  resources  being   managed  from  your  postgresql  module.   •  Keep  data  separate  from  code.     –  Have  a  separate  class  that  contains  your  data  (  class  modname::data   {  }  )   –  Use  an  external  node  classifier  (ENC).  That  is  a  CMDB  like  service  that   Puppet  can  extract  and  build  configura5ons  from.   •  Keep  an  ear  on  the  Puppet  User  list  as  many  design   ques5ons  are  asked  and  answered  there.  
  • 24. Manage  nodes?   •  Nodes  are  tedious  to  manage.   nodes.pp   node  base  {      include  yum   }   node  node1  inherits  base  {      include  hapd   }   •  Just  have  this:   node  default  {    include  roles  }   •  Group  nodes  based  on  Facts  or  other  data.    
  • 25. Roles,  everything  has  a  role   •  If  it  doesn’t  have  a  role,  it  has  a  default  role.   •  Roles  decide  what  the  node  has.   –  Easier  to  manage  than  node  and  doesn’t  rely  on   ‘inheritance’.   •  Commonly,  inheritance  is  not  like  programming  inheritance.     –  Roles  with  Hiera.   class  roles  {      $my_role  =  hiera(‘my_role’)      if  $my_role  ==  ‘webservice’  {          include  roles::webservices      }   }  
  • 27. Tes5ng,  phhhuu!   •  Why  test?   –  As  your  module  complexity  grows  you  need  to   make  sure  that  it  will  work.   –  Puppet  is  CONSTANTLY  changing       •  Ensure  your  code  is  keeping  up  with  new  puppet   versions   –  Your  infrastructure  code  is  code  –  why  not  test  it?   –  Test  driven  code  is  beaer  code,  helps  to  think   about  what  the  outcome  should  be.  
  • 28. Introducing  the  tools   •  RSpec  –   –  hap://rspec-­‐puppet.com/   •  Cucumber-­‐Puppet  –   –  haps://github.com/nistude/cucumber-­‐puppet   •  Both  tools  do  the  same  thing  and  are  based  on   common  tes5ng  frameworks.   •  Both  tools  support  Business  Driven  Development   •  How  do  I  use  it?   –  RSpec  tests  the  modules   –  Cucumber  tests  the  manifests  as  a  whole  
  • 29. RSpec     class  hadoop::namenode::config  {      require  hadoop::config      include  hadoop::install::namenode      include  hadoop::namenode::cluster_config_files     #  realise  the  user  and  group  and  the  configfiles      Group  <|  tag  ==  'hadoop_node'  |>  -­‐>   <snip>      file  {  '/usr/lib/hadoop-­‐0.20/logs/SecurityAuth.audit':          ensure    =>  present,   <snip>          require  =>  Package['hadoop-­‐0.20-­‐namenode']      }  -­‐>      Exec  <|  tags  ==  'common_execs'  |>  -­‐>      hadoop::namenode::create_namenode_dirs  {$hadoop::config::hadoop_default_dirs:    }    -­‐>      class  {"hadoop::namenode::namenode_format":    }   }  #end  class  
  • 30. RSpec   require  'spec_helper'     describe  'hadoop::namenode::config'  do      let(:facts)  {  {:hostname  =>  'node2',  :hadoop_node  =>  'namenode',  :role  =>   'hadoop_namenode'  }  }        let(:5tle)  {  'config'  }        it  {  should  include_class('hadoop::install::namenode')  }        it  {  should  contain_file('/usr/lib/hadoop-­‐0.20/logs/SecurityAuth.audit')  }      it  {  should  contain_file('/etc/hadoop-­‐0.20/conf.default/core-­‐site.xml')  }        it  {  should  contain_service('hadoop-­‐0.20-­‐namenode').with_ensure('present')  }     end  
  • 31. Cucumber-­‐Puppet   •  Does  the  catalog  compile  for  your  nodes?   –  Tests  run  on  the  master  (or  alterna5ve)   –  When  nodes  check  in,  Puppet  creates  a  yaml  file   in  /var/lib/puppet/yaml/node   –  cucumber-­‐puppet  uses  the  output,  the  node   cache  file,  from  the  last  puppet  run   –  In  Puppet  v3  this  changes  some  what  as  you  can   use  the  puppet  node  find  interface  to  retrieve  the   same  informa5on.    
  • 32. Cucumber  Basics     Feature:  General  policy  for  all  catalogs      In  order  to  ensure  applicability  of  a  host's  catalog      As  a  manifest  developer      I  want  all  catalogs  to  obey  some  general  rules        Scenario  Outline:  Compile  and  verify  catalog          Given  a  node  specified  by  "features/yaml/<hostname>.mylocal.yaml"          When  I  compile  its  catalog          Then  compila5on  should  succeed          And  all  resource  dependencies  should  resolve            Examples:              |  hostname    |              |  puppet  |              |  node2  |              |  node3  |              |  node4  |    
  • 33. Cucumber-­‐Puppet     Then  /^service  "([^"]*)"  should  be  "([^"]*)"$/  do  |name,  state|      steps  %Q{          Then  there  should  be  a  resource  "Service[#{name}]"      }      if  state  ==  "disabled"          steps  %Q{              Then  the  service  should  have  "enable"  set  to  "false"          }      elsif  state  ==  "running"          steps  %Q{              Then  the  state  should  be  "#{state}"          }      end   end    
  • 35. Jenkins   •  Helps  maintain  build  pipelines   •  Push  your  infrastructure  into  the  soƒware   project  pipelines.   •  Con5nuous  integra5on  used  main  by  soƒware   projects,  not  oƒen  by  infrastructure   •  Get  greater  certainty  of  your  infrastructure   deployments.