SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
Amazon EC2 Container Service 소개
Docker Korea Seoul Meetup #3
@seapy
# 소개
Amazon EC2 Container Service(ECS)는 컨테이너 관리 서비스로 Docker 컨테이너를 지원.
ECS에 대한 추가 비용은 없으며 AWS 리소스(EC2, EBS 등)에 대한 비용만 지불
# ECS 용어 정리
Amazon ECS는 다음과 같은 컴포넌트들로 이루어져 있다.
Cluster : 클러스터
컨테이너 인스턴스들의 논리적 그룹, Task를 여기에서 둔다.
Container Instance : 컨테이너 인스턴스
클러스터에 등록된 Amazon ECS 에이전트가 실행되는 EC2 인스턴스
Task Definition : Task 정의
한개 또는 그 이상의 컨테이너 정의를 포함한 어플리케이션 설명
Task
Task 정의를 이용해 생성된 인스턴스, 컨테이너 인스턴스에서 실행중
Container : 컨테이너
task의 일부로 생성된 리눅스 컨테이너
# 사전 작업
AWS 계정
IAM 사용자 및 IAM Role 생성
VPC(Vitual Private Cloud) 생성
보안 그룹 생성
AWS CLI 설치
# AWS EC2 인스턴스 생성
AWS 메니지먼트 콘솔 접속
"US East (N. Virginia) region" 선택
프리뷰에서 사용가능한 유일한 region
"Community AMIs" 에서 "ami-34ddbe5c" 검색후 선택
설정
Auto-assign Public IP => Enable
IAM role => ecs policy 추가된 role 선택
EC2 인스턴스 접속(ec2-user)
$ ssh -i ~/aws-verginia.pem ec2-user@52.1.178.175
# 간단한 작업 등록
```json
[
{
"environment": [],
"name": "sleep",
"image": "busybox",
"cpu": 10,
"portMappings": [],
"entryPoint": [
"/bin/sh"
],
"memory": 10,
"command": [
"sleep",
"360"
],
"essential": true
}
]
```
$ aws ecs list-clusters
$ aws ecs list-container-instances
$ aws ecs register-task-definition --family sleep360 --container-definitions file://sleep360.json
$ aws ecs list-task-definitions
$ aws ecs run-task --task-definition sleep360:3 --count 1
$ aws ecs list-tasks
$ aws ecs describe-tasks --task xxx
$ aws ecs stop-task --task xxxx
# Wordpress 블로그 실행하기
```
[
{
"image": "wordpress",
"name": "wordpress",
"cpu": 10,
"memory": 500,
"essential": true,
"links": [
"mysql"
],
"portMappings": [
{
"containerPort": 80,
"hostPort": 80
}
]
},
{
"image": "mysql",
"name": "mysql",
"cpu": 10,
"memory": 500,
"essential": true,
"environment": [
{
"name": "MYSQL_ROOT_PASSWORD",
"value": "password"
}
]
}
]
```
$ aws ecs register-task-definition --family wordpress --container-definitions file://wordpress.json
$ aws ecs run-task --task-definition wordpress:1 --count 1
$ aws ecs describe-container-instances --container-instances xxx
$ aws ecs register-task-definition --family wordpress --container-definitions file://wordpress.json
$ aws ecs run-task --task-definition wordpress:2 --count 1
# 추가 예정이라고 밝힌 기능
Elastic Load Balancing 통합
CloudWatch 통합
CloudWatch 로그 통합
CloudFormation 지원
태깅 지원
AWS 메지니먼트 콘솔
파트너 AMI(CoreOS 포함)
# ECS 제약사항
ECS 서비스는 현재 프리뷰 상태로 제공되며 프리뷰 기간동안 몇가지 제약사항이 있다
계정당 클러스터 수 : 2개, default 클러스터 제외
클러스터당 컨테이너 인스턴스 수 : 100개
run-task, start-task 당 컨테이너 인스턴스 수 : 10개
run-task 초당 컨테이너 인스턴스 수 : 클러스터당 5개
컨테이너 인스턴스 등록 rate : 초당 1개, 분당 60개
Task 정의 파일 크기 : 32 KiB
Task 정의 최대 컨테이너 수 : 10개
Task 정의 등록 rate : 초당 1개, 분당 60개
# 아쉬운점
CLI 사용성
AWS 메니지먼트 콘솔
# 참고자료
Amazon EC2 Container Service 소개
ECS Developer Guide
AWS re:Invent 2014 | (APP313) NEW LAUNCH: Amazon EC2 Container Service in Action
AWS CLI ECS Reference

