SlideShare a Scribd company logo
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
[Unit] 
Description=busybox 
Requires=docker.service 
After=docker.service 
[Service] 
TimeoutStartSec=0 
ExecStartPre=-/usr/bin/docker kill busybox 
ExecStartPre=-/usr/bin/docker rm busybox 
ExecStartPre=/usr/bin/docker pull busybox 
ExecStart=/usr/bin/docker run --name busybox busybox /bin/sh -c "while 
true; do echo Hello World; sleep 1; done" 
ExecStop=/usr/bin/docker stop busybox 
[X-Fleet] 
X-Conflicts=busybox@*.service
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
coreos: 
etcd: 
discovery: https://discovery.etcd.io/<token> 
addr: $private_ipv4:4001 
peer-addr: $private_ipv4:7001 
units: 
- name: etcd.service 
command: start 
- name: fleet.service 
command: start 
ssh_authorized_keys: 
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0g+ZTxC7weoIJLUaf 
Ogrm+h... 
write_files: 
- path: /etc/motd 
permissions: 0644 
owner: root 
content: | 
Good news, everyone!
CoreOSによるDockerコンテナのクラスタリング
#cloud-config 
coreos: 
update: 
reboot-strategy: best-effort 
etcd: 
# generate a new token for each unique cluster from https://discover 
y.etcd.io/new 
discovery: https://discovery.etcd.io/<token> 
addr: $private_ipv4:4001 
peer-addr: $private_ipv4:7001 
units: 
- name: etcd.service 
command: start 
- name: fleet.service 
command: start
write_files: 
- path: /tmp/busybox@.service 
content: | 
[Unit] 
Description=busybox 
Requires=docker.service 
After=docker.service 
[Service] 
TimeoutStartSec=0 
ExecStartPre=-/usr/bin/docker kill busybox-%i 
ExecStartPre=-/usr/bin/docker rm busybox-%i 
ExecStartPre=/usr/bin/docker pull busybox 
ExecStart=/usr/bin/docker run --name busybox-%i busybox /bin/sh - 
c "while true; do echo Hello World; sleep 1; done" 
ExecStop=/usr/bin/docker stop busybox-%i 
[X-Fleet] 
X-Conflicts=busybox@*.service
# 必要に応じて 
gcloud config set project <project_id> 
gcloud config set compute/zone asia-east1-a 
gcloud config set compute/region asia-east1 
# 3つのインスタンスを起動 
gcloud compute instances create core1 core2 core3 --image coreos  
--machine-type f1-micro --metadata-from-file user-data=cloud-config.ya 
ml
# ログイン 
gcloud compute ssh core1 
# サービスの登録と起動 
fleetctl submit /tmp/busybox@.service 
fleetctl start busybox@{1,2}.service 
fleetctl list-units
# unitに割り当てのあるインスタンスを削除してみる 
gcloud compute instances delete core2 
gcloud compute ssh core1 
# フェイルオーバーが行われることを確認 
fleetctl list-units 
UNIT DSTATE STATE MACHINE ACTIVE 
busybox@.service inactive inactive - - 
busybox@1.service launched launched ffc81480.../10.xxx.xxx.237 active 
busybox@2.service launched launched 99f741a8.../10.xxx.xxx.150 active 
UNIT DSTATE STATE MACHINE ACTIVE 
busybox@.service inactive inactive - - 
busybox@1.service launched launched ffc81480.../10.xxx.xxx.237 active 
busybox@2.service launched launched 27c76d9a.../10.xxx.xxx.221 activa 
ting
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング

More Related Content

What's hot

Docker 原理與實作
Docker 原理與實作Docker 原理與實作
Docker 原理與實作
kao kuo-tung
 
Docker1.12イングレスロードバランサ
Docker1.12イングレスロードバランサDocker1.12イングレスロードバランサ
Docker1.12イングレスロードバランサ
Yuji Oshima
 
Docker on openstack by OpenSource Consulting
Docker on openstack by OpenSource ConsultingDocker on openstack by OpenSource Consulting
Docker on openstack by OpenSource Consulting
Open Source Consulting
 
이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure
Daegwon Kim
 
CoreOS in a Nutshell
CoreOS in a NutshellCoreOS in a Nutshell
CoreOS in a Nutshell
CoreOS
 
Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3
Binary Studio
 
