第二篇 :部署BOSH
micro bosh部署完毕后,要利用micro bosh部署bosh,先从bosh-cli target到micro bosh上
ubuntu@bosh-cli:~/deployments$ bosh target 10.23.51.26:25555
Target already set to `microbosh-openstack'
ubuntu@bosh-cli:~/deployments$ bosh login
Your username: admin
Enter password: *****
Logged in as `admin'
默认用户密码为admin admin
ubuntu@bosh-cli:~/deployments$ bosh deployments
发现还没有部署任何项目。那么,下面就着手一步步部署bosh,本文只专注部署过程以及碰到的问题,bosh模块简介等不涉及。
BOSH stemcell
部署micro bosh 用的是mirco bosh stemcell,而部署bosh则用 bosh stemcell,两个stemcell的区别在上一篇中已经提到。
bosh public stemcells --all
选择openstack 最新版本
bosh download public stemcell bosh-stemcell-openstack-kvm-0.7.0.tgz
上传bosh stemcell
bosh upload stemcell bosh-stemcell-openstack-kvm-0.7.0.tgz
bosh-release编译包
先从github或自己的代码库中取最新版本,这里是用github上的代码。
git clone https://github.com/cloudfoundry/bosh.git
git submodule update --init –recursive
bosh create release –with-tarball --force
不出情况的话,会生成release包。这一步得看网速和网络环境了,rubygem你懂的。有快有慢,如果有提示哪个模块没有,其实可以进入文件夹,手工去git clone。
如中间碰到某些gem搞不下来, 那是rubygem问题了,多多重试。最不济就用goagent,虽然在micro bosh上再搞个goagent有点别扭。
...
...
Release version:11.1-dev
Release manifest:/home/ubuntu/bosh-release/dev_releases/bosh-dev1-11.1-dev.yml
Release tarball (88.8M):/home/ubuntu/bosh-release/dev_releases/bosh-dev1-11.1-dev.tgz
上传bosh-release
bosh upload release ~/bosh-release/dev_releases/bosh-dev-11.1-dev.tgz
编写bosh部署文件bosh.yml
bosh.yml 定义了安装的模块,以及IP、内存等信息
---
name: bosh-openstack #bosh名称,部署完bosh deployments列出来的就是
director_uuid: f6d5ef18-441d-40a4-b895-0a49f72097d4 #bosh status ,把uudi copy过来
release:
name: bosh-dev # bosh releases,查看上传的release,name和version要对应上
version: 11.1-dev
compilation:
workers: 1
network: default
reuse_compilation_vms: true
cloud_properties:
instance_type: jae.bosh # 此处的flavor要自己提前定义
update:
canaries: 1
canary_watch_time: 90000
update_watch_time: 90000
max_in_flight: 1
max_errors: 1
networks:
- name: floating
type: vip
cloud_properties: {}
- name: default
type: dynamic
dns:
- 10.23.54.108 # CHANGE: Micro Bosh IP
cloud_properties:
security_groups:
- default
resource_pools:
- name: small
network: default
size: 8
stemcell:
name: bosh-stemcell