Use bosh-lite to build a standalone cloudfoundry environment on centos7ubuntu15.04

Source: Internet
Author: User
Tags vmware fusion

Use bosh-lite to build a standalone cloudfoundry environment on centos7ubuntu15.04
Bosh-lite Introduction
Bosh-lite is an experimental tool for deploying cloudfoundry on a single machine. It is used by developers for poc verification. Bosh-lite currently only supports mac OS X and Linux systems. Bosh-lite uses Vagrant to manage virtual machines, so currently only VirtualBox and VMWare Fusion (mac OS X) Virtual Machine platforms are supported. As shown in, the Bosh client CLI runs on the host OS. Through the Bosh CLI, we can deploy each component of Bosh and Cloud Foundry on the VirtualBox virtual machine, each Component of Bosh and CloudFoundry, such as UAA and Router, runs in the Warden Container.
2. Prepare the environment for the use of Cent OS 7.0 and ubuntu 15.04 as the host operating system, and vmware as the virtual platform. Both centos7 and ubuntu15.04 are virtual machines installed in vmware. The Inetl VT-X in vmware must be turned on because the vagrant box is 64-bit and a 64-bit image cannot run if the VT-X is not turned on as the virtualbox of provide. Setting methods vmware selects a virtual machine, then in the menu select the Virtual Machine menu, in Virtual Machine Settings select processor settings, open VT-X options on the right
2.1 install the software packageCentos 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-devel libxml2-devel libvpx libpng libXt libXmu libxslt-devel openssl-devel libXcursor libXinerama qt-devel wget gcc unntpdate -toolsUbuntu 15.04 preparation

sudo apt-get install build-essential libxml2-dev libsqlite3-dev libxslt1-dev libpq-dev libmysqlclient-dev
2.2 install Ruby environment I use rbenv to install and manage ruby
$ Git clone git: // github.com/sstephen enson/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 the https://rubygems.org/
$ Gem sources-a https://ruby.taobao.org/
$ Gem sources-l
$ Gem install bundle $ gem install nokogiri -- use-system-libraries

2.3 install Vagrant

Centos Installation Method

# 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
1 sudo apt-get install vagrant -y

  

Verify vagrant
# Vagrant -- versionVagrant 1.6.3

2.4 install VirtualBox

Centos Installation Method

# Wget http://download.virtualbox.org/virtualbox/4.3.26/VirtualBox-4.3-4.3.26_98988_el7-1.x86_64.rpm# # Install virtualbox linux kernel source code, set the KERN_DIR environment variable to indicate the 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 virtualbox is successfully installed
# VBoxManage -- version4.3.14r95030

3, deploy CloudFoundry3.1 install Bosh CLI # gem install bosh_cli # 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 libraries must be placed under the same level of directory
# Mkdir ~ /Workspace # cd ~ /Workspace
# Git clone https://github.com/cloudfoundry/bosh-lite# git clone https://github.com/cloudfoundry/cf-release3.4 start VirtualBox virtual machine # cd ~ /Workspace/bosh-lite # vagrant up -- provider = virtualbox may encounter the following error here. There are two reasons for this error: one is that the VT-X is not open, which is the biggest possible. Another possibility is that the resources of vmware virtual machines are insufficient. Modify the memory and CPU resources of a vmware Virtual Machine. (The 9G memory 4 CPU used by the author is allocated to centos7 or ubuntu 15.04). The vagrant resources can be adjusted in bosh-lite/template/vagrant-local-tpl.

If the preceding error occurs in the console, you must delete the previous vagrant Virtual Machine and restart it. After vagrant haltvagrant destroyvagrant up is successfully started, run the following command to view the status of the virtual machine.
# Vagrant global-status

After the vagrant box virtual machine is started, two NICs are configured. One is used to connect to the CloudFoundry network and 10.244.0.0/19 is used. The other is used to communicate with the host machine, the IP address 192.168.50.4 is used. Therefore, you must add a route to access the CloudFoundry network on the host machine centos7 or ubuntu150.4. One of the two ip addresses is configured in the bosh-lite/template/vagrant-local.tpl. Bosh-lite also has the addrout. sh addroute. bat command. # Route add-net 10.244.0.0/19 gw 192.168.50.4

If an HTTP or HTTPS proxy is configured, run the following command First: export no_proxy = 192.168.50.4, xip. io
3.5.1 direct bosh to the current bosh-lite ctor # bosh target 192.168.50.4 lite here the login username and password are Username: admin Password: admin view bosh status # bosh statusConfig
/Root/. bosh_config

DirectorName Bosh Lite Director
URL https: // 192.168.50.4: 25555 Version 1.2811.0 (00000000)
User adminUUID c6f166bd-ddac-4f7d-9c57-d11c6ad5133b
CPI vspheredns disabled
Compiled_package_cache enabled (provider: local) snapshots enabled
Deployment
Not set

Bosh-lite provides a script for one-click deployment of CloudFoundry # cd ~ /Workspace/bosh-lite # bin/provision_cf
Check whether CloudFoundry is successfully deployed.
# Bosh vmsDeployment '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 | + ------------------------------------ + --------- + ------------- + ---------------- +

Related Article

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.