K8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみる
K8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみるK8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみる
K8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみる
JUNICHI YOSHISE
 
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
raccoony
 
Dockerを利用したローカル環境から本番環境までの構築設計
Dockerを利用したローカル環境から本番環境までの構築設計Dockerを利用したローカル環境から本番環境までの構築設計
Dockerを利用したローカル環境から本番環境までの構築設計
Koichi Nagaoka
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutes
Luciano Fiandesio
 
Lessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containersLessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containers
Ben Hall
 
Vagrant
VagrantVagrant
Multi container apps swarm + consul + compose
Multi container apps   swarm + consul + composeMulti container apps   swarm + consul + compose
Multi container apps swarm + consul + compose
Eueung Mulyana
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js Applications
Ben Hall
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
tomasbart
 
Getting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyGetting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and Symfony
André Rømcke
 
2015 DockerCon Using Docker in production at bity.com
2015 DockerCon Using Docker in production at bity.com2015 DockerCon Using Docker in production at bity.com
2015 DockerCon Using Docker in production at bity.com
Mathieu Buffenoir
 
kubernetes practice
kubernetes practicekubernetes practice
kubernetes practice
wonyong hwang
 
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and ChefScaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
bridgetkromhout
 
Docker 初探,實驗室中的運貨鯨
Docker 初探,實驗室中的運貨鯨Docker 初探,實驗室中的運貨鯨
Docker 初探,實驗室中的運貨鯨
Ruoshi Ling
 

What's hot (20)

Docker 原理與實作
Docker 原理與實作Docker 原理與實作
Docker 原理與實作
 
Docker1.12イングレスロードバランサ
Docker1.12イングレスロードバランサDocker1.12イングレスロードバランサ
Docker1.12イングレスロードバランサ
 
Docker on openstack by OpenSource Consulting
Docker on openstack by OpenSource ConsultingDocker on openstack by OpenSource Consulting
Docker on openstack by OpenSource Consulting
 
이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure
 
CoreOS in a Nutshell
CoreOS in a NutshellCoreOS in a Nutshell
CoreOS in a Nutshell
 
Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3
 
K8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみる
K8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみるK8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみる
K8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみる
 
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
 
Dockerを利用したローカル環境から本番環境までの構築設計
Dockerを利用したローカル環境から本番環境までの構築設計Dockerを利用したローカル環境から本番環境までの構築設計
Dockerを利用したローカル環境から本番環境までの構築設計
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutes
 
Lessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containersLessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containers
 
Vagrant
VagrantVagrant
Vagrant
 
Multi container apps swarm + consul + compose
Multi container apps   swarm + consul + composeMulti container apps   swarm + consul + compose
Multi container apps swarm + consul + compose
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js Applications
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
 
Getting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyGetting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and Symfony
 
2015 DockerCon Using Docker in production at bity.com
2015 DockerCon Using Docker in production at bity.com2015 DockerCon Using Docker in production at bity.com
2015 DockerCon Using Docker in production at bity.com
 
kubernetes practice
kubernetes practicekubernetes practice
kubernetes practice
 
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and ChefScaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
 
Docker 初探,實驗室中的運貨鯨
Docker 初探,實驗室中的運貨鯨Docker 初探,實驗室中的運貨鯨
Docker 初探,實驗室中的運貨鯨
 

Viewers also liked

CoreOS入門
CoreOS入門CoreOS入門
CoreOS入門
Yutaka Matsubara
 
20140726 jaws-ug chiba AWS operation best practice
20140726 jaws-ug chiba AWS operation best practice20140726 jaws-ug chiba AWS operation best practice
20140726 jaws-ug chiba AWS operation best practice
Kazuki Ueki
 
Using LXC on Production
Using LXC on ProductionUsing LXC on Production
Using LXC on Production
Isao Shimizu
 
HyClops for Zabbix紹介資料
HyClops for Zabbix紹介資料HyClops for Zabbix紹介資料
HyClops for Zabbix紹介資料
Daisuke Ikeda
 
コンテナ型仮想化とはなんだったのか
コンテナ型仮想化とはなんだったのかコンテナ型仮想化とはなんだったのか
コンテナ型仮想化とはなんだったのか
えむ ばーど
 