Weitere ähnliche Inhalte

Andere mochten auch

개발자를 위한 Amazon Lightsail Deep-Dive
개발자를 위한 Amazon Lightsail Deep-Dive개발자를 위한 Amazon Lightsail Deep-Dive
개발자를 위한 Amazon Lightsail Deep-Dive창훈 정
 
AWSKRUG 정기 세미나 (2016년 9월) - Lambda + S3 썸네일 생성 및 운영
AWSKRUG 정기 세미나 (2016년 9월) - Lambda + S3 썸네일 생성 및 운영AWSKRUG 정기 세미나 (2016년 9월) - Lambda + S3 썸네일 생성 및 운영
AWSKRUG 정기 세미나 (2016년 9월) - Lambda + S3 썸네일 생성 및 운영창훈 정
 
Sw install with_without_docker
Sw install with_without_dockerSw install with_without_docker
Sw install with_without_dockerSeongJae Park
 
[Elasticsearch] 검색의 연관성 좀 더 높여보기
[Elasticsearch] 검색의 연관성 좀 더 높여보기[Elasticsearch] 검색의 연관성 좀 더 높여보기
[Elasticsearch] 검색의 연관성 좀 더 높여보기Hosang Jeon
 
Spring-Boot (springcamp2014)
Spring-Boot (springcamp2014)Spring-Boot (springcamp2014)
Spring-Boot (springcamp2014)sung yong jung
 
형태소 분석기를 적용한 elasticsearch 운영
형태소 분석기를 적용한 elasticsearch 운영형태소 분석기를 적용한 elasticsearch 운영
형태소 분석기를 적용한 elasticsearch 운영창훈 정
 
Intro to AWS: EC2 & Compute Services
Intro to AWS: EC2 & Compute ServicesIntro to AWS: EC2 & Compute Services
Intro to AWS: EC2 & Compute ServicesAmazon Web Services
 
서버학개론(백엔드 서버 개발자를 위한)
서버학개론(백엔드 서버 개발자를 위한)서버학개론(백엔드 서버 개발자를 위한)
서버학개론(백엔드 서버 개발자를 위한)수보 김
 
[JWPA-1]의존성 주입(Dependency injection)
[JWPA-1]의존성 주입(Dependency injection)[JWPA-1]의존성 주입(Dependency injection)
[JWPA-1]의존성 주입(Dependency injection)Young-Ho Cho
 

Andere mochten auch (11)

개발자를 위한 Amazon Lightsail Deep-Dive
개발자를 위한 Amazon Lightsail Deep-Dive개발자를 위한 Amazon Lightsail Deep-Dive
개발자를 위한 Amazon Lightsail Deep-Dive
 
AWSKRUG 정기 세미나 (2016년 9월) - Lambda + S3 썸네일 생성 및 운영
AWSKRUG 정기 세미나 (2016년 9월) - Lambda + S3 썸네일 생성 및 운영AWSKRUG 정기 세미나 (2016년 9월) - Lambda + S3 썸네일 생성 및 운영
AWSKRUG 정기 세미나 (2016년 9월) - Lambda + S3 썸네일 생성 및 운영
 
Sw install with_without_docker
Sw install with_without_dockerSw install with_without_docker
Sw install with_without_docker
 
[Elasticsearch] 검색의 연관성 좀 더 높여보기
[Elasticsearch] 검색의 연관성 좀 더 높여보기[Elasticsearch] 검색의 연관성 좀 더 높여보기
[Elasticsearch] 검색의 연관성 좀 더 높여보기
 
Spring-Boot (springcamp2014)
Spring-Boot (springcamp2014)Spring-Boot (springcamp2014)
Spring-Boot (springcamp2014)
 
Basic git-commands
Basic git-commandsBasic git-commands
Basic git-commands
 
형태소 분석기를 적용한 elasticsearch 운영
형태소 분석기를 적용한 elasticsearch 운영형태소 분석기를 적용한 elasticsearch 운영
형태소 분석기를 적용한 elasticsearch 운영
 
Amazon EC2 Container Service
Amazon EC2 Container ServiceAmazon EC2 Container Service
Amazon EC2 Container Service
 
Intro to AWS: EC2 & Compute Services
Intro to AWS: EC2 & Compute ServicesIntro to AWS: EC2 & Compute Services
Intro to AWS: EC2 & Compute Services
 
서버학개론(백엔드 서버 개발자를 위한)
서버학개론(백엔드 서버 개발자를 위한)서버학개론(백엔드 서버 개발자를 위한)
서버학개론(백엔드 서버 개발자를 위한)
 
