Cloudfoundry on Openstack 使用 BOSH 完整部署(2)
bosh target http://1.2.3.4 (micro-bosh ip)
Target set to `microbosh-openstack (http://1.2.3.4:25555) Ver: 0.6 (release:ce0274ec bosh:0d9ac4d4)'
Your username: admin
Enter password: *****
Logged in as `admin'
target 到 micro-bosh
查看对应openstack最新的 stemcells
bosh public stemcells --all
下载 stemcells (比较漫长,看到国外网络状况)
bosh download public stemcell bosh-stemcell-openstack-0.6.7.tgz
上传到本地
bosh upload stemcell bosh-stemcell-openstack-0.6.7.tgz
建立部署目录,下载bosh源码
mkdir /root/.bosh_deployments
git clone git://github.com/cloudfoundry/bosh.git
检查更新,下载所有依赖包,并把整个BOSH打包成一个tar包 这步时间更长,需要耐心,首先会从一个 Blob 服务器下载二进制文件。然后它会构建包并生成清单文件
cd bosh/release
git submodule update --init
bosh create release --with-tarball --force
将创建好的Release tar包上传到Micro BOSH的director
bosh upload release dev_releases/bosh-x-y-dev.tgz
确认 releases & stemcell 无误
bosh releases
bosh deployments
部署清单可参照: https://github.com/leftleghu/cloudfoundry/blob/master/bosh-release.yml
bosh deployment bosh-release.yml
bosh deploy
部署完成后,一共8个VM
bosh vms
+----------------------+---------+---------------+-----------------------------+
| Job/index | State | Resource Pool | IPs |
+----------------------+---------+---------------+-----------------------------+
| blobstore/0 | running | small | 172.16.13.31 |
| director/0 | running | small | 172.16.13.28, 172.16.13.195 |
| health_monitor/0 | running | small | 172.16.13.30 |
| nats/0 | running | small | 172.16.13.16 |
| openstack_registry/0 | running | small | 172.16.13.29 |
| postgres/0 | running | small | 172.16.13.26 |
| powerdns/0 | running | small | 172.16.13.27, 172.16.13.194 |
| redis/0 | running | small | 172.16.13.15 |
+----------------------+---------+---------------+-----------------------------+
同样,如果部署中途遇到失败,不要手工删除vm,需要使用如下命令重来:
bosh -n delete deployment <name> --force
部署注意DNS设置,如果有问题,DNS设置成 micro-bosh ip
blog comments powered by Disqus