No Monitoring, No Life on AWS
No Monitoring, No Life on AWSNo Monitoring, No Life on AWS
No Monitoring, No Life on AWS
Masahito Zembutsu
 
20140717 awssummit2014-cloud-operation
20140717 awssummit2014-cloud-operation20140717 awssummit2014-cloud-operation
20140717 awssummit2014-cloud-operation
Yasuhiro Araki, Ph.D
 
2014-07-26 jawsug-chiba ドキュメントを書こう! 運用自動化時代のドキュメンテーション
2014-07-26 jawsug-chiba ドキュメントを書こう! 運用自動化時代のドキュメンテーション2014-07-26 jawsug-chiba ドキュメントを書こう! 運用自動化時代のドキュメンテーション
2014-07-26 jawsug-chiba ドキュメントを書こう! 運用自動化時代のドキュメンテーション
Operation Lab, LLC.
 
第4回コンテナ型仮想化勉強会@東京 Oracle Solaris のコンテナ技術「Solaris Zones」
第4回コンテナ型仮想化勉強会@東京 Oracle Solaris のコンテナ技術「Solaris Zones」第4回コンテナ型仮想化勉強会@東京 Oracle Solaris のコンテナ技術「Solaris Zones」
第4回コンテナ型仮想化勉強会@東京 Oracle Solaris のコンテナ技術「Solaris Zones」
Kazuyuki Sato
 
VagrantユーザのためのDocker入門
VagrantユーザのためのDocker入門VagrantユーザのためのDocker入門
VagrantユーザのためのDocker入門
Masashi Shinbara
 
SendGridサンプルの紹介
SendGridサンプルの紹介SendGridサンプルの紹介
SendGridサンプルの紹介
Shunji Konishi
 
AWSを含めたハイブリッド環境の監視の実現 ~zabbixのクラウド対応モジュールHyClops~
AWSを含めたハイブリッド環境の監視の実現 ~zabbixのクラウド対応モジュールHyClops~AWSを含めたハイブリッド環境の監視の実現 ~zabbixのクラウド対応モジュールHyClops~
AWSを含めたハイブリッド環境の監視の実現 ~zabbixのクラウド対応モジュールHyClops~
Daisuke Ikeda
 
Jtfハンズオン資料(公開版)
Jtfハンズオン資料(公開版)Jtfハンズオン資料(公開版)
Jtfハンズオン資料(公開版)
亮介 山口
 
コンテナ基盤であるLXC/LXDを 本番環境で運用する話
コンテナ基盤であるLXC/LXDを 本番環境で運用する話コンテナ基盤であるLXC/LXDを 本番環境で運用する話
コンテナ基盤であるLXC/LXDを 本番環境で運用する話
Nobuhiro Fujita
 
オンプレミスから AWS への劇的ビフォーアフター
オンプレミスから AWS への劇的ビフォーアフターオンプレミスから AWS への劇的ビフォーアフター
オンプレミスから AWS への劇的ビフォーアフター
manabusakai
 
Dockerを使ったローカルでの開発から本番環境へのデプロイまで
Dockerを使ったローカルでの開発から本番環境へのデプロイまでDockerを使ったローカルでの開発から本番環境へのデプロイまで
Dockerを使ったローカルでの開発から本番環境へのデプロイまで
Ryo Nakamaru
 
Dockerクイックツアー
DockerクイックツアーDockerクイックツアー
Dockerクイックツアー
Etsuji Nakai
 
ご注文は監視自動化ですか?
ご注文は監視自動化ですか?ご注文は監視自動化ですか?
ご注文は監視自動化ですか?
Masahito Zembutsu
 

Viewers also liked (18)

CoreOS入門
CoreOS入門CoreOS入門
CoreOS入門
 
20140726 jaws-ug chiba AWS operation best practice
20140726 jaws-ug chiba AWS operation best practice20140726 jaws-ug chiba AWS operation best practice
20140726 jaws-ug chiba AWS operation best practice
 
Using LXC on Production
Using LXC on ProductionUsing LXC on Production
Using LXC on Production
 
HyClops for Zabbix紹介資料
HyClops for Zabbix紹介資料HyClops for Zabbix紹介資料
HyClops for Zabbix紹介資料
 