[JWPA-1]의존성 주입(Dependency injection)
[JWPA-1]의존성 주입(Dependency injection)[JWPA-1]의존성 주입(Dependency injection)
[JWPA-1]의존성 주입(Dependency injection)
 

Mehr von 창훈 정

Packer + Ansible을 이용한 AMI 생성 및 AutoScaling Group 이미지 교체 이야기
Packer + Ansible을 이용한 AMI 생성 및 AutoScaling Group 이미지 교체 이야기Packer + Ansible을 이용한 AMI 생성 및 AutoScaling Group 이미지 교체 이야기
Packer + Ansible을 이용한 AMI 생성 및 AutoScaling Group 이미지 교체 이야기창훈 정
 
boot2docker 사용시 컨테이너에서 생성한 데이터를 유지하기
boot2docker 사용시 컨테이너에서 생성한 데이터를 유지하기boot2docker 사용시 컨테이너에서 생성한 데이터를 유지하기
boot2docker 사용시 컨테이너에서 생성한 데이터를 유지하기창훈 정
 
ActiveRecord Observers - RORLab Season 3-6
ActiveRecord Observers - RORLab Season 3-6ActiveRecord Observers - RORLab Season 3-6
ActiveRecord Observers - RORLab Season 3-6창훈 정
 
ActiveRecord Associations(1) - RORLab Season 3-7
ActiveRecord Associations(1) - RORLab Season 3-7ActiveRecord Associations(1) - RORLab Season 3-7
ActiveRecord Associations(1) - RORLab Season 3-7창훈 정
 
ActiveRecord Callbacks - RORLab Season 3-5
ActiveRecord Callbacks - RORLab Season 3-5ActiveRecord Callbacks - RORLab Season 3-5
ActiveRecord Callbacks - RORLab Season 3-5창훈 정
 
Rails Database Migrations - RORLab Season 3-3
Rails Database Migrations - RORLab Season 3-3Rails Database Migrations - RORLab Season 3-3
Rails Database Migrations - RORLab Season 3-3창훈 정
 
Install Rails On Mac OS - RORLab Season 3-2
Install Rails On Mac OS - RORLab Season 3-2Install Rails On Mac OS - RORLab Season 3-2
Install Rails On Mac OS - RORLab Season 3-2창훈 정
 

Mehr von 창훈 정 (8)

Packer + Ansible을 이용한 AMI 생성 및 AutoScaling Group 이미지 교체 이야기
Packer + Ansible을 이용한 AMI 생성 및 AutoScaling Group 이미지 교체 이야기Packer + Ansible을 이용한 AMI 생성 및 AutoScaling Group 이미지 교체 이야기
Packer + Ansible을 이용한 AMI 생성 및 AutoScaling Group 이미지 교체 이야기
 
boot2docker 사용시 컨테이너에서 생성한 데이터를 유지하기
boot2docker 사용시 컨테이너에서 생성한 데이터를 유지하기boot2docker 사용시 컨테이너에서 생성한 데이터를 유지하기
boot2docker 사용시 컨테이너에서 생성한 데이터를 유지하기
 
ActiveRecord Observers - RORLab Season 3-6
ActiveRecord Observers - RORLab Season 3-6ActiveRecord Observers - RORLab Season 3-6
ActiveRecord Observers - RORLab Season 3-6
 
ActiveRecord Associations(1) - RORLab Season 3-7
ActiveRecord Associations(1) - RORLab Season 3-7ActiveRecord Associations(1) - RORLab Season 3-7
ActiveRecord Associations(1) - RORLab Season 3-7
 
ActiveRecord Callbacks - RORLab Season 3-5
ActiveRecord Callbacks - RORLab Season 3-5ActiveRecord Callbacks - RORLab Season 3-5
ActiveRecord Callbacks - RORLab Season 3-5
 
Rails Database Migrations - RORLab Season 3-3
Rails Database Migrations - RORLab Season 3-3Rails Database Migrations - RORLab Season 3-3
Rails Database Migrations - RORLab Season 3-3
 
Install Rails On Mac OS - RORLab Season 3-2
Install Rails On Mac OS - RORLab Season 3-2Install Rails On Mac OS - RORLab Season 3-2
Install Rails On Mac OS - RORLab Season 3-2
 
Vim for you
Vim for youVim for you
Vim for you
 

