SlideShare uma empresa Scribd logo
1 de 21
Nise-BOSHでCloudFoundryを1VMに構築
2014/04/26 NECソフト大塚元央
Page 2 © NEC Corporation 2013
▌ 導入
 自己紹介
 モチベーション
 Cloud Foundry 構成
▌ 1VM Cloud Foundry の構築
 流れ
 Nise-BOSH のインストール
 Cloud Foundry のリリース作成
 Cloud Foundry のインストール
目次
目次
大塚元央 (Yuanying)
▌ 所属: NECソフト ITシステム事業部
▌ Twitter: @yuanying
▌ 趣味
 トライアスロン
▌ 古い昔の趣味
 Mac
• iExtractMP3
 Ruby
• ConnectImporter (http://labs.3machinae.com/garmin2runkeeper)
Page 3 © NEC Corporation 2010
導入
自己紹介
もっと気軽に Cloud Foundry の最新版を試したい
▌ BOSH
 IaaS統合は良いんだけど、ローカルで環境作るのどうするの?
 BOSH 自体で 1VM+ も使いたくない。
▌ Nise-BOSH
 これがあれば Vagrant で試せる!
 複数ジョブテンプレートを一度にインストールすれば 1VM で Cloud
Foundry が動くんじゃ?
• https://github.com/yuanying/nise_bosh#multi-monitrc-spike
• https://github.com/yuanying/cf-release
– cf-release もちょっと修正する必要があった。
 参考
• https://github.com/cloudfoundry/micro
Page 4 © NEC Corporation 2013
導入
モチベーション
Cloud Foundry の最低構成は?
▌ cf-release/jobs
 たくさんあるけど全部使ったりしないよね?
 とりあえず service なんて無くて良い、動けば。
 最新のコンポーネントを使いたい。
• router よりgorouter
• cloud_controller_ng
Page 5 © NEC Corporation 2013
導入
Cloud Foundry 構成
Cloud Foundry を構成する最低インタフェース
Page 6 © NEC Corporation 2013
導入
Cloud Foundry 構成
じゃあこれらをcf-release の Job Template で実装すると?
Page 7 © NEC Corporation 2013
導入
Cloud Foundry 構成
依存関係を調査してみた。
(実行時には上にあるコンポーネント
から)
Page 8 © NEC Corporation 2013
導入
Cloud Foundry 構成
最新コンポーネントを試そうと思う
と、
こうなる。
Page 9 © NEC Corporation 2013
1. Nise-BOSH のインストール
2. Cloud Foundry のリリース作成
3. Cloud Foundry のインストール
1VM Cloud Foundry の構築
流れ
Page 10 © NEC Corporation 2013
▌ 本家でなく、複数ジョブテンプレートインストールに対応したブ
ランチを利用する。
 後々もっと奇麗な形で複数ジョブテンプレートのインストールに対応す
るので、この手順は多分非推奨…。
 dea_next用に gen-stemcellする必要があるかと思いきや、、最新版の
dea_nextだとrootfs用のパッケージがcf-release に用意してあるため必要
ない模様。
1VM Cloud Foundry の構築
Nise-BOSH のインストール
$ git clone https://github.com/yuanying/nise_bosh.git
$ git checkout –bmulti-monitrc-spike origin/multi-monitrc-spike
$ bundle install
$ ./bin/init
$ apt-get install debootstraprunit
Page 11 © NEC Corporation 2013
1VM Cloud Foundry の構築
Cloud Foundry のリリース作成
$ git clone https://github.com/cloudfoundry/cf-release.git
$ cd ./cf-release
$ git remote add yuanyinghttps://github.com/yuanying/cf-release.git
$ git pull yuanying master
From https://github.com/yuanying/cf-release
* branch master -> FETCH_HEAD
Updating 4fd9c30..c9d596a
Fast-forward
jobs/cloud_controller_ng/monit | 2 ++
jobs/dea_next/templates/dea.yml.erb | 12 ++++++++++++
jobs/dea_next/templates/warden_ctl | 18 ------------------
jobs/hbase_master/templates/+--hbase_zookeeper_ctl | 4 +
packages/nginx/packaging | 1 +
packages/nginx_next/packaging | 1 +
packages/ruby/packaging | 1 +
packages/ruby_next/packaging | 1 +
8 files changed, 20 insertions(+), 20 deletions(-)
1VM で動くように、いくつかcf-release を
修正。
cloud_controllerでのnginxの無効化
▌ 何故かnginxが 1VM で CF 構築時に、staging の邪魔をしていたの
でよくわからないけど使うのを止めた。
Page 12 © NEC Corporation 2010
1VM Cloud Foundry の構築
Cloud Foundry のリリース作成
--- a/jobs/cloud_controller_ng/monit
+++ b/jobs/cloud_controller_ng/monit
@@ -4,10 +4,8 @@ check process cloud_controller_ng
stop program "/var/vcap/jobs/cloud_controller_ng/bin/cloud_controller_ng_ctl stop"
group vcap
+<% if p("ccng.use_nginx", true) %>
check process nginx_ccng
with pidfile /var/vcap/sys/run/nginx_ccng/nginx.pid
start program "/var/vcap/jobs/cloud_controller_ng/bin/nginx_ctl start"
stop program "/var/vcap/jobs/cloud_controller_ng/bin/nginx_ctl stop"
group vcap
+<% end %>
warden_ctrからstemcell.tar.gz関連を削除
Page 13 © NEC Corporation 2010
1VM Cloud Foundry の構築
Cloud Foundry のリリース作成
--- a/jobs/dea_next/templates/warden_ctl
+++ b/jobs/dea_next/templates/warden_ctl
@@ -24,24 +24,6 @@ case $1 in
ulimit -c unlimited
- rootfs_path=$DATA_DIR/rootfs
- rootfs_tgz=/var/vcap/stemcell_base.tar.gz
-
- # Extract rootfs if needed
- if [ ! -d $rootfs_path ]
- then
- # Make sure its parent directory exists
- mkdir -p $(dirname $rootfs_path)
-
- # Extract to temporary path, then rename to target path.
- # This makes sure that it is not possible that we end up with directory
- # that contains a partially extracted archive.
- tmp_path=$(mktemp --tmpdir=$(dirname $rootfs_path) -d)
- chmod 755 $tmp_path
- tar -C $tmp_path -zxf $rootfs_tgz
- mv $tmp_path $rootfs_path
- fi
これはたぶん、本家の消し忘れ。
1VM なのでnfsの利用を削除
Page 14 © NEC Corporation 2010
1VM Cloud Foundry の構築
Cloud Foundry のリリース作成
--- a/jobs/serialization_data_server/templates/serialization_data_server_ctl
+++ b/jobs/serialization_data_server/templates/serialization_data_server_ctl
@@ -36,7 +36,9 @@ case $1 in
<% end %>
mkdir -p $SNAPSHOT_DIR
+ <% unless properties.micro %>
check_mount "$MT_OPTS" "$MT_EXPORT" "$SNAPSHOT_DIR"
+ <% end %>
mkdir -p $SDS_TMP_UPLOAD_DIR
chownvcap:vcap $SDS_TMP_UPLOAD_DIR
Page 15 © NEC Corporation 2013
▌ ここでNise-BOSH にリクエスト
 最新のリリースを試したいだけな場合にわざわざ bosh create release し
たくない!
• bosh sync blobs だけで大丈夫なんじゃ?
 Job Template と Package の取得方法がちょっとごっちゃになってる。
• Job Template はリリースレポジトリのソース(jobs ディレクトリ)そのまま使う
のに、
• Package はなんで .dev_builds / .final_buildsを使うのか?
 リリースファイルを指定したら .dev_builds / .final_buildsの jobs と
package を使う、
 リリースレポジトリを指定したら、レポジトリ下のソースを利用するよ
うにして欲しい(したい)。
1VM Cloud Foundry の構築
Cloud Foundry のリリース作成
$ ./update
$ gem install –no-ri –no-rdocbosh_cli
$ bosh create release --force
Page 16 © NEC Corporation 2013
▌ 最低構成の Job Template をインストール。
 問題は、deployment manifest (micro_ng.yml) の内容…。
 cloudfoundry/micro を参考に
• https://github.com/cloudfoundry/micro/blob/master/deploy/manifest-ng.yml
 実際に使った deployment manifest
• https://gist.github.com/yuanying/2b41f8bd3819de0bd520
1VM Cloud Foundry の構築
Cloud Foundry のインストール
$ bundle exec ./bin/nise-bosh ../cf-release ../micro_ng.yml -n 127.0.0.1 postgres
$ bundle exec ./bin/nise-bosh ../cf-release ../micro_ng.yml -n 127.0.0.1 nats
$ bundle exec ./bin/nise-bosh ../cf-release ../micro_ng.yml -n 127.0.0.1 gorouter
$ bundle exec ./bin/nise-bosh ../cf-release ../micro_ng.yml -n 127.0.0.1 dea_next
$ bundle exec ./bin/nise-bosh ../cf-release ../micro_ng.yml -n 127.0.0.1 health_manager_next
$ bundle exec ./bin/nise-bosh ../cf-release ../micro_ng.yml -n 127.0.0.1 cloud_controller_ng
$ bundle exec ./bin/nise-bosh ../cf-release ../micro_ng.yml -n 127.0.0.1 serialization_data_server
$ bundle exec ./bin/nise-bosh ../cf-release ../micro_ng.yml -n 127.0.0.1 uaa
$ bundle exec ./bin/nise-bosh ../cf-release ../micro_ng.yml -n 127.0.0.1 vcap_redis
Page 17 © NEC Corporation 2013
▌ properties.microを true に
▌ ドメインにxip.ioを指定。
 IP アドレスベースのワイルドカードDNS。便利。
1VM Cloud Foundry の構築
Cloud Foundry のインストール
---
deployment: micro
properties:
micro: true
domain: 192.168.33.10.xip.io
cc_props: ccng
hm_props: health_manager_ccng
Page 18 © NEC Corporation 2013
▌ ccng.use_nginxを false に
▌ ccngのプロパティはデフォルト値が spec で決まっているものが
多いが、Nise-BOSH がプロパティのデフォルト値に対応していな
いため、すべて指定する必要があり大変。。
1VM Cloud Foundry の構築
Cloud Foundry のインストール
ccng: &ccng
use_nginx: false
default_quota_definition: free
srv_api_uri: http://api.192.168.33.10.xip.io
logging_level: debug
bulk_api_password: bulk_api_password
staging_upload_user: staging
staging_upload_password: staging
external_host: api
uaa_resource_id: cloud_controller
quota_definitions:
free:
total_services: 10
memory_limit: 1024
non_basic_services_allowed: false
… (以下略)
Page 19 © NEC Corporation 2013
▌ uaa.no_sslを true に
▌ cfクライアントを追加 (vmcの代わり)
 autoapproveに登録しないとブラウザベースの認証しないと使えない。
 cloud_controller.admin scope の追加。
1VM Cloud Foundry の構築
Cloud Foundry のインストール
uaa:
spring_profiles: postgresql
no_ssl: true
autoapprove:
- cf
scim:
users:
- micro@vcap.me|micro|scim.write,scim.read,openid
clients:
cf:
override: true
authorized-grant-types: implicit
authorities: uaa.none
scope:
cloud_controller.read,cloud_controller.write,openid,password.write,cloud_controller.admin,scim.read,scim.write
起動!
Page 20 © NEC Corporation 2013
1VM Cloud Foundry の構築
Cloud Foundry のインストール
$ mkdir -p /var/vcap/shared
$ chownvcap:vcap /var/vcap/shared
$ mkdir -p /var/vcap/store
$ ./bin/run-job start postgres
$ ./bin/run-job start nats
$ ./bin/run-job start gorouter
$ ./bin/run-job start dea_next
$ ./bin/run-job start health_manager_next
$ ./bin/run-job start cloud_controller_ng
$ ./bin/run-job start serialization_data_server
$ ./bin/run-job start uaa
$ ./bin/run-job start vcap_redis
Page 21 © NEC Corporation 2012

Mais conteúdo relacionado

Último

NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NTT DATA Technology & Innovation
 
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Music...
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察  ~Text-to-MusicとText-To-ImageかつImage-to-Music...モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察  ~Text-to-MusicとText-To-ImageかつImage-to-Music...
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Music...博三 太田
 
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)Hiroshi Tomioka
 
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdfAWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdfFumieNakayama
 
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)UEHARA, Tetsutaro
 
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdfクラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdfFumieNakayama
 
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案sugiuralab
 
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?akihisamiyanaga1
 
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineerYuki Kikuchi
 

