SlideShare a Scribd company logo
1 of 14
Download to read offline
Amazon EC2 Container
Service (ECS)
第6回 コンテナ型仮想化の情報交換会@東京
LT枠
2015.2.18
Isao SHIMIZU
@isaoshimizu
自己紹介
清水 勲 (Isao SHIMIZU) Twitter: @isaoshimizu
株式会社ミクシィ モンストスタジオ所属
- 現在4年目(2011年入社)
- mixiのインフラ運用(オンプレ)
- 現在は、モンスターストライクのインフラ・サーバ運用(オンプレ、AWS)
- ミクシィ エンジニアブログ執筆(Fedora、systemd、OpenStack、LXCなど)
- Software Design執筆(systemdほか)
前職:
- 2003∼2011年 SIerで企画、開発、インフラ運用
- 組み込み、Web、スマフォアプリ、動画配信など
最近気になっていること
- Apache Mesos、Consul、Prometheus、HTTP/2
前回のコンテナ型仮想化の情報交換会@東京で
LXCの本番運用事例について
発表させていただきました。
http://www.slideshare.net/isaoshimizu/using-lxc-on-production
まずECSについて
すでにECSを使ったことがある方
ECSとは
- AWS re:Invent 2014 @ Las Vegas (2014.11.11~14)で発表された新サービス
- Amazon EC2 Container Serviceの略
- 2015.2.18現在はまだプレビューリリース(登録制。us-east-1のみで利用可能)
- EC2(コンテナインスタンス)にコンテナを簡単に起動できる
- ECS向けの専用AMIが用意されている(独自に用意して使うこともできる)
- Docker互換(現時点でサポートするコンテナプラットフォームはDockerのみ)
- クラスタ(インスタンスのグルーピング)
- タスクという概念
- リソーススケジューラー
ECSを試しに使ってみた
- まずはプレビュー登録
 http://aws.amazon.com/jp/ecs/preview/
- しばらく待つ(場合によって数日∼2週間くらい)
- 「使ってみた」系記事が速攻で上がっているのでひと通りやってみる
このあたりとか
 http://dev.classmethod.jp/cloud/ecs-ataglance/
 http://tech.recruit-mp.co.jp/infrastructure/preview-amazon-ec2-container-service/
 
使ってみてどうだったのか
- 手順通りにやれば誰でも簡単にコンテナのクラスタを構成できる
- コンソールダッシュボードではECSの操作できない(おそらくプレビューだから)
- AWS CLIを使ってクラスタやタスクを操作するのが前提(いまのところ)
- JSONファイルに定義してコマンドに渡す操作が基本
- Docker Hubをそのまま使える(プライベートのレジストリでも問題ない)
- 料金はEC2, EBSの利用料だけ気にすればよい(ECS利用料は存在しない)
- CoreOSをECSのクラスタに追加することが可能
- https://coreos.com/docs/running-coreos/cloud-providers/ecs/
- CoreOS起動時にECSのエージェント用のコンテナをDocker pullして起動している
ECS関連のキーワード
クラスタ
- コンテナをグルーピングしたもの
- リソースプールとして扱う
- 同リージョン内で構成
エージェント
- コンテナインスタンス(EC2)に起動しているDockerの1コンテナとして起動
- Docker Hub: https://registry.hub.docker.com/u/amazon/amazon-ecs-agent/
- GitHub: https://github.com/aws/amazon-ecs-agent
タスク
- コンテナ上で実行させるDockerイメージの定義
- 予約するメモリやCPU数などのリソースの定義
- クラスタ内で動作するコンテナの集合
動作環境について
コンテナインスタンスのAMIについて
amzn-ami-2014.09.1-amazon-ecs-optimized-preview2 (ami-34ddbe5c)
Amazon ECS-Optimized Amazon Linux AMI 2014.09.1 x86_64 ECS HVM GP2 Preview 2
OSについて
Amazon Linux 2014.09.1
Kernel: 3.14.26-24.46.amzn1.x86_64
Dockerのバージョンについて
Client version: 1.3.3
Client API version: 1.15
Go version (client): go1.3.3
Git commit (client): c78088f/1.3.3
OS/Arch (client): linux/amd64
Server version: 1.3.3
Server API version: 1.15
Go version (server): go1.3.3
Git commit (server): c78088f/1.3.3
まとめ
- 複数のEC2インスタンスを横断してDockerコンテナを管理できるのがよい
- API, CLIで操作できるので各種システムと連携できる
- 既存のDockerイメージなどの資産を再利用できる
- AWSのセキュリティグループやELBなどの連携ができるのは嬉しい
- Elastic IPも使えるようになるらしい
- いつ東京リージョンで使えるようになるかはわからない
- 本番で使うべきかどうかもまだわからない
- 管理レイヤーができたことで本番導入が近づいたのは間違いない
- オンプレとAWSの併用でDockerを使うのはまだハードルが高い
- そもそもDockerが最適解なのかもまだわからない(Rocketとかもあるし)
補足
Apache Mesosとの連携
- Cluster Management with Amazon ECS
- https://aws.amazon.com/jp/blogs/compute/cluster-management-with-amazon-ecs/
- 2015.2.6の投稿
- Amazon ECS Scheduler Driver
- https://github.com/awslabs/ecs-mesos-scheduler-driver
- 2015.1.29が最初のコミット
- Mesosをにドライバを追加して、Mesosを通じてECSのコンテナを扱うことができる?
- AWSだけじゃなく、他のクラウドとかオンプレを意識せずに使えるようになる?
- ECS Agentも併用するとAWSじゃなくてもいいはず
- まだ試せてない
参考情報
・Amazon EC2 Container Service
 http://aws.amazon.com/jp/ecs/