コンテナ型仮想化とはなんだったのか
コンテナ型仮想化とはなんだったのかコンテナ型仮想化とはなんだったのか
コンテナ型仮想化とはなんだったのか
 
No Monitoring, No Life on AWS
No Monitoring, No Life on AWSNo Monitoring, No Life on AWS
No Monitoring, No Life on AWS
 
20140717 awssummit2014-cloud-operation
20140717 awssummit2014-cloud-operation20140717 awssummit2014-cloud-operation
20140717 awssummit2014-cloud-operation
 
2014-07-26 jawsug-chiba ドキュメントを書こう! 運用自動化時代のドキュメンテーション
2014-07-26 jawsug-chiba ドキュメントを書こう! 運用自動化時代のドキュメンテーション2014-07-26 jawsug-chiba ドキュメントを書こう! 運用自動化時代のドキュメンテーション
2014-07-26 jawsug-chiba ドキュメントを書こう! 運用自動化時代のドキュメンテーション
 
第4回コンテナ型仮想化勉強会@東京 Oracle Solaris のコンテナ技術「Solaris Zones」
第4回コンテナ型仮想化勉強会@東京 Oracle Solaris のコンテナ技術「Solaris Zones」第4回コンテナ型仮想化勉強会@東京 Oracle Solaris のコンテナ技術「Solaris Zones」
第4回コンテナ型仮想化勉強会@東京 Oracle Solaris のコンテナ技術「Solaris Zones」
 
VagrantユーザのためのDocker入門
VagrantユーザのためのDocker入門VagrantユーザのためのDocker入門
VagrantユーザのためのDocker入門
 
SendGridサンプルの紹介
SendGridサンプルの紹介SendGridサンプルの紹介
SendGridサンプルの紹介
 
AWSを含めたハイブリッド環境の監視の実現 ~zabbixのクラウド対応モジュールHyClops~
AWSを含めたハイブリッド環境の監視の実現 ~zabbixのクラウド対応モジュールHyClops~AWSを含めたハイブリッド環境の監視の実現 ~zabbixのクラウド対応モジュールHyClops~
AWSを含めたハイブリッド環境の監視の実現 ~zabbixのクラウド対応モジュールHyClops~
 
Jtfハンズオン資料(公開版)
Jtfハンズオン資料(公開版)Jtfハンズオン資料(公開版)
Jtfハンズオン資料(公開版)
 
コンテナ基盤であるLXC/LXDを 本番環境で運用する話
コンテナ基盤であるLXC/LXDを 本番環境で運用する話コンテナ基盤であるLXC/LXDを 本番環境で運用する話
コンテナ基盤であるLXC/LXDを 本番環境で運用する話
 
オンプレミスから AWS への劇的ビフォーアフター
オンプレミスから AWS への劇的ビフォーアフターオンプレミスから AWS への劇的ビフォーアフター
オンプレミスから AWS への劇的ビフォーアフター
 
Dockerを使ったローカルでの開発から本番環境へのデプロイまで
Dockerを使ったローカルでの開発から本番環境へのデプロイまでDockerを使ったローカルでの開発から本番環境へのデプロイまで
Dockerを使ったローカルでの開発から本番環境へのデプロイまで
 
Dockerクイックツアー
DockerクイックツアーDockerクイックツアー
Dockerクイックツアー
 
ご注文は監視自動化ですか?
ご注文は監視自動化ですか?ご注文は監視自動化ですか?
ご注文は監視自動化ですか?
 

Similar to CoreOSによるDockerコンテナのクラスタリング

JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachJDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
PROIDEA
 
青云CoreOS虚拟机部署kubernetes
青云CoreOS虚拟机部署kubernetes 青云CoreOS虚拟机部署kubernetes
青云CoreOS虚拟机部署kubernetes
Zhichao Liang
 
Beyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with PuppetBeyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with Puppet
lutter
 
Docker container management
Docker container managementDocker container management
Docker container management
Karol Kreft
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
Ben Hall
 
Things I've learned working with Docker Support
Things I've learned working with Docker SupportThings I've learned working with Docker Support
Things I've learned working with Docker Support
Sujay Pillai
 
Simple docker hosting in FIWARE Lab
Simple docker hosting in FIWARE LabSimple docker hosting in FIWARE Lab
Simple docker hosting in FIWARE Lab
Fernando Lopez Aguilar
 
