SlideShare a Scribd company logo
1 of 34
Download to read offline
[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: 
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!
#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 ConsultingOpen Source Consulting
 
이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructureDaegwon Kim
 
CoreOS in a Nutshell
CoreOS in a NutshellCoreOS in a Nutshell
CoreOS in a NutshellCoreOS
 
Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3Binary 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 minutesLuciano 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 containersBen Hall
 
Multi container apps swarm + consul + compose
Multi container apps   swarm + consul + composeMulti container apps   swarm + consul + compose
Multi container apps swarm + consul + composeEueung 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 ApplicationsBen 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 Praguetomasbart
 
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 SymfonyAndré 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.comMathieu Buffenoir
 
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 Chefbridgetkromhout
 
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

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 practiceKazuki Ueki
 
Using LXC on Production
Using LXC on ProductionUsing LXC on Production
Using LXC on ProductionIsao 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 AWSMasahito Zembutsu
 
20140717 awssummit2014-cloud-operation
20140717 awssummit2014-cloud-operation20140717 awssummit2014-cloud-operation
20140717 awssummit2014-cloud-operationYasuhiro 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 LachPROIDEA
 
青云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 Puppetlutter
 
Docker container management
Docker container managementDocker container management
Docker container managementKarol 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 ProductionBen 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 SupportSujay Pillai
 
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 2015Jonas 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 CologneD
 
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 laptopLorin Hochstein
 
AWS 기반 Docker, Kubernetes
AWS 기반 Docker, KubernetesAWS 기반 Docker, Kubernetes
AWS 기반 Docker, Kubernetes정빈 권
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017Paul Chao
 
Docker command
Docker commandDocker command
Docker commandEric Ahn
 
Docker security
Docker securityDocker security
Docker securityJanos 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 ActionSimon Su
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on DockerBen 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

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 

Recently uploaded (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

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

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 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
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 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!
  • 24.
  • 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