・Amazon EC2 Container Service Developer Guide
 http://docs.aws.amazon.com/AmazonECS/latest/developerguide/
・AWS CLI ecs
 http://docs.aws.amazon.com/cli/latest/reference/ecs/index.html
・ECS for Docker Meetup #4
 http://www.slideshare.net/shot6/ecs-for-docker-meetup-4
・今日届いたAmazon EC2 Container Service (ECS)を使ってみた
 http://tech.recruit-mp.co.jp/infrastructure/preview-amazon-ec2-container-service/
・Amazon EC2 Container Service(ECS)で静的Webサイトをデプロイする
 http://dev.classmethod.jp/cloud/aws/ecs-deploy-static-website/
・CoreOSをECS(EC2 Container Service)クラスタに追加する
 http://dev.classmethod.jp/cloud/add-coreos-to-ecs-cluster/

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Amazon EC2 Container Service (ECS)

  • 1. Amazon EC2 Container Service (ECS) 第6回 コンテナ型仮想化の情報交換会@東京 LT枠 2015.2.18 Isao SHIMIZU @isaoshimizu
  • 2. 自己紹介 清水 勲 (Isao SHIMIZU) Twitter: @isaoshimizu 株式会社ミクシィ モンストスタジオ所属 - 現在4年目(2011年入社) - mixiのインフラ運用(オンプレ) - 現在は、モンスターストライクのインフラ・サーバ運用(オンプレ、AWS) - ミクシィ エンジニアブログ執筆(Fedora、systemd、OpenStack、LXCなど) - Software Design執筆(systemdほか) 前職: - 2003∼2011年 SIerで企画、開発、インフラ運用 - 組み込み、Web、スマフォアプリ、動画配信など 最近気になっていること - Apache Mesos、Consul、Prometheus、HTTP/2
  • 6. ECSとは - AWS re:Invent 2014 @ Las Vegas (2014.11.11~14)で発表された新サービス - Amazon EC2 Container Serviceの略 - 2015.2.18現在はまだプレビューリリース(登録制。us-east-1のみで利用可能) - EC2(コンテナインスタンス)にコンテナを簡単に起動できる - ECS向けの専用AMIが用意されている(独自に用意して使うこともできる) - Docker互換(現時点でサポートするコンテナプラットフォームはDockerのみ) - クラスタ(インスタンスのグルーピング) - タスクという概念 - リソーススケジューラー
  • 7. ECSを試しに使ってみた - まずはプレビュー登録  http://aws.amazon.com/jp/ecs/preview/ - しばらく待つ(場合によって数日∼2週間くらい) - 「使ってみた」系記事が速攻で上がっているのでひと通りやってみる このあたりとか  http://dev.classmethod.jp/cloud/ecs-ataglance/  http://tech.recruit-mp.co.jp/infrastructure/preview-amazon-ec2-container-service/  
  • 8. 使ってみてどうだったのか - 手順通りにやれば誰でも簡単にコンテナのクラスタを構成できる - コンソールダッシュボードではECSの操作できない(おそらくプレビューだから) - AWS CLIを使ってクラスタやタスクを操作するのが前提(いまのところ) - JSONファイルに定義してコマンドに渡す操作が基本 - Docker Hubをそのまま使える(プライベートのレジストリでも問題ない) - 料金はEC2, EBSの利用料だけ気にすればよい(ECS利用料は存在しない) - CoreOSをECSのクラスタに追加することが可能 - https://coreos.com/docs/running-coreos/cloud-providers/ecs/ - CoreOS起動時にECSのエージェント用のコンテナをDocker pullして起動している
  • 9. ECS関連のキーワード クラスタ - コンテナをグルーピングしたもの - リソースプールとして扱う - 同リージョン内で構成 エージェント - コンテナインスタンス(EC2)に起動しているDockerの1コンテナとして起動 - Docker Hub: https://registry.hub.docker.com/u/amazon/amazon-ecs-agent/ - GitHub: https://github.com/aws/amazon-ecs-agent タスク - コンテナ上で実行させるDockerイメージの定義 - 予約するメモリやCPU数などのリソースの定義 - クラスタ内で動作するコンテナの集合
  • 10. 動作環境について コンテナインスタンスのAMIについて amzn-ami-2014.09.1-amazon-ecs-optimized-preview2 (ami-34ddbe5c) Amazon ECS-Optimized Amazon Linux AMI 2014.09.1 x86_64 ECS HVM GP2 Preview 2 OSについて Amazon Linux 2014.09.1 Kernel: 3.14.26-24.46.amzn1.x86_64 Dockerのバージョンについて Client version: 1.3.3 Client API version: 1.15 Go version (client): go1.3.3 Git commit (client): c78088f/1.3.3 OS/Arch (client): linux/amd64 Server version: 1.3.3 Server API version: 1.15 Go version (server): go1.3.3 Git commit (server): c78088f/1.3.3
  • 11. まとめ - 複数のEC2インスタンスを横断してDockerコンテナを管理できるのがよい - API, CLIで操作できるので各種システムと連携できる - 既存のDockerイメージなどの資産を再利用できる - AWSのセキュリティグループやELBなどの連携ができるのは嬉しい - Elastic IPも使えるようになるらしい - いつ東京リージョンで使えるようになるかはわからない - 本番で使うべきかどうかもまだわからない - 管理レイヤーができたことで本番導入が近づいたのは間違いない - オンプレとAWSの併用でDockerを使うのはまだハードルが高い - そもそもDockerが最適解なのかもまだわからない(Rocketとかもあるし)
  • 13. Apache Mesosとの連携 - Cluster Management with Amazon ECS - https://aws.amazon.com/jp/blogs/compute/cluster-management-with-amazon-ecs/ - 2015.2.6の投稿 - Amazon ECS Scheduler Driver - https://github.com/awslabs/ecs-mesos-scheduler-driver - 2015.1.29が最初のコミット - Mesosをにドライバを追加して、Mesosを通じてECSのコンテナを扱うことができる? - AWSだけじゃなく、他のクラウドとかオンプレを意識せずに使えるようになる? - ECS Agentも併用するとAWSじゃなくてもいいはず - まだ試せてない
  • 14. 参考情報 ・Amazon EC2 Container Service  http://aws.amazon.com/jp/ecs/ ・Amazon EC2 Container Service Developer Guide  http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ ・AWS CLI ecs  http://docs.aws.amazon.com/cli/latest/reference/ecs/index.html ・ECS for Docker Meetup #4  http://www.slideshare.net/shot6/ecs-for-docker-meetup-4 ・今日届いたAmazon EC2 Container Service (ECS)を使ってみた  http://tech.recruit-mp.co.jp/infrastructure/preview-amazon-ec2-container-service/ ・Amazon EC2 Container Service(ECS)で静的Webサイトをデプロイする  http://dev.classmethod.jp/cloud/aws/ecs-deploy-static-website/ ・CoreOSをECS(EC2 Container Service)クラスタに追加する  http://dev.classmethod.jp/cloud/add-coreos-to-ecs-cluster/