디버깅의 6단계
디버깅의 6단계
1. 에러라고? 그럴 리 없어 ・・・・・・・・・・・・・・・・・・・・・・ 부정
6.
디버깅의 6단계
디버깅의 6단계
1. 에러라고? 그럴 리 없어 ・・・・・・・・・・・・・・・・・・・・・・ 부정
2. 내 컴에선 잘 되던데? ・・・・・・・・・・・・・・・・・・・・・・・・ 회피
7.
디버깅의 6단계
디버깅의 6단계
1. 에러라고? 그럴 리 없어 ・・・・・・・・・・・・・・・・・・・・・・ 부정
2. 내 컴에선 잘 되던데? ・・・・・・・・・・・・・・・・・・・・・・・・ 회피
3. 그럴리가 없을텐데 ・・・・・・・・・・・・・・・・・・・・・・・・・・・・ 의심
8.
디버깅의 6단계
디버깅의 6단계
1. 에러라고? 그럴 리 없어 ・・・・・・・・・・・・・・・・・・・・・・ 부정
2. 내 컴에선 잘 되던데? ・・・・・・・・・・・・・・・・・・・・・・・・ 회피
3. 그럴리가 없을텐데 ・・・・・・・・・・・・・・・・・・・・・・・・・・・・ 의심
4. 왜 그렇게 되었지? ・・・・・・・・・・・・・・・・・・・・・・・・・・・・ 분석
9.
디버깅의 6단계
디버깅의 6단계
1. 에러라고? 그럴 리 없어 ・・・・・・・・・・・・・・・・・・・・・・ 부정
2. 내 컴에선 잘 되던데? ・・・・・・・・・・・・・・・・・・・・・・・・ 회피
3. 그럴리가 없을텐데 ・・・・・・・・・・・・・・・・・・・・・・・・・・・・ 의심
4. 왜 그렇게 되었지? ・・・・・・・・・・・・・・・・・・・・・・・・・・・・ 분석
5. 헉... 알았다! ・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・ 각성
10.
디버깅의 6단계
디버깅의 6단계
1. 에러라고? 그럴 리 없어 ・・・・・・・・・・・・・・・・・・・・・・ 부정
2. 내 컴에선 잘 되던데? ・・・・・・・・・・・・・・・・・・・・・・・・ 회피
3. 그럴리가 없을텐데 ・・・・・・・・・・・・・・・・・・・・・・・・・・・・ 의심
4. 왜 그렇게 되었지? ・・・・・・・・・・・・・・・・・・・・・・・・・・・・ 분석
5. 헉... 알았다! ・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・ 각성
6. 이게 어떻게 동작했던거지? @.@ ・・・・・・・・・ 반성
11.
디버깅의 6단계
디버깅의 6단계
1. 에러라고? 그럴 리 없어 ・・・・・・・・・・・・・・・・・・・・・・ 부정
2. 내 컴에선 잘 되던데? ・・・・・・・・・・・・・・・・・・・・・・・・ 회피
3. 그럴리가 없을텐데 ・・・・・・・・・・・・・・・・・・・・・・・・・・・・ 의심
4. 왜 그렇게 되었지? ・・・・・・・・・・・・・・・・・・・・・・・・・・・・ 분석
5. 헉... 알았다! ・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・ 각성
6. 이게 어떻게 동작했던거지? @.@ ・・・・・・・・・ 반성
12.
왜 내 컴에서만잘 되는 걸까?
개발 환경 불일치
Image - http://futurist.se/gldt/page/3/
Vagrant로 로컬에 우분투VM 실행하기
Vagrant 설치
http://downloads.vagrantup.com
32.
Vagrant로 로컬에 우분투VM 실행하기
$ vagrant
Usage: vagrant [-v] [-h] command [<args>]
-v, --version Print the version and exit.
-h, --help Print this help.
Available subcommands:
box
destroy
gem
halt
init Command Line Interface
package
provision
reload GUI 없어요
resume
ssh
ssh-config
status
suspend
up
33.
Vagrant로 로컬에 우분투VM 실행하기
@work$ vagrant box add ↵
lucid32 ↵
http://files.vagrantup.com/lucid32.box
@work$
내 로컬에서의 별칭
미리 빌드된 우분투 10.04 가상머신 이미지
Vagrant로 로컬에 우분투VM 실행하기
@project$ vagrant ssh
Linux lucid32 2.6.32-38-generic #83-Ubuntu SMP Wed Jan 4 11:13:04
UTC 2012 i686 GNU/Linux
Ubuntu 10.04.4 LTS
Welcome to Ubuntu!
* Documentation: https://help.ubuntu.com/
New release 'precise' available.
Run 'do-release-upgrade' to upgrade to it.
Welcome to your Vagrant-built virtual machine.
Last login: Fri Sep 14 07:26:29 2012 from 10.0.2.2
vagrant@lucid32:~$ uname -na
Linux lucid32 2.6.32-38-generic #83-Ubuntu
SMP Wed Jan 4 11:13:04 UTC 2012 i686 GNU/
Linux
vagrant@lucid32:~$
Vagrant 기본 지식
@work$vagrant box add
lucid32
http://files.vagrantup.com/lucid32.box
h3@work$ mkdir project
h3@work$ cd project
@project$ vagrant init lucid32
@project$ vagrant up
분해 요.
알아도충
명령 만
요
Vagrant 기본 지식
$vagrant box add lucid32 http://~~
$ cd ~/.vagrant.d/box
@$[HOME]/.vagrant.d/box$ ls -al
drwxr-xr-x Oct 31 17:07 lucid32
Ubuntu VM
Ubunt Ubuntu VM
u
Ubuntu VM
Ubuntu VM
Ubuntu VM
44.
Vagrant 기본 지식
box 다운로드
공식
http://files.vagrantup.com/[box이름].box
- lucid32, lucid64, precise32, precise64
3rd party
http://vagrantbox.es
Vagrant 기본 지식
$vagrant init lucid32
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "lucid32"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
config.vm.box_url = "http://files.vagrantup.com/lucid32.box"
# Forward a port from the guest to the host, which allows for outside
# computers to access the VM, whereas host only networking does not.
config.vm.forward_port 8080, 8088
# Share an additional folder to the guest VM. The first argument is
# an identifier, the second is the path on the guest to mount the
# folder, and the third is the path on the host to the actual folder.
config.vm.share_folder "v-showcase", "/service", "spring-mvc-showcase"
# Update Server
config.vm.provision :shell do |shell|
shell.inline = "apt-get update --fix-missing"
end
end
Vagrant로 개발 환경구성하기
$ git add Vagrantfile
$ git commit -m ‘개발 환경 설정’
$ git push
73.
Vagrant로 개발 환경구성하기
서버 OS != 로컬 OS
서버 OS == 로컬 OS
설치 환경 문서로 공유
설치 환경 자체가 공유
소프트웨어 버전 불일치
소프트웨어 버전 전부 일치
개발자마다 개발 환경 구축
설치는 단 한명이!
쓰고 있는 포트 충돌
손쉬운 포트 포워딩
분산 환경 구성하기
Multi-VM
Vagrant::Config.run do |config|
config.vm.define :web do |web_config|
web_config.vm.box = "web"
web_config.vm.forward_port 80, 8080
end
config.vm.define :db do |db_config|
db_config.vm.box = "db"
db_config.vm.forward_port 3306, 3306
end
end
77.
분산 환경 구성하기
Host-Only 네트워킹
Vagrant::Config.run do |config|
config.vm.define :web do |web_config|
web_config.vm.box = "web"
web_config.vm.forward_port 80, 8080
web_config.vm.network :hostonly, "10.11.12.13"
end
config.vm.define :db do |db_config|
db_config.vm.box = "db"
db_config.vm.forward_port 3306, 3306
db_config.vm.network :hostonly, "10.11.12.14"
end
end
78.
Vagrant 사용
일반적인 사용법
1. box 는 사내 웹서버에 업로드
$ vagrant box add ~
2. 프로젝트 내에 Vagrantfile을 포함
$ git add Vagrantfile
$ git commit -m ‘개발 환경 설정’
3. Vagrant 사용
$ vagrant up
79.
Vagrant 사용
facebook/tornado
https://github.com/facebook/tornado/blob/master/maint/vm/ubuntu10.04/Vagrantfile
Chef 프로비저닝
Chef Server 프로비저닝
config.vm.provision :chef_client do |chef|
chef.chef_server_url = "http://cocina.kthcorp.com"
chef.validation_key_path = "chef/validation.pem"
chef.run_list = ["role[baas]"]
end