1. 安装bosh-lite
bosh-lite
1.1 安装bosh命令行
1.1.1 安装ruby
rvm管理工具
1
| $ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
|
1
| $ \curl -sSL https://get.rvm.io | bash -s stable
|
1 2
| $ rvm install 2.3.0 $ rvm use 2.3.0 default
|
1.1.2 安装bosh_cli命令工具
1
| $ gem install bosh_cli --no-ri --no-rdoc
|
1.2 安装vagrant
vagrant
1 2
| $ vagrant --version Vagrant 1.7.4
|
1.3 安装VBox
VBox
1 2
| $ VBoxManage --version 5.0.16r...
|
1.4 下载bosh-lite代码
1 2
| $ cd ~/workspace $ git clone https://github.com/cloudfoundry/bosh-lite
|
1.5 启动vagrant
- 修改Vagrantfile,增加一行,为了规避vagant的bug
1
| config.ssh.insert_key = false
|
1
| $ vagrant up --provider=virtualbox
|
- 添加指向vagrant的路由
- ==重启机器需要重新执行这一步==
2. 使用bosh-lite部署cloudfoundry
1 2
| $ cd cf-release $ ./scripts/generate-bosh-lite-dev-manifest
|
1
| $ bosh upload stemcell ~/cloudfoundry/bosh/bosh-warden-boshlite-ubuntu-trusty-go_agent.tgz
|
1
| $ bosh upload release ~/cloudfoundry/bosh/cf-release.tgz
|
1 2 3 4
| $ cd cf-release $ bosh create release $ bosh upload release $ bosh deploy
|
1
| $ bosh delete deployment cf-warden
|
1
| $ cf login -a https://api.bosh-lite.com --skip-ssl-validation -u admin -p admin
|
1
| $ cf create-org realtech
|
3. 使用bosh-lite部署mysql
1 2
| $ cd cf-mysql-release $ ./scripts/generate-bosh-lite-manifest
|
1
| $ bosh upload release ~/cloudfoundry/bosh/cf-mysql-release.tgz
|
1
| bosh run errand broker-registrar
|
1
| $ cf create-service-broker p-mysql admin password https://p-mysql.bosh-lite.com:443
|
https://github.com/cloudfoundry-samples/spring-music
4. 使用bosh-lite部署redis
1 2
| $ cd cf-redis-release $ ./scripts/generate-deployment-manifest warden templates/sample_stubs/infrastructure-warden.yml - cf-redis-lite.yml
|
1 2
| $ bosh upload release ~/cloudfoundry/bosh/cf-routing-release-0.137.0.tgz $ bosh upload release ~/cloudfoundry/bosh/cf-redis-release-426.0.0.tgz
|
1
| aria2c --split=10 -c -j 10 http://bosh.io/d/github.com/pivotal-cf/cf-redis-release
|
1
| $ cf create-service-broker redis admin admin https://redis-broker.bosh-lite.com:443
|