Cloud Foundry

Cloud Foundry

於 OpenStack 上,藉由 BOSH 部署 Cloud Foundry

若是環境上,已經部署過過 Cloud Foundry,請參考 附錄A,安全移除環境

參考:Walker Notes
 


 

0. Prerequisites

1. 準備一組健全的 OpenStack (本教學以 Mirantis OpenStack 為範例,詳見 Mirantis OpenStack 安裝教學)
 
2. 在上面準備一台 VM,作業系統為 Ubuntu 14.04,作為 Bosh VM
 

1. 準備 Bosh VM

Step 1. 安裝相依套件

apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev ruby-dev libxslt1-dev libpq-dev libmysqlclient-dev zlibc zlib1g-dev openssl libxslt-dev libssl-dev libreadline6 libreadline6-dev libsqlite3-dev

 
Step 2. 安裝 Ruby 環境
git clone https://github.com/sstephenson/rbenv.git $HOME/.rbenv  
git clone https://github.com/sstephenson/ruby-build.git $HOME/.rbenv/plugins/ruby-build
git clone https://github.com/sstephenson/rbenv-gem-rehash.git $HOME/.rbenv/plugins/rbenv-gem-rehash
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL

echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
rbenv install 2.2.3
rbenv global 2.2.3
ruby -v
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
gem install bundler

 
Step 3. Install bosh-init
wget https://s3.amazonaws.com/bosh-init-artifacts/bosh-init-0.0.77-linux-amd64
chmod +x bosh-init-0.0.76-linux-amd64
mv bosh-init-0.076-linux-amd64 /usr/local/bin/bosh-init

bosh-init -v

 
Step 4. install bosh-cli
gem install bosh_cli bosh_cli_plugin_micro --no-ri --no-rdoc

 
Step 5. 測試是否能夠存取 OpenStack
vim ~/.fog
:openstack:
  :openstack_auth_url: http://10.5.50.3:5000/v2.0/tokens
  :openstack_api_key: devops
  :openstack_username: devops
  :openstack_tenant: devops
fog openstack

Compute[:openstack].servers

 

2. Initializing BOSH environment on OpenStack

詳見:Initializing BOSH environment on OpenStack
 


 
Step 1. 建立 bosh director

mkdir ~/my-bosh
cd ~/my-bosh
vim ~/my-bosh

 
Step 2.
 
Step 3.
 
Step 4.
 
Step 5.

 

 
 
 
 
 
 
 
 

附錄A.

 
Note: 若從 OpenStack Horizon 上,直接移除 Cloud Foundry,可能造成系統誤判
 

Step 1. 連線至 Bosh VM

ssh -i "<PRIVATE_KEY>" ubuntu@<BOSH_VM_IP>

 
Step 2. 查看有哪些 VM 是經由 Bosh VM 所部署來的
bosh vms

 
Step 3. 移除 Cloud Foundry 環境,但不包含 Bosh VM
bosh delete deployment <DEPLOYMENT_NAME>

 
 
 
 
 
 

待整理

 
Note: 裝 SQL backend service 的時候要知會一下 Tom,他要在 manifest 加一些東西
 

http://140.92.25.194/u/jinseng

foswiki
cloudstorage/cloudfoundry20install

bosh.io

bosh stemsell

manifest.yml

https://github.com/cloudfoundry-incubator/diego-release
—-

1. install ruby
2. install bosh-cli bosh-init
3. install micro-bosh

fog 各種IaaS的抽象介面
為cpi 其中之一組件

—-

micro-bosh = director
是一台部署的機器

yml 的格式可以去bosh官方文件看

stemcell = image檔的概念

disk_pool: 外掛硬碟

—-

bosh targets

bosh upload release ./releases/cf-217.yml

bosh releases

bosh upload stemcell ./upload

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License