SlideShare a Scribd company logo
Capistrano for
System Administrators
   (not rails developers)



      Bryan McLellan
          http://loftninjas.org
           btm@loftninjas.org
      Senior Systems Administrator
                Widemile
Landing Page Optimization (LPO)
by way of Secret Sauce with new
     SaaS Partner Platform




              Front end


 F5 VIP Cluster       F5 VIP Cluster
Landing Page Optimization (LPO)
                                     by way of Secret Sauce with new
                                          SaaS Partner Platform




Debian Host Blades w/VMware Server                 Front end

 Debian Guests      Debian Guests
                                      F5 VIP Cluster       F5 VIP Cluster
w/Apace fronted    w/Apace fronted
 JBoss Clusters     JBoss Clusters



 Debian Guests      Debian Guests
w/Apace fronted    w/Apace fronted
 JBoss Clusters     JBoss Clusters
Landing Page Optimization (LPO)
                                     by way of Secret Sauce with new
                                          SaaS Partner Platform




Debian Host Blades w/VMware Server                 Front end

 Debian Guests      Debian Guests
                                      F5 VIP Cluster       F5 VIP Cluster
w/Apace fronted    w/Apace fronted
 JBoss Clusters     JBoss Clusters

                                              Database Backend

 Debian Guests      Debian Guests
w/Apace fronted    w/Apace fronted
                                      MSSQL Cluster        MSSQL Cluster
 JBoss Clusters     JBoss Clusters
Capistrano is Puppet for the Rails community
Not Invented Here


                                               ?

http://www.flickr.com/photos/evdg/150116781/       http://www.flickr.com/photos/junewess/2111679056/
Not Invented Here
       Who is your daddy, and what does he do?
                 Puppet                                      Capistrano
• Ruby / Ruby-ish                           • Ruby / Ruby-ish
• Written by a Systems Administrator        • Written by a Rails Developer
• Luke Kanies – Reductive Labs              • Jamis Buck – 37signals
• Designed to manage server configuration   • Designed to deploy web applications

http://www.madstop.com/                     http://weblog.jamisbuck.org/
http://en.wikipedia.org/wiki/Puppet         http://en.wikipedia.org/wiki/Capistrano
http://reductivelabs.com/projects/puppet/   http://www.capify.org/
Why use Capistrano when we have Puppet?
                     Heard during a Capistrano talk at OSCON



• Restart a particular service on multiple servers once
• Check the state of a service or resource (memory, cpu) that isn’t monitored
• Run a command on multiple servers AND monitor it’s output
• Systems deployment tasks: install puppet, build VMs, etc.
Installing Capistrano
1. Install ruby
2. Install ruby gems
3. gem install capistrano



Wait, what’s a GEM?
Yet another package manager
Not Invented Here


                                               ?

http://www.flickr.com/photos/evdg/150116781/       http://www.flickr.com/photos/junewess/2111679056/
Not Invented Here
 Not all package management systems are created equal.

Debian doesn’t need another package management system.
     We have our own, it works quite well, thank you.

 http://pkg-ruby-extras.alioth.debian.org/rubygems.html


 PLEASE do not install unpackaged software on production
systems that someone else might have to inherit after your
                   very timely demise.

   Also note that ‘gem update –system’ tends to break
   Debian/Ubuntu ruby installations, and is disabled in
                   libgems-ruby 1.0.0-1
