More Related Content Similar to Puppet과 자동화된 시스템 관리 (20) Puppet과 자동화된 시스템 관리3. IT automation software that helps system
administrators manage infrastructure
throughout its lifecycle, from
provisioning and configuration to patch
management and compliance
8. 기존에는...
머리 속의 지우개
한 명에게 올인
내 머리 속 혹은 네 머리 속
포스트잇・위키・텍스트・워드・엑셀 문서
현란한 쉘 스크립트 여백이 충분하지 않아
옮기지는 않는다
집 짓고 설계도 그리기
:(){ :|:& };:
9. 더 나은 방법
Assembly Shell Scripts
Ruby, Python,
Java, C, PHP
※ 대체재 — 새로운 것이 아님
11. 특징
Ruby 기반
고유한 설정 명세 언어
다양한 OS 지원
Red Hat, Fedora, Debian, Ubuntu, CentOS, SuSE, Solaris, OS X, AIX,
HP–UX, OpenBSD, FreeBSD, Windows
HTTPS 기반의 Master/Agent
혹은 Standalone
12. Puppet Language
node colatech-dance-pool1 { Node
include colatech::music 역할 정의
include colatech::puppetagent
}
class colatech::music {
file { '/music': ensure => directory }
}
class colatech::puppetagent { Class
cron { '/usr/bin/puppet agent': 의미를 갖는
ensure => present,
user => 'root', 자원의 묶음
hour => [ 4 ],
minute => [ 22 ],
} Resource
} 최소 단위의 자원
13. 리소스
file { '/music/dance': ensure => file }
user { 'bigboy': ensure => present }
group { 'bigbros': ensure => present }
package { 'mysql-server': ensure => installed }
service { 'mysql': ensure => running }
tidy { '/music/logs/night': age => '4w' }
cron { '/usr/bin/make': hour => '4', minute => '30' }
exec { '/usr/bin/make': creates => '/usr/bin/a.out' }
host { 'example.com': ip => '127.0.0.1' }
interface { ... }
router { ... }
mailalias { ... }
mount { ... }
sshkey { ... }
ssh_authorized_key { ... }
...
14. 만들어 쓰는 리소스
define apache::vhost ($port, $docroot, $servername,
$vhost_name = '*') {
include apache
include apache::params
$vhost_dir = $apache::params::vhost_dir
file { "${vhost_dir}/${servername}.conf":
content => template('apache/vhost.conf.erb'),
require => Package['httpd'],
notify => Service['httpd'],
}
}
apache::vhost { 'homepages':
port => 8081,
docroot => '/var/www-testhost',
}
15. 클래스
# directory layout
class colatech::bros {
File {
owner => 'bigboy',
group => 'bigbros',
ensure => directory
}
file {
'/music/dance': ;
'/dance':ensure => link, target => '/music/dance';
'/dance/program': ;
'/dance/logs': ;
'/dance/resources': ;
'/dance/service': ;
}
}
16. 클래스
# bigboy user for guard
class colatech::guard::bigboy {
group { 'bigbros': ensure => present }
user { 'bigboy':
ensure => present,
gid => 'bigbros',
home => '/bigboy',
shell => '/bin/bash',
}
file { '/bigbros':
ensure => directory,
owner => 'bigboy',
group => 'bigbros',
}
}
17. 노드
node default {
include colatech::puppetagent
}
node colatech-gate-pool1 inherits default {
include colatech::guard
}
node colatech-gate-pool2 inherits default {
include colatech::guard
include colatech::cctv
}
node /^colatech-dance-poold+$/ inherits default {
include colatech::hooker
include colatech::dancer
}
19. 서버 설정도 공유?
node default {
include bigbros::hookd
}
node new-service inherits default {
include bigboy::guard
include dancer::dress
}
node new-service-test inherits new-service {
include my::nightly-party
}
22. 이점
설정의 테스트
확장성 리포팅
모듈화 가능성
실수 없이 정확하고 빠른 대응
23. RC2 확장 사례
언제 얼만큼이나 ?
증설하게 될 지 모른다는 걱정
100
68
48
0
12월 2월 3월 ?
25. RC2 확장 사례
node cache-pool-test inherits default {
include colatech::guard::bigboy
include colatech::dance
class { 'colatech::dancer':
rc3host => 'localhost' }
}
node colatech-dance-pool-stage inherits default {
class { 'colatech::dancer':
rc3host => 'dance.cloud.xx' }
}
node colatech-dance-pool inherits default {
class { 'colatech::dancer':
rc3host => 'pro.dance.cloud.xx' }
}
26. RC2 확장 사례
$ ssh new-host
"apt-get install puppet &&
puppet agent"
$ cap deploy
$ curl new-host
28. 요약
은 설정 관리 소프트웨어
고유한 설정 명세 언어를 바탕으로
자원을 체계적으로 구성 및 관리
빠르게 변화하는 환경하에
정확하고 민첩한 대처를 위한 도구