Último (9)

NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
 
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Music...
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察  ~Text-to-MusicとText-To-ImageかつImage-to-Music...モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察  ~Text-to-MusicとText-To-ImageかつImage-to-Music...
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Music...
 
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
 
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdfAWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
 
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
 
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdfクラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
 
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
 
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
 
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
 

Destaque

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
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 EngineeringsPixeldarts
 
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 HealthThinkNow
 
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.pdfmarketingartwork
 
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 2024Neil Kimberley
 
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)contently
 
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 2024Albert Qian
 
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 InsightsKurio // The Social Media Age(ncy)
 
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 2024Search Engine Journal
 
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 summarySpeakerHub
 
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 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 Tessa Mero
 
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 IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
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 managementMindGenius
 
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...RachelPearson36
 
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...Applitools
 

Destaque (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
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...
 

Nise-BOSH で Cloud Foundry を 1VM に構築

  • 2. Page 2 © NEC Corporation 2013 ▌ 導入  自己紹介  モチベーション  Cloud Foundry 構成 ▌ 1VM Cloud Foundry の構築  流れ  Nise-BOSH のインストール  Cloud Foundry のリリース作成  Cloud Foundry のインストール 目次 目次
  • 3. 大塚元央 (Yuanying) ▌ 所属: NECソフト ITシステム事業部 ▌ Twitter: @yuanying ▌ 趣味  トライアスロン ▌ 古い昔の趣味  Mac • iExtractMP3  Ruby • ConnectImporter (http://labs.3machinae.com/garmin2runkeeper) Page 3 © NEC Corporation 2010 導入 自己紹介
  • 4. もっと気軽に Cloud Foundry の最新版を試したい ▌ BOSH  IaaS統合は良いんだけど、ローカルで環境作るのどうするの?  BOSH 自体で 1VM+ も使いたくない。 ▌ Nise-BOSH  これがあれば Vagrant で試せる!  複数ジョブテンプレートを一度にインストールすれば 1VM で Cloud Foundry が動くんじゃ? • https://github.com/yuanying/nise_bosh#multi-monitrc-spike • https://github.com/yuanying/cf-release – cf-release もちょっと修正する必要があった。  参考 • https://github.com/cloudfoundry/micro Page 4 © NEC Corporation 2013 導入 モチベーション
  • 5. Cloud Foundry の最低構成は? ▌ cf-release/jobs  たくさんあるけど全部使ったりしないよね?  とりあえず service なんて無くて良い、動けば。  最新のコンポーネントを使いたい。 • router よりgorouter • cloud_controller_ng Page 5 © NEC Corporation 2013 導入 Cloud Foundry 構成
  • 6. Cloud Foundry を構成する最低インタフェース Page 6 © NEC Corporation 2013 導入 Cloud Foundry 構成 じゃあこれらをcf-release の Job Template で実装すると?
  • 7. Page 7 © NEC Corporation 2013 導入 Cloud Foundry 構成 依存関係を調査してみた。 (実行時には上にあるコンポーネント から)
  • 8. Page 8 © NEC Corporation 2013 導入 Cloud Foundry 構成 最新コンポーネントを試そうと思う と、 こうなる。
  • 9. Page 9 © NEC Corporation 2013 1. Nise-BOSH のインストール 2. Cloud Foundry のリリース作成 3. Cloud Foundry のインストール 1VM Cloud Foundry の構築 流れ
  • 10. Page 10 © NEC Corporation 2013 ▌ 本家でなく、複数ジョブテンプレートインストールに対応したブ ランチを利用する。  後々もっと奇麗な形で複数ジョブテンプレートのインストールに対応す るので、この手順は多分非推奨…。  dea_next用に gen-stemcellする必要があるかと思いきや、、最新版の dea_nextだとrootfs用のパッケージがcf-release に用意してあるため必要 ない模様。 1VM Cloud Foundry の構築 Nise-BOSH のインストール $ git clone https://github.com/yuanying/nise_bosh.git $ git checkout –bmulti-monitrc-spike origin/multi-monitrc-spike $ bundle install $ ./bin/init $ apt-get install debootstraprunit
  • 11. Page 11 © NEC Corporation 2013 1VM Cloud Foundry の構築 Cloud Foundry のリリース作成 $ git clone https://github.com/cloudfoundry/cf-release.git $ cd ./cf-release $ git remote add yuanyinghttps://github.com/yuanying/cf-release.git $ git pull yuanying master From https://github.com/yuanying/cf-release * branch master -> FETCH_HEAD Updating 4fd9c30..c9d596a Fast-forward jobs/cloud_controller_ng/monit | 2 ++ jobs/dea_next/templates/dea.yml.erb | 12 ++++++++++++ jobs/dea_next/templates/warden_ctl | 18 ------------------ jobs/hbase_master/templates/+--hbase_zookeeper_ctl | 4 + packages/nginx/packaging | 1 + packages/nginx_next/packaging | 1 + packages/ruby/packaging | 1 + packages/ruby_next/packaging | 1 + 8 files changed, 20 insertions(+), 20 deletions(-) 1VM で動くように、いくつかcf-release を 修正。
  • 12. cloud_controllerでのnginxの無効化 ▌ 何故かnginxが 1VM で CF 構築時に、staging の邪魔をしていたの でよくわからないけど使うのを止めた。 Page 12 © NEC Corporation 2010 1VM Cloud Foundry の構築 Cloud Foundry のリリース作成 --- a/jobs/cloud_controller_ng/monit +++ b/jobs/cloud_controller_ng/monit @@ -4,10 +4,8 @@ check process cloud_controller_ng stop program "/var/vcap/jobs/cloud_controller_ng/bin/cloud_controller_ng_ctl stop" group vcap +<% if p("ccng.use_nginx", true) %> check process nginx_ccng with pidfile /var/vcap/sys/run/nginx_ccng/nginx.pid start program "/var/vcap/jobs/cloud_controller_ng/bin/nginx_ctl start" stop program "/var/vcap/jobs/cloud_controller_ng/bin/nginx_ctl stop" group vcap +<% end %>
  • 13. warden_ctrからstemcell.tar.gz関連を削除 Page 13 © NEC Corporation 2010 1VM Cloud Foundry の構築 Cloud Foundry のリリース作成 --- a/jobs/dea_next/templates/warden_ctl +++ b/jobs/dea_next/templates/warden_ctl @@ -24,24 +24,6 @@ case $1 in ulimit -c unlimited - rootfs_path=$DATA_DIR/rootfs - rootfs_tgz=/var/vcap/stemcell_base.tar.gz - - # Extract rootfs if needed - if [ ! -d $rootfs_path ] - then - # Make sure its parent directory exists - mkdir -p $(dirname $rootfs_path) - - # Extract to temporary path, then rename to target path. - # This makes sure that it is not possible that we end up with directory - # that contains a partially extracted archive. - tmp_path=$(mktemp --tmpdir=$(dirname $rootfs_path) -d) - chmod 755 $tmp_path - tar -C $tmp_path -zxf $rootfs_tgz - mv $tmp_path $rootfs_path - fi これはたぶん、本家の消し忘れ。
  • 14. 1VM なのでnfsの利用を削除 Page 14 © NEC Corporation 2010 1VM Cloud Foundry の構築 Cloud Foundry のリリース作成 --- a/jobs/serialization_data_server/templates/serialization_data_server_ctl +++ b/jobs/serialization_data_server/templates/serialization_data_server_ctl @@ -36,7 +36,9 @@ case $1 in <% end %> mkdir -p $SNAPSHOT_DIR + <% unless properties.micro %> check_mount "$MT_OPTS" "$MT_EXPORT" "$SNAPSHOT_DIR" + <% end %> mkdir -p $SDS_TMP_UPLOAD_DIR chownvcap:vcap $SDS_TMP_UPLOAD_DIR
  • 15. Page 15 © NEC Corporation 2013 ▌ ここでNise-BOSH にリクエスト  最新のリリースを試したいだけな場合にわざわざ bosh create release し たくない! • bosh sync blobs だけで大丈夫なんじゃ?  Job Template と Package の取得方法がちょっとごっちゃになってる。 • Job Template はリリースレポジトリのソース(jobs ディレクトリ)そのまま使う のに、 • Package はなんで .dev_builds / .final_buildsを使うのか?  リリースファイルを指定したら .dev_builds / .final_buildsの jobs と package を使う、  リリースレポジトリを指定したら、レポジトリ下のソースを利用するよ うにして欲しい(したい)。 1VM Cloud Foundry の構築 Cloud Foundry のリリース作成 $ ./update $ gem install –no-ri –no-rdocbosh_cli $ bosh create release --force
  • 16. Page 16 © NEC Corporation 2013 ▌ 最低構成の Job Template をインストール。  問題は、deployment manifest (micro_ng.yml) の内容…。  cloudfoundry/micro を参考に • https://github.com/cloudfoundry/micro/blob/master/deploy/manifest-ng.yml  実際に使った deployment manifest • https://gist.github.com/yuanying/2b41f8bd3819de0bd520 1VM Cloud Foundry の構築 Cloud Foundry のインストール $ bundle exec ./bin/nise-bosh ../cf-release ../micro_ng.yml -n 127.0.0.1 postgres $ bundle exec ./bin/nise-bosh ../cf-release ../micro_ng.yml -n 127.0.0.1 nats $ bundle exec ./bin/nise-bosh ../cf-release ../micro_ng.yml -n 127.0.0.1 gorouter $ bundle exec ./bin/nise-bosh ../cf-release ../micro_ng.yml -n 127.0.0.1 dea_next $ bundle exec ./bin/nise-bosh ../cf-release ../micro_ng.yml -n 127.0.0.1 health_manager_next $ bundle exec ./bin/nise-bosh ../cf-release ../micro_ng.yml -n 127.0.0.1 cloud_controller_ng $ bundle exec ./bin/nise-bosh ../cf-release ../micro_ng.yml -n 127.0.0.1 serialization_data_server $ bundle exec ./bin/nise-bosh ../cf-release ../micro_ng.yml -n 127.0.0.1 uaa $ bundle exec ./bin/nise-bosh ../cf-release ../micro_ng.yml -n 127.0.0.1 vcap_redis
  • 17. Page 17 © NEC Corporation 2013 ▌ properties.microを true に ▌ ドメインにxip.ioを指定。  IP アドレスベースのワイルドカードDNS。便利。 1VM Cloud Foundry の構築 Cloud Foundry のインストール --- deployment: micro properties: micro: true domain: 192.168.33.10.xip.io cc_props: ccng hm_props: health_manager_ccng
  • 18. Page 18 © NEC Corporation 2013 ▌ ccng.use_nginxを false に ▌ ccngのプロパティはデフォルト値が spec で決まっているものが 多いが、Nise-BOSH がプロパティのデフォルト値に対応していな いため、すべて指定する必要があり大変。。 1VM Cloud Foundry の構築 Cloud Foundry のインストール ccng: &ccng use_nginx: false default_quota_definition: free srv_api_uri: http://api.192.168.33.10.xip.io logging_level: debug bulk_api_password: bulk_api_password staging_upload_user: staging staging_upload_password: staging external_host: api uaa_resource_id: cloud_controller quota_definitions: free: total_services: 10 memory_limit: 1024 non_basic_services_allowed: false … (以下略)
  • 19. Page 19 © NEC Corporation 2013 ▌ uaa.no_sslを true に ▌ cfクライアントを追加 (vmcの代わり)  autoapproveに登録しないとブラウザベースの認証しないと使えない。  cloud_controller.admin scope の追加。 1VM Cloud Foundry の構築 Cloud Foundry のインストール uaa: spring_profiles: postgresql no_ssl: true autoapprove: - cf scim: users: - micro@vcap.me|micro|scim.write,scim.read,openid clients: cf: override: true authorized-grant-types: implicit authorities: uaa.none scope: cloud_controller.read,cloud_controller.write,openid,password.write,cloud_controller.admin,scim.read,scim.write
  • 20. 起動! Page 20 © NEC Corporation 2013 1VM Cloud Foundry の構築 Cloud Foundry のインストール $ mkdir -p /var/vcap/shared $ chownvcap:vcap /var/vcap/shared $ mkdir -p /var/vcap/store $ ./bin/run-job start postgres $ ./bin/run-job start nats $ ./bin/run-job start gorouter $ ./bin/run-job start dea_next $ ./bin/run-job start health_manager_next $ ./bin/run-job start cloud_controller_ng $ ./bin/run-job start serialization_data_server $ ./bin/run-job start uaa $ ./bin/run-job start vcap_redis
  • 21. Page 21 © NEC Corporation 2012