SlideShare a Scribd company logo
1 of 62
Download to read offline
We Are All DevOps
Everything is a file
Finding Disks
/dev/sdX
/dev/sdX{i}
/dev/disk/by-uuid/98affd0e-9d3e-49c1-
bb66-a60119642462
/dev/disk/by-path/pci-0000:00:07.1-
scsi-0:0:0:0
Special Files
/dev/zero
/dev/null
/dev/(u)random
/dev/dsp
Poking The Kernel With ProcFS
root@keyserver:~# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family: 6
model : 15
model name: Intel(R) Xeon(R) CPU E7440 @ 2.40GHz
stepping: 1
cpu MHz : 2400.070
cache size: 16384 KB
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss syscall nx lm
constant_tsc up arch_perfmon pebs bts rep_good pni ssse3 cx16 lahf_lm
bogomips: 4813.70
clflush size: 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
root@keyserver:~# cat /proc/meminfo
MemTotal: 253072 kB
MemFree: 7448 kB
Buffers: 25804 kB
Cached: 52552 kB
SwapCached: 4696 kB
Active: 156728 kB
Inactive: 25292 kB
SwapTotal: 522216 kB
SwapFree: 494832 kB
http://www.redhat.com/advice/tips/meminfo.htm
Set Swappyness
echo 0 > /proc/sys/vm/swappiness
echo "vm/swappiness=0" >>
/etc/sysctl.conf
Hotadd CPU
echo 1 > /sys/devices/system/cpucpu2/online
Getting By On The CLI
Don't Know A Command? - Apropos
How Apropos
Use Screen
● Survive disconnects
● Multiple sessions
● Split screen
● Share Screens
Get Bash Completion
tomh$ brew install bash-completion
# ~/.bash_profile
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
tomh$ ln -s `brew
--prefix`/Library/Contributions/brew_bash_completion.sh `brew
--prefix`/etc/bash_completion.d/
Using It
Performance Tools
top
iostat
vmstat
free
Finding Files
Find – Old Files
find /path/to/files* -mtime +NUMDAYS
Find – Big Files
find / -type f -size +200M
Found it? Do stuff to it
find / -type f -size +200M -exec ls -lh {} ;
locate
xargs
ps ax | grep apache | awk '{ print $1 }' | xargs kill
Sed and Awk
● Can do lots with them
● By lots I mean anything
● You probably don't want to write a Energy Price
Comparison site in them
Files and File Handles
Make a file
root@ubuntu-vm:/home/tom# mkdir /mnt/1G
root@ubuntu-vm:/home/tom# mount /dev/sdb /mnt/1G/
root@ubuntu-vm:/home/tom# cd /mnt/1G/
root@ubuntu-vm:/mnt/1G# dd if=/dev/urandom of=500M bs=1M
count=500
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 100.04 s, 5.2 MB/s
Some App Uses It
>>> f = open('/mnt/1G/500M')
You Remove It
root@ubuntu-vm:/mnt/1G# rm 500M
root@ubuntu-vm:/mnt/1G# ls
.lost+found
du is blind
root@ubuntu-vm:/mnt/1G# du -hs .
20K .
df can see
root@ubuntu-vm:/mnt/1G# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 19G 3.0G 15G 17% /
none 243M 208K 243M 1% /dev
none 249M 168K 249M 1% /dev/shm
none 249M 108K 249M 1% /var/run
none 249M 0 249M 0% /var/lock
/dev/sdb 1008M 534M 424M 56% /mnt/1G
lsof to the rescue
root@ubuntu-vm:/mnt/1G# lsof | grep /mnt/1G
bash 1857 root cwd DIR 8,16 4096 2 /mnt/1G
bash 1946 tom cwd DIR 8,16 4096 2 /mnt/1G
bash 1985 tom cwd DIR 8,16 4096 2 /mnt/1G
python 2007 tom cwd DIR 8,16 4096 2 /mnt/1G
python 2007 tom 3r REG 8,16 524288000 12
/mnt/1G/500M (deleted)
su 2011 root cwd DIR 8,16 4096 2 /mnt/1G
bash 2020 root cwd DIR 8,16 4096 2 /mnt/1G
lsof 2176 root cwd DIR 8,16 4096 2 /mnt/1G
grep 2177 root cwd DIR 8,16 4096 2 /mnt/1G
lsof 2178 root cwd DIR 8,16 4096 2 /mnt/1G
logrotate
Send A Signal
/var/log/httpd/*log {
missingok
notifempty
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/httpd.pid`
endscript
}
CopyTruncate
/path/to/any/app/*log {
missingok
notifempty
sharedscripts
copytruncate
}
nginx does it right
You can too
Signal.trap("USR1") {DO_STUFF}
Dont kill -9
Don't rescue Exception
Scheduling Things
Cron
/etc/cron.daily/
/etc/cron.hourly/
/etc/cron.monthly/
/etc/cron.weekly/
Puppet
sudo gem install cronedit
Using upstart to manage processes
root@ubuntu-vm:/etc/init# cat vmware-tools.conf
description "VMware Tools services"
author "VMware, Inc."
# Be sure to block the display managers until our job has
completed. This
# is to make sure our kernel services are running before
vmware-user
# may launch.
start on runlevel [235] or starting gdm or starting kdm or
starting prefdm
stop on runlevel [06]
pre-start exec /etc/vmware-tools/services.sh start
post-stop exec /etc/vmware-tools/services.sh stop
start on runlevel [2345]
stop on runlevel [06]
respawn
expect fork
script
export HOME="/home/deploy"
export JAVA_HOME="/usr/lib/jvm/java-6-sun"
export HIVE_HOME="/usr/lib/hive"
export HADOOP_HOME="/usr/lib/hadoop"
HIVE_PORT=10001 $HIVE_HOME/bin/hive --service hiveserver&
HIVE_PORT=10002 $HIVE_HOME/bin/hive --service hiveserver&
HIVE_PORT=10003 $HIVE_HOME/bin/hive --service hiveserver&
HIVE_PORT=10004 $HIVE_HOME/bin/hive --service hiveserver&
HIVE_PORT=10005 $HIVE_HOME/bin/hive --service hiveserver&
end script
Stopping Processes Running Amok
nice
nice <INCREMENT> <COMMAND>
renice <INCREMENT> <PID>
ionice
ionice -c {1/2/3} <COMMAND>
ionice -c {1/2/3} -p <PID>
1: real time
2: for best-effort
3: for idle
Installing Applications
● Use system .debs where possible
● Author debs
● PPA
● Compile
● Make own .debs
● Be the PPA
Waxing Philosophical
There is one system, not a collection of systems.
The desired state of the system should be a known
quantity.
The "known quantity" must be machine parseable.
The actual state of the system must self-correct to the
desired state.
The only authoritative source for the actual state of the
system is the system.
The entire system must be deployable using source media
and text files
Hate SPOF
● 10th
Floor Test
● Big Red Bus
Global Ownership
Ops
● Its the network
● It's the storage
● It's the virtualisation
● It's the DB
Dev
● It's the JS
● It's the DB
Nirvana
● There are no Ops
● Puppet is probably involved
Links
● http://aperiodic.net/screen/quick_reference
● http://www.planetdevops.net/
● http://blog.websages.com/2010/12/10/jameswhite-manif

More Related Content

What's hot

Install odoo v8 the easiest way on ubuntu debian
Install odoo v8 the easiest way on ubuntu debianInstall odoo v8 the easiest way on ubuntu debian
Install odoo v8 the easiest way on ubuntu debianFrancisco Servera
 
Usage Note of PlayCap
Usage Note of PlayCapUsage Note of PlayCap
Usage Note of PlayCapWilliam Lee
 
Docker command
Docker commandDocker command
Docker commandEric Ahn
 
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템Sam Kim
 
Jvm的最小使用内存测试
Jvm的最小使用内存测试Jvm的最小使用内存测试
Jvm的最小使用内存测试Zianed Hou
 
Using cgroups in docker container
Using cgroups in docker containerUsing cgroups in docker container
Using cgroups in docker containerVinay Jindal
 
Red Hat Certified Engineer (RHCE) EX294 Exam Questions
Red Hat Certified Engineer (RHCE) EX294 Exam QuestionsRed Hat Certified Engineer (RHCE) EX294 Exam Questions
Red Hat Certified Engineer (RHCE) EX294 Exam QuestionsStudy Material
 
Beyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with PuppetBeyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with Puppetlutter
 
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
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with AugeasPuppet
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetOmar Reygaert
 
Shared Object images in Docker: What you need is what you want.
Shared Object images in Docker: What you need is what you want.Shared Object images in Docker: What you need is what you want.
Shared Object images in Docker: What you need is what you want.Workhorse Computing
 
Docker container management
Docker container managementDocker container management
Docker container managementKarol Kreft
 

What's hot (20)

Install odoo v8 the easiest way on ubuntu debian
Install odoo v8 the easiest way on ubuntu debianInstall odoo v8 the easiest way on ubuntu debian
Install odoo v8 the easiest way on ubuntu debian
 
Web Server Free Bsd
Web Server Free BsdWeb Server Free Bsd
Web Server Free Bsd
 
Usage Note of PlayCap
Usage Note of PlayCapUsage Note of PlayCap
Usage Note of PlayCap
 
Docker command
Docker commandDocker command
Docker command
 
Docker
DockerDocker
Docker
 
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
 
Jvm的最小使用内存测试
Jvm的最小使用内存测试Jvm的最小使用内存测试
Jvm的最小使用内存测试
 
Using cgroups in docker container
Using cgroups in docker containerUsing cgroups in docker container
Using cgroups in docker container
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 
Red Hat Certified Engineer (RHCE) EX294 Exam Questions
Red Hat Certified Engineer (RHCE) EX294 Exam QuestionsRed Hat Certified Engineer (RHCE) EX294 Exam Questions
Red Hat Certified Engineer (RHCE) EX294 Exam Questions
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
 
Centos config
Centos configCentos config
Centos config
 
Ex407
Ex407Ex407
Ex407
 
Beyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with PuppetBeyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with Puppet
 
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)
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with Augeas
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + Puppet
 
Zookeper
ZookeperZookeper
Zookeper
 
Shared Object images in Docker: What you need is what you want.
Shared Object images in Docker: What you need is what you want.Shared Object images in Docker: What you need is what you want.
Shared Object images in Docker: What you need is what you want.
 
Docker container management
Docker container managementDocker container management
Docker container management
 

Viewers also liked

Master’s Graduates - Herzing University Online December 2013
Master’s Graduates - Herzing University Online December 2013Master’s Graduates - Herzing University Online December 2013
Master’s Graduates - Herzing University Online December 2013HerzingUniv_Online
 
Associate Graduates - Herzing University Online December 2013
Associate Graduates - Herzing University Online December 2013Associate Graduates - Herzing University Online December 2013
Associate Graduates - Herzing University Online December 2013HerzingUniv_Online
 
Diploma Graduates - Herzing University Online December 2013
Diploma Graduates - Herzing University Online December 2013Diploma Graduates - Herzing University Online December 2013
Diploma Graduates - Herzing University Online December 2013HerzingUniv_Online
 
Online tools-to-engage-students-11890
Online tools-to-engage-students-11890Online tools-to-engage-students-11890
Online tools-to-engage-students-11890alicia_overbeck
 
Netvantage Marketing Wrapping Your Head Around SEO
Netvantage Marketing Wrapping Your Head Around SEONetvantage Marketing Wrapping Your Head Around SEO
Netvantage Marketing Wrapping Your Head Around SEOadamnldt
 
Busting Open the Myth of Balance to Find the Treasure of Harmony
Busting Open the Myth of Balance to Find the Treasure of HarmonyBusting Open the Myth of Balance to Find the Treasure of Harmony
Busting Open the Myth of Balance to Find the Treasure of HarmonyKC Jones
 
Bachelor's Graduates - Herzing University Online December 2013
Bachelor's Graduates - Herzing University Online December 2013Bachelor's Graduates - Herzing University Online December 2013
Bachelor's Graduates - Herzing University Online December 2013HerzingUniv_Online
 
Adam Henige GVSU SEO Presentation
Adam Henige GVSU SEO PresentationAdam Henige GVSU SEO Presentation
Adam Henige GVSU SEO Presentationadamnldt
 
Adult laryngotracheal stenosis
Adult laryngotracheal stenosisAdult laryngotracheal stenosis
Adult laryngotracheal stenosismawaddahazman
 
Developing a personal self care plan
Developing a personal self care planDeveloping a personal self care plan
Developing a personal self care planKC Jones
 
Carotid blow out syndrome
Carotid blow out syndromeCarotid blow out syndrome
Carotid blow out syndromemawaddahazman
 

Viewers also liked (15)

Salud ocupacional
Salud ocupacionalSalud ocupacional
Salud ocupacional
 
Master’s Graduates - Herzing University Online December 2013
Master’s Graduates - Herzing University Online December 2013Master’s Graduates - Herzing University Online December 2013
Master’s Graduates - Herzing University Online December 2013
 
Associate Graduates - Herzing University Online December 2013
Associate Graduates - Herzing University Online December 2013Associate Graduates - Herzing University Online December 2013
Associate Graduates - Herzing University Online December 2013
 
Diploma Graduates - Herzing University Online December 2013
Diploma Graduates - Herzing University Online December 2013Diploma Graduates - Herzing University Online December 2013
Diploma Graduates - Herzing University Online December 2013
 
Online tools-to-engage-students-11890
Online tools-to-engage-students-11890Online tools-to-engage-students-11890
Online tools-to-engage-students-11890
 
Netvantage Marketing Wrapping Your Head Around SEO
Netvantage Marketing Wrapping Your Head Around SEONetvantage Marketing Wrapping Your Head Around SEO
Netvantage Marketing Wrapping Your Head Around SEO
 
Busting Open the Myth of Balance to Find the Treasure of Harmony
Busting Open the Myth of Balance to Find the Treasure of HarmonyBusting Open the Myth of Balance to Find the Treasure of Harmony
Busting Open the Myth of Balance to Find the Treasure of Harmony
 
Bachelor's Graduates - Herzing University Online December 2013
Bachelor's Graduates - Herzing University Online December 2013Bachelor's Graduates - Herzing University Online December 2013
Bachelor's Graduates - Herzing University Online December 2013
 
Adam Henige GVSU SEO Presentation
Adam Henige GVSU SEO PresentationAdam Henige GVSU SEO Presentation
Adam Henige GVSU SEO Presentation
 
Journal club
Journal clubJournal club
Journal club
 
Diruptive innovation
Diruptive innovationDiruptive innovation
Diruptive innovation
 
Adult laryngotracheal stenosis
Adult laryngotracheal stenosisAdult laryngotracheal stenosis
Adult laryngotracheal stenosis
 
Developing a personal self care plan
Developing a personal self care planDeveloping a personal self care plan
Developing a personal self care plan
 
Carotid blow out syndrome
Carotid blow out syndromeCarotid blow out syndrome
Carotid blow out syndrome
 
Conpes 3547
Conpes 3547Conpes 3547
Conpes 3547
 

Similar to Dev ops

Continuous delivery with docker
Continuous delivery with dockerContinuous delivery with docker
Continuous delivery with dockerJohan Janssen
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installationAnkit Desai
 
MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)Masami Hiramatsu
 
Hands on Virtualization with Ganeti
Hands on Virtualization with GanetiHands on Virtualization with Ganeti
Hands on Virtualization with GanetiOSCON Byrum
 
Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)Ata Rehman
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment TacticsIan Barber
 
ONOS SDN Controller - Clustering Tests & Experiments
ONOS SDN Controller - Clustering Tests & Experiments ONOS SDN Controller - Clustering Tests & Experiments
ONOS SDN Controller - Clustering Tests & Experiments Eueung Mulyana
 
Towards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev MachineTowards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev MachineKrimson
 
Automatic systems installations and change management wit FAI - Talk for Netw...
Automatic systems installations and change management wit FAI - Talk for Netw...Automatic systems installations and change management wit FAI - Talk for Netw...
Automatic systems installations and change management wit FAI - Talk for Netw...Henning Sprang
 
Deployment with Fabric
Deployment with FabricDeployment with Fabric
Deployment with Fabricandymccurdy
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
Steps to build and run oai
Steps to build and run oaiSteps to build and run oai
Steps to build and run oaissuser38b887
 
ERP System Implementation Kubernetes Cluster with Sticky Sessions
ERP System Implementation Kubernetes Cluster with Sticky Sessions ERP System Implementation Kubernetes Cluster with Sticky Sessions
ERP System Implementation Kubernetes Cluster with Sticky Sessions Chanaka Lasantha
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabricandymccurdy
 

Similar to Dev ops (20)

Linux
LinuxLinux
Linux
 
Sun raysetup
Sun raysetupSun raysetup
Sun raysetup
 
Alta disponibilidad en GNU/Linux
Alta disponibilidad en GNU/LinuxAlta disponibilidad en GNU/Linux
Alta disponibilidad en GNU/Linux
 
Continuous delivery with docker
Continuous delivery with dockerContinuous delivery with docker
Continuous delivery with docker
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installation
 
Docker practice
Docker practiceDocker practice
Docker practice
 
MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)
 
Hands on Virtualization with Ganeti
Hands on Virtualization with GanetiHands on Virtualization with Ganeti
Hands on Virtualization with Ganeti
 
Xen time machine
Xen time machineXen time machine
Xen time machine
 
Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment Tactics
 
ONOS SDN Controller - Clustering Tests & Experiments
ONOS SDN Controller - Clustering Tests & Experiments ONOS SDN Controller - Clustering Tests & Experiments
ONOS SDN Controller - Clustering Tests & Experiments
 
Towards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev MachineTowards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev Machine
 
Automatic systems installations and change management wit FAI - Talk for Netw...
Automatic systems installations and change management wit FAI - Talk for Netw...Automatic systems installations and change management wit FAI - Talk for Netw...
Automatic systems installations and change management wit FAI - Talk for Netw...
 
Deployment with Fabric
Deployment with FabricDeployment with Fabric
Deployment with Fabric
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Steps to build and run oai
Steps to build and run oaiSteps to build and run oai
Steps to build and run oai
 
Ex200
Ex200Ex200
Ex200
 
ERP System Implementation Kubernetes Cluster with Sticky Sessions
ERP System Implementation Kubernetes Cluster with Sticky Sessions ERP System Implementation Kubernetes Cluster with Sticky Sessions
ERP System Implementation Kubernetes Cluster with Sticky Sessions
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
 

Dev ops