puppet과 자동화된 시스템 관리

28
효율적인 시스템 관리 클라우드기술팀

Upload: keon-ahn

Post on 05-Jul-2015

4.962 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Puppet과 자동화된 시스템 관리

과효율적인 시스템 관리

클라우드기술팀

Page 2: Puppet과 자동화된 시스템 관리

[pΛpit]

1. 인형3. 꼭두각시

Page 3: Puppet과 자동화된 시스템 관리

IT automation software that helps system administrators manage infrastructure throughout its lifecycle, from provisioning and configuration to patch management and compliance

Page 4: Puppet과 자동화된 시스템 관리
Page 5: Puppet과 자동화된 시스템 관리

두 달 새 20,000대 50,000대가

넘는 시스템

Page 6: Puppet과 자동화된 시스템 관리

올해 1월3천만 달러

Page 7: Puppet과 자동화된 시스템 관리

왜?

Page 8: Puppet과 자동화된 시스템 관리

기존에는...

내 머리 속 혹은 네 머리 속

포스트잇·위키·텍스트·워드·엑셀 문서

현란한 쉘 스크립트 여백이 충분하지 않아 옮기지는 않는다

집 짓고 설계도 그리기

머리 속의 지우개한 명에게 올인

:(){ :|:& };:

Page 9: Puppet과 자동화된 시스템 관리

※ 대체재 — 새로운 것이 아님

더 나은 방법

Assembly Shell Scripts

Ruby, Python,Java, C, PHP

Page 10: Puppet과 자동화된 시스템 관리

어떻게 생겼나?

Page 11: Puppet과 자동화된 시스템 관리

특징Ruby 기반

고유한 설정 명세 언어

다양한 OS 지원Red Hat, Fedora, Debian, Ubuntu, CentOS, SuSE, Solaris, OS X, AIX, HP–UX, OpenBSD, FreeBSD, Windows

HTTPS 기반의 Master/Agent혹은 Standalone

Page 12: Puppet과 자동화된 시스템 관리

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최소 단위의 자원

Page 13: Puppet과 자동화된 시스템 관리

리소스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 { ... }...

Page 14: Puppet과 자동화된 시스템 관리

만들어 쓰는 리소스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',}

Page 15: Puppet과 자동화된 시스템 관리

클래스# 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': ; }}

Page 16: Puppet과 자동화된 시스템 관리

클래스# 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', }}

Page 17: Puppet과 자동화된 시스템 관리

노드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}

Page 18: Puppet과 자동화된 시스템 관리

Puppet Forge

Page 19: Puppet과 자동화된 시스템 관리

서버 설정도 공유?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}

Page 20: Puppet과 자동화된 시스템 관리

정말 좋아요?

Page 21: Puppet과 자동화된 시스템 관리

그들이 언급하는 이점

Scale at Speed Availability Security Auditability

Page 22: Puppet과 자동화된 시스템 관리

이점

실수 없이 정확하고 빠른 대응

설정의모듈화 확장성 리포팅 테스트

가능성

Page 23: Puppet과 자동화된 시스템 관리

언제 얼만큼이나증설하게 될 지 모른다는 걱정

?

?

RC2 확장 사례

12월 2월 3월

0

4868

100

Page 24: Puppet과 자동화된 시스템 관리

서비스 배포

RC2 확장 사례

설정 수정

가상 머신결과 확인

Page 25: Puppet과 자동화된 시스템 관리

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 확장 사례

Page 26: Puppet과 자동화된 시스템 관리

$ ssh new-host \ "apt-get install puppet && puppet agent"

$ cap deploy

$ curl new-host

RC2 확장 사례

Page 27: Puppet과 자동화된 시스템 관리
Page 28: Puppet과 자동화된 시스템 관리

요약

은 설정 관리 소프트웨어

고유한 설정 명세 언어를 바탕으로자원을 체계적으로 구성 및 관리

빠르게 변화하는 환경하에정확하고 민첩한 대처를 위한 도구