Build a stand-alone environment through Bosh-lite on Centos7 ubuntu15.04 cloudfoundry

Source: Internet
Author: User
Tags openssl vmware fusion

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?
  1. $ git clone git://github.com/sstephenson/rbenv.git $HOME/.rbenv
  2. $ git clone https://github.com/sstephenson/ruby-build.git $HOME/.rbenv/plugins/ruby-build
  3. $ echo ' export path= ' $HOME/.rbenv/bin: $PATH "' >> ~/.bash_profile
  4. $ echo ' eval ' $ (rbenv init-) "' >> ~/.bash_profile
  5. $ source ~/.bash_profile
  6. $ rbenv Install 2.1.3
  7. $ rbenv Global 2.1.3
  8. $ gem Sources--remove https://rubygems.org/
  9. $ gem sources-a https://ruby.taobao.org/
  10. $ gem sources-l
  11. $ gem Install bundle
  12. $ gem Install Nokogiri----use-system-libraries


2.3 Installing vagrant

CentOS Installation Method

[Ruby]View Plaincopyprint?
    1. # wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.2_x86_64.rpm
    2. # RPM-UVH vagrant_1.7.2_x86_64.rpm

Ubuntu Installation Method
sudo apt-get install vagrant-y

  

Verify vagrant [Ruby]View Plaincopyprint?
    1. # vagrant--version
    2. Vagrant 1.6.3


2.4 Installing VirtualBox

CentOS Installation Method

[Ruby]View Plaincopyprint?
    1. # wget http://download.virtualbox.org/virtualbox/4.3.26/VirtualBox-4.3-4.3.26_98988_el7-1.x86_64.rpm
    2. # # requires Linux kernel source code when installing VirtualBox, set KERN_DIR environment variable to indicate kernel source code path
    3. # Export Kern_dir=/usr/src/kernels/3.10.0-229.4.2.el7.x86_64
    4. # 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?
    1. # Vboxmanage--version
    2. 4.3.14r95030


3, deploying CloudFoundry3.1 installation Bosh CLI [Ruby]View Plaincopyprint?
    1. # Gem Install Bosh_cli
3.2 Installing the manifest Merge tool [Ruby]View Plaincopyprint?
    1. # wget Https://github.com/cloudfoundry-incubator/spiff/releases/download/v1.0.3/spiff_linux_amd64.zip
    2. # 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?
    1. # mkdir ~/workspace
    2. # CD ~/workspace
    3. # git clone https://github.com/cloudfoundry/bosh-lite
    4. # git clone https://github.com/cloudfoundry/cf-release
3.4 Starting the VirtualBox virtual machine [Ruby]View Plaincopyprint?
    1. # CD ~/workspace/bosh-lite
    2. # 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?
    1. # 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?
    1. # 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?
    1. Export No_proxy=192.168.50.4,xip.io

3.5.1 Bosh to the current director of Bosh-lite. [Ruby]View Plaincopyprint?
    1. # Bosh Target 192.168.50.4 Lite
Here login username password is user name: admin Password: admin View bosh status [Ruby]View Plaincopyprint?
  1. # Bosh Status
  2. Config
  3. /root/.bosh_config
  4. Director
  5. Name Bosh Lite Director
  6. URL https://192.168.50.4:25555
  7. Version 1.2811.0 (00000000)
  8. User Admin
  9. UUID c6f166bd-ddac-4f7d-9c57-d11c6ad5133b
  10. CPI vsphere
  11. DNS disabled
  12. Compiled_package_cache enabled (provider:local)
  13. Snapshots Enabled
  14. Deployment
  15. Not set


Bosh-lite provides a script that can be deployed in one-click Cloudfoundry [Ruby]View Plaincopyprint?
    1. # CD ~/workspace/bosh-lite
    2. # BIN/PROVISION_CF

Verify that the Cloudfoundry is deployed successfully [Ruby]View Plaincopyprint?
  1. # Bosh VMS
  2. Deployment ' Cf-warden '
  3. Director Task 9
  4. Task 9 Done
  5. +------------------------------------+---------+---------------+--------------+
  6. | Job/index | State | Resource Pool | IPs |
  7. +------------------------------------+---------+---------------+--------------+
  8. | api_z1/0 | Running | LARGE_Z1 | 10.244.0.134 |
  9. | etcd_z1/0 | Running | MEDIUM_Z1 | 10.244.0.42 |
  10. | ha_proxy_z1/0 | Running | ROUTER_Z1 | 10.244.0.34 |
  11. | hm9000_z1/0 | Running | MEDIUM_Z1 | 10.244.0.138 |
  12. | loggregator_trafficcontroller_z1/0 | Running | SMALL_Z1 | 10.244.0.146 |
  13. | loggregator_z1/0 | Running | MEDIUM_Z1 | 10.244.0.142 |
  14. | nats_z1/0 | Running | MEDIUM_Z1 | 10.244.0.6 |
  15. | postgres_z1/0 | Running | MEDIUM_Z1 | 10.244.0.30 |
  16. | router_z1/0 | Running | ROUTER_Z1 | 10.244.0.22 |
  17. | runner_z1/0 | Running | RUNNER_Z1 | 10.244.0.26 |
  18. | uaa_z1/0 | Running | MEDIUM_Z1 | 10.244.0.130 |
  19. +------------------------------------+---------+---------------+--------------+
  20. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.