puppet과 자동화된 시스템 관리
TRANSCRIPT
과효율적인 시스템 관리
클라우드기술팀
[pΛpit]
1. 인형3. 꼭두각시
IT automation software that helps system administrators manage infrastructure throughout its lifecycle, from provisioning and configuration to patch management and compliance
두 달 새 20,000대 50,000대가
넘는 시스템
올해 1월3천만 달러
왜?
기존에는...
내 머리 속 혹은 네 머리 속
포스트잇·위키·텍스트·워드·엑셀 문서
현란한 쉘 스크립트 여백이 충분하지 않아 옮기지는 않는다
집 짓고 설계도 그리기
머리 속의 지우개한 명에게 올인
:(){ :|:& };:
※ 대체재 — 새로운 것이 아님
더 나은 방법
Assembly Shell Scripts
Ruby, Python,Java, C, PHP
어떻게 생겼나?
특징Ruby 기반
고유한 설정 명세 언어
다양한 OS 지원Red Hat, Fedora, Debian, Ubuntu, CentOS, SuSE, Solaris, OS X, AIX, HP–UX, OpenBSD, FreeBSD, Windows
HTTPS 기반의 Master/Agent혹은 Standalone
Puppet Languagenode colatech-dance-pool1 { include colatech::music include colatech::puppetagent}class colatech::music { file { '/music': ensure => directory }}class colatech::puppetagent { cron { '/usr/bin/puppet agent': ensure => present, user => 'root', hour => [ 4 ], minute => [ 22 ], }}
Node역할 정의
Class의미를 갖는자원의 묶음
Resource최소 단위의 자원
리소스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 { ... }...
만들어 쓰는 리소스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',}
클래스# directory layoutclass 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': ; }}
클래스# bigboy user for guardclass 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', }}
노드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-pool\d+$/ inherits default { include colatech::hooker include colatech::dancer}
Puppet Forge
서버 설정도 공유?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}
정말 좋아요?
그들이 언급하는 이점
Scale at Speed Availability Security Auditability
이점
실수 없이 정확하고 빠른 대응
설정의모듈화 확장성 리포팅 테스트
가능성
언제 얼만큼이나증설하게 될 지 모른다는 걱정
?
?
RC2 확장 사례
12월 2월 3월
0
4868
100
서비스 배포
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' }}
RC2 확장 사례
$ ssh new-host \ "apt-get install puppet && puppet agent"
$ cap deploy
$ curl new-host
RC2 확장 사례
요약
은 설정 관리 소프트웨어
고유한 설정 명세 언어를 바탕으로자원을 체계적으로 구성 및 관리
빠르게 변화하는 환경하에정확하고 민첩한 대처를 위한 도구