Docker Compose and Panamax - ContainerDays Boston - June 2015
Docker Compose and Panamax - ContainerDays Boston - June 2015Docker Compose and Panamax - ContainerDays Boston - June 2015
Docker Compose and Panamax - ContainerDays Boston - June 2015
Jonas Rosland
 
Introduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group CologneIntroduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group Cologne
D
 
Vagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptopVagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptop
Lorin Hochstein
 
AWS 기반 Docker, Kubernetes
AWS 기반 Docker, KubernetesAWS 기반 Docker, Kubernetes
AWS 기반 Docker, Kubernetes
정빈 권
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
Paul Chao
 
Docker command
Docker commandDocker command
Docker command
Eric Ahn
 
Docker security
Docker securityDocker security
Docker security
Janos Suto
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
Ben Hall
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
Philip Zheng
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
Simon Su
 
Linux configer
Linux configerLinux configer
Linux configer
MD. AL AMIN
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on Docker
Ben Hall
 
桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作
Philip Zheng
 

Similar to CoreOSによるDockerコンテナのクラスタリング (20)

JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachJDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
 
青云CoreOS虚拟机部署kubernetes
青云CoreOS虚拟机部署kubernetes 青云CoreOS虚拟机部署kubernetes
青云CoreOS虚拟机部署kubernetes
 
Beyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with PuppetBeyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with Puppet
 
Docker container management
Docker container managementDocker container management
Docker container management
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 
Things I've learned working with Docker Support
Things I've learned working with Docker SupportThings I've learned working with Docker Support
Things I've learned working with Docker Support
 
Simple docker hosting in FIWARE Lab
Simple docker hosting in FIWARE LabSimple docker hosting in FIWARE Lab
Simple docker hosting in FIWARE Lab
 
Docker Compose and Panamax - ContainerDays Boston - June 2015
Docker Compose and Panamax - ContainerDays Boston - June 2015Docker Compose and Panamax - ContainerDays Boston - June 2015
Docker Compose and Panamax - ContainerDays Boston - June 2015
 
Introduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group CologneIntroduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group Cologne
 
Vagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptopVagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptop
 
AWS 기반 Docker, Kubernetes
AWS 기반 Docker, KubernetesAWS 기반 Docker, Kubernetes
AWS 기반 Docker, Kubernetes
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
 
Docker command
Docker commandDocker command
Docker command
 
Docker security
Docker securityDocker security
Docker security
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
 
Linux configer
Linux configerLinux configer
Linux configer
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on Docker
 
桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作
 

Recently uploaded

