Bosh-lite Introduction Bosh-lite is a single-machine deployment Cloudfoundry Experimental tool for developers to do POC verification. Bosh-lite currently supports only Mac OS X and Linux systems. Bosh-lite uses vagrant to manage virtual machines, so only VirtualBox and VMware Fusion (MAC OS X) virtual machine platforms are currently supported. As shown, the Bosh client CLI runs on the host OS, and with the Bosh CLI, we can deploy the component of Bosh and cloud foundry on VirtualBox virtual machines. The various component of Bosh and Cloudfoundry, such as Uaa,router, are all run in Warden containers (Warden Container). 2, the environment prepares the author to use the Thing cent OS 7.0 with Ubuntu 15.04 as the host's operating system, VMware as a virtual platform. Both Centos7 and ubuntu15.04 are virtual machines that are installed in VMware. The Inetl vt-x in VMware must be turned on because the Vagrant box is 64-bit, and if you do not open vt-x as provide, you cannot run 64-bit mirroring. Setup method VMware Select the virtual machine, then select the Virtual Machine menu in the menu, choose Processor Settings in the virtual machine settings, open the VT-X option 2.1 on the right to install the package
CentOS Preparation Content
# RPM-UVH http://mirror.pnl.gov/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
# yum install-y vim git screen kernel* libX11 qt SDL sdl-devel libxml2-devel libvpx libpng libxt libxmu libxslt libxslt-d Evel OpenSSL openssl-devel libxcursor libxinerama qt qt-devel wget gcc unzip ntpdate net-tools
Ubuntu 15.04 Preparing content
sudo apt-get install build-essential libxml2-dev libsqlite3-dev libxslt1-dev libpq-dev Libmysqlclient-dev
2.2 Installing Ruby environments The author uses rbenv to install and manage Ruby
[Ruby]View Plaincopyprint?
- $ git clone git://github.com/sstephenson/rbenv.git $HOME/.rbenv
- $ git clone https://github.com/sstephenson/ruby-build.git $HOME/.rbenv/plugins/ruby-build
- $ echo ' export path= ' $HOME/.rbenv/bin: $PATH "' >> ~/.bash_profile
- $ echo ' eval ' $ (rbenv init-) "' >> ~/.bash_profile
- $ source ~/.bash_profile
- $ rbenv Install 2.1.3
- $ rbenv Global 2.1.3
- $ gem Sources--remove https://rubygems.org/
- $ gem sources-a https://ruby.taobao.org/
- $ gem sources-l
- $ gem Install bundle
- $ gem Install Nokogiri----use-system-libraries
2.3 Installing vagrant
CentOS Installation Method
[Ruby]View Plaincopyprint?
- # wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.2_x86_64.rpm
- # RPM-UVH vagrant_1.7.2_x86_64.rpm
Ubuntu Installation Method
sudo apt-get install vagrant-y
Verify vagrant
[Ruby]View Plaincopyprint?
- # vagrant--version
- Vagrant 1.6.3
2.4 Installing VirtualBox
CentOS Installation Method
[Ruby]View Plaincopyprint?
- # wget http://download.virtualbox.org/virtualbox/4.3.26/VirtualBox-4.3-4.3.26_98988_el7-1.x86_64.rpm
- # # requires Linux kernel source code when installing VirtualBox, set KERN_DIR environment variable to indicate kernel source code path
- # Export Kern_dir=/usr/src/kernels/3.10.0-229.4.2.el7.x86_64
- # RPM-UVH virtualbox-4.3-4.3.26_98988_el7-1.x86_64.rpm
Ubuntu Installation Method
sudo apt-get install virtualbox-y Verify that the VirtualBox is installed successfully
[Ruby]View Plaincopyprint?
- # Vboxmanage--version
- 4.3.14r95030
3, deploying CloudFoundry3.1 installation Bosh CLI
[Ruby]View Plaincopyprint?
- # Gem Install Bosh_cli
3.2 Installing the manifest Merge tool
[Ruby]View Plaincopyprint?
- # wget Https://github.com/cloudfoundry-incubator/spiff/releases/download/v1.0.3/spiff_linux_amd64.zip
- # Unzip spiff_linux_amd64.zip-d/usr/bin
3.3 Checkout Bosh-lite and Cf-releasebosh-lite and cf-release the two code libraries must be placed in the same level directory
[Ruby]View Plaincopyprint?
- # mkdir ~/workspace
- # CD ~/workspace
- # git clone https://github.com/cloudfoundry/bosh-lite
- # git clone https://github.com/cloudfoundry/cf-release
3.4 Starting the VirtualBox virtual machine
[Ruby]View Plaincopyprint?
- # CD ~/workspace/bosh-lite
- # vagrant up--provider=virtualbox
You may encounter the following error here. This error has two reasons, one is vt-x not open, this is the biggest possibility. Another possibility is that there is not enough resources for VMware virtual machines. Modify the memory and CPU resources of the VMware virtual machine. (The author uses 9G memory 4CPU assigned to CENTOS7 or Ubuntu 15.04), this vagrant resource can be adjusted in BOSH-LITE/TEMPLATE/VAGRANT-LOCAL-TPL.
The above error console, the corresponding GUI interface to start the VirtualBox error after encountering the above error, you need to delete the previous vagrant virtual machine, reboot. Vagrant Haltvagrant destroyvagrant Up is successful, you can run the following command to view the status of the virtual machine
[Ruby]View Plaincopyprint?
- # vagrant Global-status
The Vagrant box virtual machine is configured with two NICs, one for connecting the Cloudfoundry network, using 10.244.0.0/19, and one for communicating with the host, using IP 192.168.50.4 so the host Centos7 or ubuntu150.4 need to add a route to access the Cloudfoundry network. The configuration of these two IPs is in BOSH-LITE/TEMPLATE/VAGRANT-LOCAL.TPL. Bosh-lite himself also has addrout.sh addroute.bat this command.
[Ruby]View Plaincopyprint?
- # route add-net 10.244.0.0/19 GW 192.168.50.4
3.5 Deployment Cloudfoundry If you configured an HTTP or HTTPS proxy, run the following command first
[Ruby]View Plaincopyprint?
- Export No_proxy=192.168.50.4,xip.io
3.5.1 Bosh to the current director of Bosh-lite.
[Ruby]View Plaincopyprint?
- # Bosh Target 192.168.50.4 Lite
Here login username password is user name: admin Password: admin View bosh status
[Ruby]View Plaincopyprint?
- # Bosh Status
- Config
- /root/.bosh_config
- Director
- Name Bosh Lite Director
- URL https://192.168.50.4:25555
- Version 1.2811.0 (00000000)
- User Admin
- UUID c6f166bd-ddac-4f7d-9c57-d11c6ad5133b
- CPI vsphere
- DNS disabled
- Compiled_package_cache enabled (provider:local)
- Snapshots Enabled
- Deployment
- Not set
Bosh-lite provides a script that can be deployed in one-click Cloudfoundry
[Ruby]View Plaincopyprint?
- # CD ~/workspace/bosh-lite
- # BIN/PROVISION_CF
Verify that the Cloudfoundry is deployed successfully
[Ruby]View Plaincopyprint?
- # Bosh VMS
- Deployment ' Cf-warden '
- Director Task 9
- Task 9 Done
- +------------------------------------+---------+---------------+--------------+
- | Job/index | State | Resource Pool | IPs |
- +------------------------------------+---------+---------------+--------------+
- | api_z1/0 | Running | LARGE_Z1 | 10.244.0.134 |
- | etcd_z1/0 | Running | MEDIUM_Z1 | 10.244.0.42 |
- | ha_proxy_z1/0 | Running | ROUTER_Z1 | 10.244.0.34 |
- | hm9000_z1/0 | Running | MEDIUM_Z1 | 10.244.0.138 |
- | loggregator_trafficcontroller_z1/0 | Running | SMALL_Z1 | 10.244.0.146 |
- | loggregator_z1/0 | Running | MEDIUM_Z1 | 10.244.0.142 |
- | nats_z1/0 | Running | MEDIUM_Z1 | 10.244.0.6 |
- | postgres_z1/0 | Running | MEDIUM_Z1 | 10.244.0.30 |
- | router_z1/0 | Running | ROUTER_Z1 | 10.244.0.22 |
- | runner_z1/0 | Running | RUNNER_Z1 | 10.244.0.26 |
- | uaa_z1/0 | Running | MEDIUM_Z1 | 10.244.0.130 |
- +------------------------------------+---------+---------------+--------------+
- VMs total:11
Reference http://blog.csdn.net/maingalaxy/article/details/46013393
Build a stand-alone environment through Bosh-lite on Centos7 ubuntu15.04 cloudfoundry