Amazon ec2 container service 소개

  • 1. Amazon EC2 Container Service 소개
  • 2. Docker Korea Seoul Meetup #3 @seapy
  • 3. # 소개 Amazon EC2 Container Service(ECS)는 컨테이너 관리 서비스로 Docker 컨테이너를 지원. ECS에 대한 추가 비용은 없으며 AWS 리소스(EC2, EBS 등)에 대한 비용만 지불
  • 4. # ECS 용어 정리 Amazon ECS는 다음과 같은 컴포넌트들로 이루어져 있다. Cluster : 클러스터 컨테이너 인스턴스들의 논리적 그룹, Task를 여기에서 둔다. Container Instance : 컨테이너 인스턴스 클러스터에 등록된 Amazon ECS 에이전트가 실행되는 EC2 인스턴스 Task Definition : Task 정의 한개 또는 그 이상의 컨테이너 정의를 포함한 어플리케이션 설명 Task Task 정의를 이용해 생성된 인스턴스, 컨테이너 인스턴스에서 실행중 Container : 컨테이너 task의 일부로 생성된 리눅스 컨테이너
  • 5. # 사전 작업 AWS 계정 IAM 사용자 및 IAM Role 생성 VPC(Vitual Private Cloud) 생성 보안 그룹 생성 AWS CLI 설치
  • 6. # AWS EC2 인스턴스 생성 AWS 메니지먼트 콘솔 접속 "US East (N. Virginia) region" 선택 프리뷰에서 사용가능한 유일한 region "Community AMIs" 에서 "ami-34ddbe5c" 검색후 선택 설정 Auto-assign Public IP => Enable IAM role => ecs policy 추가된 role 선택 EC2 인스턴스 접속(ec2-user) $ ssh -i ~/aws-verginia.pem ec2-user@52.1.178.175
  • 7. # 간단한 작업 등록 ```json [ { "environment": [], "name": "sleep", "image": "busybox", "cpu": 10, "portMappings": [], "entryPoint": [ "/bin/sh" ], "memory": 10, "command": [ "sleep", "360" ], "essential": true } ] ```
  • 8. $ aws ecs list-clusters $ aws ecs list-container-instances $ aws ecs register-task-definition --family sleep360 --container-definitions file://sleep360.json $ aws ecs list-task-definitions $ aws ecs run-task --task-definition sleep360:3 --count 1 $ aws ecs list-tasks $ aws ecs describe-tasks --task xxx $ aws ecs stop-task --task xxxx
  • 9. # Wordpress 블로그 실행하기 ``` [ { "image": "wordpress", "name": "wordpress", "cpu": 10, "memory": 500, "essential": true, "links": [ "mysql" ], "portMappings": [ { "containerPort": 80, "hostPort": 80 } ] }, { "image": "mysql", "name": "mysql", "cpu": 10, "memory": 500, "essential": true, "environment": [ { "name": "MYSQL_ROOT_PASSWORD", "value": "password" } ] } ] ```
  • 10. $ aws ecs register-task-definition --family wordpress --container-definitions file://wordpress.json $ aws ecs run-task --task-definition wordpress:1 --count 1 $ aws ecs describe-container-instances --container-instances xxx $ aws ecs register-task-definition --family wordpress --container-definitions file://wordpress.json $ aws ecs run-task --task-definition wordpress:2 --count 1
  • 11. # 추가 예정이라고 밝힌 기능 Elastic Load Balancing 통합 CloudWatch 통합 CloudWatch 로그 통합 CloudFormation 지원 태깅 지원 AWS 메지니먼트 콘솔 파트너 AMI(CoreOS 포함)
  • 12. # ECS 제약사항 ECS 서비스는 현재 프리뷰 상태로 제공되며 프리뷰 기간동안 몇가지 제약사항이 있다 계정당 클러스터 수 : 2개, default 클러스터 제외 클러스터당 컨테이너 인스턴스 수 : 100개 run-task, start-task 당 컨테이너 인스턴스 수 : 10개 run-task 초당 컨테이너 인스턴스 수 : 클러스터당 5개 컨테이너 인스턴스 등록 rate : 초당 1개, 분당 60개 Task 정의 파일 크기 : 32 KiB Task 정의 최대 컨테이너 수 : 10개 Task 정의 등록 rate : 초당 1개, 분당 60개
  • 13. # 아쉬운점 CLI 사용성 AWS 메니지먼트 콘솔
  • 14. # 참고자료 Amazon EC2 Container Service 소개 ECS Developer Guide AWS re:Invent 2014 | (APP313) NEW LAUNCH: Amazon EC2 Container Service in Action AWS CLI ECS Reference