(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...
(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...
(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...
Priyanka Aash
 
Introduction-to-the-IAM-Platform-Implementation-Plan.pptx
Introduction-to-the-IAM-Platform-Implementation-Plan.pptxIntroduction-to-the-IAM-Platform-Implementation-Plan.pptx
Introduction-to-the-IAM-Platform-Implementation-Plan.pptx
313mohammedarshad
 
(CISOPlatform Summit & SACON 2024) Regulation & Response In Banks.pdf
(CISOPlatform Summit & SACON 2024) Regulation & Response In Banks.pdf(CISOPlatform Summit & SACON 2024) Regulation & Response In Banks.pdf
(CISOPlatform Summit & SACON 2024) Regulation & Response In Banks.pdf
Priyanka Aash
 
Computer HARDWARE presenattion by CWD students class 10
Computer HARDWARE presenattion by CWD students class 10Computer HARDWARE presenattion by CWD students class 10
Computer HARDWARE presenattion by CWD students class 10
ankush9927
 
(CISOPlatform Summit & SACON 2024) Gen AI & Deepfake In Overall Security.pdf
(CISOPlatform Summit & SACON 2024) Gen AI & Deepfake In Overall Security.pdf(CISOPlatform Summit & SACON 2024) Gen AI & Deepfake In Overall Security.pdf
(CISOPlatform Summit & SACON 2024) Gen AI & Deepfake In Overall Security.pdf
Priyanka Aash
 
Zaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdfZaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdf
AmandaCheung15
 
Google I/O Extended Harare Merged Slides
Google I/O Extended Harare Merged SlidesGoogle I/O Extended Harare Merged Slides
Google I/O Extended Harare Merged Slides
Google Developer Group - Harare
 
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Muhammad Ali
 
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
Priyanka Aash
 
Patch Tuesday de julio
Patch Tuesday de julioPatch Tuesday de julio
Patch Tuesday de julio
Ivanti
 
Semantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software DevelopmentSemantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software Development
Baishakhi Ray
 
July Patch Tuesday
July Patch TuesdayJuly Patch Tuesday
July Patch Tuesday
Ivanti
 
The Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF GuideThe Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF Guide
Shiv Technolabs
 
(CISOPlatform Summit & SACON 2024) Orientation by CISO Platform_ Using CISO P...
(CISOPlatform Summit & SACON 2024) Orientation by CISO Platform_ Using CISO P...(CISOPlatform Summit & SACON 2024) Orientation by CISO Platform_ Using CISO P...
(CISOPlatform Summit & SACON 2024) Orientation by CISO Platform_ Using CISO P...
Priyanka Aash
 
Data Integration Basics: Merging & Joining Data
Data Integration Basics: Merging & Joining DataData Integration Basics: Merging & Joining Data
Data Integration Basics: Merging & Joining Data
Safe Software
 
Using LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and MilvusUsing LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and Milvus
Zilliz
 
IPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite SolutionIPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite Solution
IPLOOK Networks
 
Uncharted Together- Navigating AI's New Frontiers in Libraries
Uncharted Together- Navigating AI's New Frontiers in LibrariesUncharted Together- Navigating AI's New Frontiers in Libraries
Uncharted Together- Navigating AI's New Frontiers in Libraries
Brian Pichman
 
Vertex AI Agent Builder - GDG Alicante - Julio 2024
Vertex AI Agent Builder - GDG Alicante - Julio 2024Vertex AI Agent Builder - GDG Alicante - Julio 2024
Vertex AI Agent Builder - GDG Alicante - Julio 2024
Nicolás Lopéz
 
High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...
High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...
High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...
aslasdfmkhan4750
 

Recently uploaded (20)

(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...
(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...
(CISOPlatform Summit & SACON 2024) Workshop _ Most Dangerous Attack Technique...
 
Introduction-to-the-IAM-Platform-Implementation-Plan.pptx
Introduction-to-the-IAM-Platform-Implementation-Plan.pptxIntroduction-to-the-IAM-Platform-Implementation-Plan.pptx
Introduction-to-the-IAM-Platform-Implementation-Plan.pptx
 
(CISOPlatform Summit & SACON 2024) Regulation & Response In Banks.pdf
(CISOPlatform Summit & SACON 2024) Regulation & Response In Banks.pdf(CISOPlatform Summit & SACON 2024) Regulation & Response In Banks.pdf
(CISOPlatform Summit & SACON 2024) Regulation & Response In Banks.pdf
 
Computer HARDWARE presenattion by CWD students class 10
Computer HARDWARE presenattion by CWD students class 10Computer HARDWARE presenattion by CWD students class 10
Computer HARDWARE presenattion by CWD students class 10
 
(CISOPlatform Summit & SACON 2024) Gen AI & Deepfake In Overall Security.pdf
(CISOPlatform Summit & SACON 2024) Gen AI & Deepfake In Overall Security.pdf(CISOPlatform Summit & SACON 2024) Gen AI & Deepfake In Overall Security.pdf
(CISOPlatform Summit & SACON 2024) Gen AI & Deepfake In Overall Security.pdf
 
Zaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdfZaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdf
 
Google I/O Extended Harare Merged Slides
Google I/O Extended Harare Merged SlidesGoogle I/O Extended Harare Merged Slides
Google I/O Extended Harare Merged Slides
 
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
 
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
 
Patch Tuesday de julio
Patch Tuesday de julioPatch Tuesday de julio
Patch Tuesday de julio
 
Semantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software DevelopmentSemantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software Development
 
July Patch Tuesday
July Patch TuesdayJuly Patch Tuesday
July Patch Tuesday
 
The Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF GuideThe Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF Guide
 
(CISOPlatform Summit & SACON 2024) Orientation by CISO Platform_ Using CISO P...
(CISOPlatform Summit & SACON 2024) Orientation by CISO Platform_ Using CISO P...(CISOPlatform Summit & SACON 2024) Orientation by CISO Platform_ Using CISO P...
(CISOPlatform Summit & SACON 2024) Orientation by CISO Platform_ Using CISO P...
 
Data Integration Basics: Merging & Joining Data
Data Integration Basics: Merging & Joining DataData Integration Basics: Merging & Joining Data
Data Integration Basics: Merging & Joining Data
 
Using LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and MilvusUsing LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and Milvus
 
IPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite SolutionIPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite Solution
 
Uncharted Together- Navigating AI's New Frontiers in Libraries
Uncharted Together- Navigating AI's New Frontiers in LibrariesUncharted Together- Navigating AI's New Frontiers in Libraries
Uncharted Together- Navigating AI's New Frontiers in Libraries
 
Vertex AI Agent Builder - GDG Alicante - Julio 2024
Vertex AI Agent Builder - GDG Alicante - Julio 2024Vertex AI Agent Builder - GDG Alicante - Julio 2024
Vertex AI Agent Builder - GDG Alicante - Julio 2024
 
High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...
High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...
High Profile Girls Call ServiCe Hyderabad 0000000000 Tanisha Best High Class ...
 

CoreOSによるDockerコンテナのクラスタリング

  • 15. [Unit] Description=busybox Requires=docker.service After=docker.service [Service] TimeoutStartSec=0 ExecStartPre=-/usr/bin/docker kill busybox ExecStartPre=-/usr/bin/docker rm busybox ExecStartPre=/usr/bin/docker pull busybox ExecStart=/usr/bin/docker run --name busybox busybox /bin/sh -c "while true; do echo Hello World; sleep 1; done" ExecStop=/usr/bin/docker stop busybox [X-Fleet] X-Conflicts=busybox@*.service
  • 23. coreos: etcd: discovery: https://discovery.etcd.io/<token> addr: $private_ipv4:4001 peer-addr: $private_ipv4:7001 units: - name: etcd.service command: start - name: fleet.service command: start ssh_authorized_keys: - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0g+ZTxC7weoIJLUaf Ogrm+h... write_files: - path: /etc/motd permissions: 0644 owner: root content: | Good news, everyone!
  • 25. #cloud-config coreos: update: reboot-strategy: best-effort etcd: # generate a new token for each unique cluster from https://discover y.etcd.io/new discovery: https://discovery.etcd.io/<token> addr: $private_ipv4:4001 peer-addr: $private_ipv4:7001 units: - name: etcd.service command: start - name: fleet.service command: start
  • 26. write_files: - path: /tmp/busybox@.service content: | [Unit] Description=busybox Requires=docker.service After=docker.service [Service] TimeoutStartSec=0 ExecStartPre=-/usr/bin/docker kill busybox-%i ExecStartPre=-/usr/bin/docker rm busybox-%i ExecStartPre=/usr/bin/docker pull busybox ExecStart=/usr/bin/docker run --name busybox-%i busybox /bin/sh - c "while true; do echo Hello World; sleep 1; done" ExecStop=/usr/bin/docker stop busybox-%i [X-Fleet] X-Conflicts=busybox@*.service
  • 27. # 必要に応じて gcloud config set project <project_id> gcloud config set compute/zone asia-east1-a gcloud config set compute/region asia-east1 # 3つのインスタンスを起動 gcloud compute instances create core1 core2 core3 --image coreos --machine-type f1-micro --metadata-from-file user-data=cloud-config.ya ml
  • 28. # ログイン gcloud compute ssh core1 # サービスの登録と起動 fleetctl submit /tmp/busybox@.service fleetctl start busybox@{1,2}.service fleetctl list-units
  • 29. # unitに割り当てのあるインスタンスを削除してみる gcloud compute instances delete core2 gcloud compute ssh core1 # フェイルオーバーが行われることを確認 fleetctl list-units UNIT DSTATE STATE MACHINE ACTIVE busybox@.service inactive inactive - - busybox@1.service launched launched ffc81480.../10.xxx.xxx.237 active busybox@2.service launched launched 99f741a8.../10.xxx.xxx.150 active UNIT DSTATE STATE MACHINE ACTIVE busybox@.service inactive inactive - - busybox@1.service launched launched ffc81480.../10.xxx.xxx.237 active busybox@2.service launched launched 27c76d9a.../10.xxx.xxx.221 activa ting