Building a Capistrano deb
1.   apt-get install build-essential fakeroot ruby-pkg-tools
2.   svn checkout svn://svn.debian.org/pkg-ruby-extras/packages-wip/capistrano/trunk/
3.   wget http://rubyforge.org/frs/download.php/33072/capistrano-2.2.0.tgz
4.   tar -xvzf capistrano-2.2.0.tgz
5.   mv trunk/* capistrano-2.2.0/
6.   cd capistrano-2.2.0/
7.   dch –v2.2.0
8.   dpkg-buildpackage –rfakeroot

1.   cd ..
2.   sudo dpkg -i capistrano_2.1.0-1_all.deb
3.   apt-get install -f

http://git.ninjr.org/?p=code.git;a=tree;f=debian/capistrano
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=428879
http://svn.debian.org/wsvn/pkg-ruby-extras/packages-wip/capistrano/trunk
fastthread who?
$ cap –V
You are running Ruby 1.8.6, which has a bug in its
   threading implementation. You are liable to encounter
   deadlocks running Capistrano, unless you install the
   fastthread library, which is available as a gem:
gem install fastthread

Wait, we’re installing a gem to fix a bug in ruby?

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472702
This is fixed in ruby1.8 >= 1.8.6 p110 (1.8.6.111-2ubuntu1.1), no worries.
Using Capistrano invoke
Assumptions:
• You can access your servers via SSH
         There is some kind of proxy gateway functionality too
     –
    You have the same password on all servers or PKI configured
•

$ cap HOSTS=quot;ots01, ots02, ots03quot; COMMAND=quot;whoamiquot; invoke
 * executing `invoke‘
 * executing quot;whoami“
   servers: [quot;ots01quot;, quot;ots02quot;, quot;ots03quot;]
   [ots01] executing command
   [ots02] executing command
   [ots03] executing command
** [out :: ots01] bryanm
** [out :: ots02] bryanm
** [out :: ots03] bryanm
   command finished
Why use Capistrano when we have Puppet?
                         Heard during a Capistrano talk at OSCON



• Restart a particular service on multiple servers once
     $ cap HOSTS=quot;ots01, ots02, ots03quot; COMMAND=“/etc/init.d/apache2 restartquot; invoke

• Check the state of a service or resource (memory, cpu) that isn’t monitored
     $ cap HOSTS=quot;ots01, ots02, ots03quot; COMMAND=quot;grep MemTotal /proc/meminfoquot; invoke

• Run a command on multiple servers AND monitor it’s output
     $ cap HOSTS=quot;ots01, ots02, ots03quot; COMMAND=“tail –f /var/log/apache2/error.logquot; invoke

• Systems deployment tasks: install puppet, build VMs, etc.
      $ cap -S recipe=debian_client -S client=newbox01 build
Using Capistrano shell
$ cap HOSTS=quot;ots01, ots02, ots03quot; shell * executing `invoke‘
cap> ls
[establishing connection(s) to ots01, ots02, ots03]
cap> ps
 ** [out :: ots01] PID TTY        TIME CMD
 ** [out :: ots01] 19437 ?     00:00:00 sshd
 ** [out :: ots01] 19445 ?     00:00:00 ps
 ** [out :: ots03] PID TTY        TIME CMD
 ** [out :: ots03] 3222 ?     00:00:00 sshd
 ** [out :: ots03] 3231 ?     00:00:00 ps
 ** [out :: ots02] PID TTY        TIME CMD
 ** [out :: ots02] 30751 ?     00:00:00 sshd
 ** [out :: ots02] 30756 ?     00:00:00 ps
Using Capistrano shell
Sure, but I can do that with ClusterSSH, right?

How about on fifty hosts? Programmatically?

$ cap -S recipe=iclassify -S query=quot;tag:ots-serverquot; COMMAND=quot;/etc/init.d/apache2
    restartquot; SUDO=1 invoke
$ cap -S recipe=iclassify -S query=quot;tag:workstationquot; puppet

https://wiki.hjksolutions.com/display/IC/Capistrano+Task
http://loftninjas.org

“Parallel to the ‘Developer’ tribe in most organizations, often with a semi-antagonistic
mutual dependence, there was always another tribe: ‘Sysadmin’. When Developers
and Sysadmins got together, it sometimes felt like the dwarfs and high elves forced to
work together by necessity. (I’ll let you workout which is which.)”

                            Andrew Shafer – Reductive Labs
                      http://stochasticresonance.wordpress.com

More Related Content

What's hot

Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Michele Orselli
 
Modern PHP Ch7 Provisioning Guide 導讀
Modern PHP Ch7 Provisioning Guide 導讀Modern PHP Ch7 Provisioning Guide 導讀
Modern PHP Ch7 Provisioning Guide 導讀Chen Cheng-Wei
 
Mass-Migration of 5000 Servers to Foreman/Katello with bootstrap.py - Evgeni ...
Mass-Migration of 5000 Servers to Foreman/Katello with bootstrap.py - Evgeni ...Mass-Migration of 5000 Servers to Foreman/Katello with bootstrap.py - Evgeni ...
Mass-Migration of 5000 Servers to Foreman/Katello with bootstrap.py - Evgeni ...NETWAYS
 
Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008Jeffrey Clark
 
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)Simon Boulet
 
An Express Guide ~ Zabbix for IT Monitoring
An Express Guide ~ Zabbix for IT Monitoring An Express Guide ~ Zabbix for IT Monitoring
An Express Guide ~ Zabbix for IT Monitoring Abhishek Kumar
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Dana Luther
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPressdotCloud
 
Controlling multiple VMs with the power of Python
Controlling multiple VMs with the power of PythonControlling multiple VMs with the power of Python
Controlling multiple VMs with the power of PythonYurii Vasylenko
 
Ansible for beginners
Ansible for beginnersAnsible for beginners
Ansible for beginnersKuo-Le Mei
 
Ansible : what's ansible & use case by REX
Ansible :  what's ansible & use case by REXAnsible :  what's ansible & use case by REX
Ansible : what's ansible & use case by REXSaewoong Lee
 
Writing & Sharing Great Modules on the Puppet Forge
Writing & Sharing Great Modules on the Puppet ForgeWriting & Sharing Great Modules on the Puppet Forge
Writing & Sharing Great Modules on the Puppet ForgePuppet
 
Troubleshooting the Puppet Enterprise Stack
Troubleshooting the Puppet Enterprise StackTroubleshooting the Puppet Enterprise Stack
Troubleshooting the Puppet Enterprise StackPuppet
 
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu ServerForget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Serveraaroncouch
 
Instruction: dev environment
Instruction: dev environmentInstruction: dev environment
Instruction: dev environmentSoshi Nemoto
 

What's hot (20)

grate techniques
grate techniquesgrate techniques
grate techniques
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
 
kubernetes practice
kubernetes practicekubernetes practice
kubernetes practice
 
Modern PHP Ch7 Provisioning Guide 導讀
Modern PHP Ch7 Provisioning Guide 導讀Modern PHP Ch7 Provisioning Guide 導讀
Modern PHP Ch7 Provisioning Guide 導讀
 
Mass-Migration of 5000 Servers to Foreman/Katello with bootstrap.py - Evgeni ...
Mass-Migration of 5000 Servers to Foreman/Katello with bootstrap.py - Evgeni ...Mass-Migration of 5000 Servers to Foreman/Katello with bootstrap.py - Evgeni ...
Mass-Migration of 5000 Servers to Foreman/Katello with bootstrap.py - Evgeni ...
 
Ansible best practices
Ansible best practicesAnsible best practices
Ansible best practices
 
Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008
 
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
 
An Express Guide ~ Zabbix for IT Monitoring
An Express Guide ~ Zabbix for IT Monitoring An Express Guide ~ Zabbix for IT Monitoring
An Express Guide ~ Zabbix for IT Monitoring
 
Ansible intro
Ansible introAnsible intro
Ansible intro
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPress
 
Controlling multiple VMs with the power of Python
Controlling multiple VMs with the power of PythonControlling multiple VMs with the power of Python
Controlling multiple VMs with the power of Python
 
Cialug August 2021
Cialug August 2021Cialug August 2021
Cialug August 2021
 
Ansible for beginners
Ansible for beginnersAnsible for beginners
Ansible for beginners
 
Ansible : what's ansible & use case by REX
Ansible :  what's ansible & use case by REXAnsible :  what's ansible & use case by REX
Ansible : what's ansible & use case by REX
 
Writing & Sharing Great Modules on the Puppet Forge
Writing & Sharing Great Modules on the Puppet ForgeWriting & Sharing Great Modules on the Puppet Forge
Writing & Sharing Great Modules on the Puppet Forge
 
Troubleshooting the Puppet Enterprise Stack
Troubleshooting the Puppet Enterprise StackTroubleshooting the Puppet Enterprise Stack
Troubleshooting the Puppet Enterprise Stack
 
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu ServerForget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server
 
Instruction: dev environment
Instruction: dev environmentInstruction: dev environment
Instruction: dev environment
 

Viewers also liked

Getting Started with Capistrano in Ten Easy Steps
Getting Started with Capistrano in Ten Easy StepsGetting Started with Capistrano in Ten Easy Steps
Getting Started with Capistrano in Ten Easy Stepselliando dias
 
Getting Started with Capistrano
Getting Started with CapistranoGetting Started with Capistrano
Getting Started with CapistranoLaunchAny
 
Capistrano, Puppet, and Chef
Capistrano, Puppet, and ChefCapistrano, Puppet, and Chef
Capistrano, Puppet, and ChefDavid Benjamin
 
Chef vs. Puppet in the Cloud: How Telepictures and MoneySuperMarket Do It
Chef vs. Puppet in the Cloud: How Telepictures and MoneySuperMarket Do ItChef vs. Puppet in the Cloud: How Telepictures and MoneySuperMarket Do It
Chef vs. Puppet in the Cloud: How Telepictures and MoneySuperMarket Do ItRightScale
 

Viewers also liked (6)

Photos
PhotosPhotos
Photos
 
Capistrano
CapistranoCapistrano
Capistrano
 
Getting Started with Capistrano in Ten Easy Steps
Getting Started with Capistrano in Ten Easy StepsGetting Started with Capistrano in Ten Easy Steps
Getting Started with Capistrano in Ten Easy Steps
 
Getting Started with Capistrano
Getting Started with CapistranoGetting Started with Capistrano
Getting Started with Capistrano
 
Capistrano, Puppet, and Chef
Capistrano, Puppet, and ChefCapistrano, Puppet, and Chef
Capistrano, Puppet, and Chef
 
Chef vs. Puppet in the Cloud: How Telepictures and MoneySuperMarket Do It
Chef vs. Puppet in the Cloud: How Telepictures and MoneySuperMarket Do ItChef vs. Puppet in the Cloud: How Telepictures and MoneySuperMarket Do It
Chef vs. Puppet in the Cloud: How Telepictures and MoneySuperMarket Do It
 

Similar to Capistrano

Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierCarlos Sanchez
 
Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with CapistranoRamazan K
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Carlos Sanchez
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabricandymccurdy
 
Bare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefBare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefMatt Ray
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
Instrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabSoftware Guru
 
Fargate 를 이용한 ECS with VPC 1부
Fargate 를 이용한 ECS with VPC 1부Fargate 를 이용한 ECS with VPC 1부
Fargate 를 이용한 ECS with VPC 1부Hyun-Mook Choi
 
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google CloudDrupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google CloudDropsolid
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...Amazon Web Services
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slidesharetomcopeland
 
Automated Java Deployments With Rpm
Automated Java Deployments With RpmAutomated Java Deployments With Rpm
Automated Java Deployments With RpmMartin Jackson
 
Converting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaConverting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaDana Luther
 
OpenStack Tokyo Meeup - Gluster Storage Day
OpenStack Tokyo Meeup - Gluster Storage DayOpenStack Tokyo Meeup - Gluster Storage Day
OpenStack Tokyo Meeup - Gluster Storage DayDan Radez
 
Virtual Infrastructure
Virtual InfrastructureVirtual Infrastructure
Virtual InfrastructureBryan McLellan
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariJoseph Scott
 
JUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrinderJUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrindermarekgoldmann
 

Similar to Capistrano (20)

Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
infra-as-code
infra-as-codeinfra-as-code
infra-as-code
 
Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with Capistrano
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
 
Bare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefBare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and Chef
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Instrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con Gitlab
 
Fargate 를 이용한 ECS with VPC 1부
Fargate 를 이용한 ECS with VPC 1부Fargate 를 이용한 ECS with VPC 1부
Fargate 를 이용한 ECS with VPC 1부
 
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google CloudDrupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
 
Kayobe_desc
Kayobe_descKayobe_desc
Kayobe_desc
 
Automated Java Deployments With Rpm
Automated Java Deployments With RpmAutomated Java Deployments With Rpm
Automated Java Deployments With Rpm
 
Converting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaConverting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - Cascadia
 
OpenStack Tokyo Meeup - Gluster Storage Day
OpenStack Tokyo Meeup - Gluster Storage DayOpenStack Tokyo Meeup - Gluster Storage Day
OpenStack Tokyo Meeup - Gluster Storage Day
 
Virtual Infrastructure
Virtual InfrastructureVirtual Infrastructure
Virtual Infrastructure
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
 
JUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrinderJUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrinder
 

Recently uploaded

Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2DianaGray10
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfEasyPrinterHelp
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationZilliz
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1DianaGray10
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyUXDXConf
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101vincent683379
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 

Recently uploaded (20)

Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdf
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 

Capistrano

  • 1. Capistrano for System Administrators (not rails developers) Bryan McLellan http://loftninjas.org btm@loftninjas.org Senior Systems Administrator Widemile
  • 2. Landing Page Optimization (LPO) by way of Secret Sauce with new SaaS Partner Platform Front end F5 VIP Cluster F5 VIP Cluster
  • 3. Landing Page Optimization (LPO) by way of Secret Sauce with new SaaS Partner Platform Debian Host Blades w/VMware Server Front end Debian Guests Debian Guests F5 VIP Cluster F5 VIP Cluster w/Apace fronted w/Apace fronted JBoss Clusters JBoss Clusters Debian Guests Debian Guests w/Apace fronted w/Apace fronted JBoss Clusters JBoss Clusters
  • 4. Landing Page Optimization (LPO) by way of Secret Sauce with new SaaS Partner Platform Debian Host Blades w/VMware Server Front end Debian Guests Debian Guests F5 VIP Cluster F5 VIP Cluster w/Apace fronted w/Apace fronted JBoss Clusters JBoss Clusters Database Backend Debian Guests Debian Guests w/Apace fronted w/Apace fronted MSSQL Cluster MSSQL Cluster JBoss Clusters JBoss Clusters
  • 5.
  • 6. Capistrano is Puppet for the Rails community
  • 7. Not Invented Here ? http://www.flickr.com/photos/evdg/150116781/ http://www.flickr.com/photos/junewess/2111679056/
  • 8. Not Invented Here Who is your daddy, and what does he do? Puppet Capistrano • Ruby / Ruby-ish • Ruby / Ruby-ish • Written by a Systems Administrator • Written by a Rails Developer • Luke Kanies – Reductive Labs • Jamis Buck – 37signals • Designed to manage server configuration • Designed to deploy web applications http://www.madstop.com/ http://weblog.jamisbuck.org/ http://en.wikipedia.org/wiki/Puppet http://en.wikipedia.org/wiki/Capistrano http://reductivelabs.com/projects/puppet/ http://www.capify.org/
  • 9. Why use Capistrano when we have Puppet? Heard during a Capistrano talk at OSCON • Restart a particular service on multiple servers once • Check the state of a service or resource (memory, cpu) that isn’t monitored • Run a command on multiple servers AND monitor it’s output • Systems deployment tasks: install puppet, build VMs, etc.
  • 10. Installing Capistrano 1. Install ruby 2. Install ruby gems 3. gem install capistrano Wait, what’s a GEM? Yet another package manager
  • 11. Not Invented Here ? http://www.flickr.com/photos/evdg/150116781/ http://www.flickr.com/photos/junewess/2111679056/
  • 12. Not Invented Here Not all package management systems are created equal. Debian doesn’t need another package management system. We have our own, it works quite well, thank you. http://pkg-ruby-extras.alioth.debian.org/rubygems.html PLEASE do not install unpackaged software on production systems that someone else might have to inherit after your very timely demise. Also note that ‘gem update –system’ tends to break Debian/Ubuntu ruby installations, and is disabled in libgems-ruby 1.0.0-1
  • 13. Building a Capistrano deb 1. apt-get install build-essential fakeroot ruby-pkg-tools 2. svn checkout svn://svn.debian.org/pkg-ruby-extras/packages-wip/capistrano/trunk/ 3. wget http://rubyforge.org/frs/download.php/33072/capistrano-2.2.0.tgz 4. tar -xvzf capistrano-2.2.0.tgz 5. mv trunk/* capistrano-2.2.0/ 6. cd capistrano-2.2.0/ 7. dch –v2.2.0 8. dpkg-buildpackage –rfakeroot 1. cd .. 2. sudo dpkg -i capistrano_2.1.0-1_all.deb 3. apt-get install -f http://git.ninjr.org/?p=code.git;a=tree;f=debian/capistrano http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=428879 http://svn.debian.org/wsvn/pkg-ruby-extras/packages-wip/capistrano/trunk
  • 14. fastthread who? $ cap –V You are running Ruby 1.8.6, which has a bug in its threading implementation. You are liable to encounter deadlocks running Capistrano, unless you install the fastthread library, which is available as a gem: gem install fastthread Wait, we’re installing a gem to fix a bug in ruby? http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472702 This is fixed in ruby1.8 >= 1.8.6 p110 (1.8.6.111-2ubuntu1.1), no worries.
  • 15. Using Capistrano invoke Assumptions: • You can access your servers via SSH There is some kind of proxy gateway functionality too – You have the same password on all servers or PKI configured • $ cap HOSTS=quot;ots01, ots02, ots03quot; COMMAND=quot;whoamiquot; invoke * executing `invoke‘ * executing quot;whoami“ servers: [quot;ots01quot;, quot;ots02quot;, quot;ots03quot;] [ots01] executing command [ots02] executing command [ots03] executing command ** [out :: ots01] bryanm ** [out :: ots02] bryanm ** [out :: ots03] bryanm command finished
  • 16. Why use Capistrano when we have Puppet? Heard during a Capistrano talk at OSCON • Restart a particular service on multiple servers once $ cap HOSTS=quot;ots01, ots02, ots03quot; COMMAND=“/etc/init.d/apache2 restartquot; invoke • Check the state of a service or resource (memory, cpu) that isn’t monitored $ cap HOSTS=quot;ots01, ots02, ots03quot; COMMAND=quot;grep MemTotal /proc/meminfoquot; invoke • Run a command on multiple servers AND monitor it’s output $ cap HOSTS=quot;ots01, ots02, ots03quot; COMMAND=“tail –f /var/log/apache2/error.logquot; invoke • Systems deployment tasks: install puppet, build VMs, etc. $ cap -S recipe=debian_client -S client=newbox01 build
  • 17. Using Capistrano shell $ cap HOSTS=quot;ots01, ots02, ots03quot; shell * executing `invoke‘ cap> ls [establishing connection(s) to ots01, ots02, ots03] cap> ps ** [out :: ots01] PID TTY TIME CMD ** [out :: ots01] 19437 ? 00:00:00 sshd ** [out :: ots01] 19445 ? 00:00:00 ps ** [out :: ots03] PID TTY TIME CMD ** [out :: ots03] 3222 ? 00:00:00 sshd ** [out :: ots03] 3231 ? 00:00:00 ps ** [out :: ots02] PID TTY TIME CMD ** [out :: ots02] 30751 ? 00:00:00 sshd ** [out :: ots02] 30756 ? 00:00:00 ps
  • 18. Using Capistrano shell Sure, but I can do that with ClusterSSH, right? How about on fifty hosts? Programmatically? $ cap -S recipe=iclassify -S query=quot;tag:ots-serverquot; COMMAND=quot;/etc/init.d/apache2 restartquot; SUDO=1 invoke $ cap -S recipe=iclassify -S query=quot;tag:workstationquot; puppet https://wiki.hjksolutions.com/display/IC/Capistrano+Task
  • 19. http://loftninjas.org “Parallel to the ‘Developer’ tribe in most organizations, often with a semi-antagonistic mutual dependence, there was always another tribe: ‘Sysadmin’. When Developers and Sysadmins got together, it sometimes felt like the dwarfs and high elves forced to work together by necessity. (I’ll let you workout which is which.)” Andrew Shafer – Reductive Labs http://stochasticresonance.wordpress.com