In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to use BOSH lite to install Cloud Foundry2.x in a single VM under windows, I believe most people do not know much about it, so share this article for your reference. I hope you will learn a lot after reading this article. Let's learn about it together.
Environmental requirements: more than 8 GB of memory; can be connected to internet. I believe that this configuration may be realized by many friends.
Terminology:
-virtualbox: virtualized system that supports win, linux and MacOS.
-vagrant: a Ruby-based tool for creating and deploying virtualized development environments. It uses Oracle's open source VirtualBox virtualization system and Chef to create automated virtual environments. It uses template + configuration to build a vbox virtual machine.
-bosh: large-scale deployment tools, divided into server and client
-boshlite: a set bosh server. In the vagrant virtual machine
-A container type virtual machine in warden:linux. The method in this article uses warden to isolate the components of CF in the same linux.
-git: version tool
-stemcell: the VM template with BOSH Agent embedded. BOSH Lite uses Warden CPI, so Warden Stemcell is required.
The official document of the Cloud Foundry organization is to use a linux host as the bosh client, set up a bosh server virtual machine on it, and then deploy CF to the bosh server virtual machine. After deployment, boshlite (as bosh server) is a virtual machine in which the components of CF are established in warden.
The principle of the official way:
-create a virtualBox virtual machine with vagrant, including bosh server
-through bosh client, connect bosh server, upload CF code, etc., to bosh server virtual machine
-deploy warden-isolated CF components in the bosh server virtual machine through these codes and configurations
My usual work computer is windows. I originally wanted to deploy the operation directly under windows. In the process, I came to the following conclusions:
-the steps of using vagrant to create the basic CF virtual of virtualbox, which has been tested to be no problem under windows
-there are some problems in the process of bosh client deployment, which cannot be carried out in the following steps. Mainly due to the execution of ruby scripts (originally written as linux)
-there are a large number of steps that need to be downloaded online during the deployment process, which can be easily interrupted due to network problems. This section is not very helpful in understanding the architecture of CF, but it takes a lot of time.
Change your thinking:
-create a virtual machine for bosh server with vagrant under windows, deploy bosh client to this virtual machine, and use this bosh client to perform the next steps
-other operations are similar to official documentation
-the parts that can be installed offline are downloaded in advance to speed up deployment.
Experimental environment: windows7 64bit memory above 8G memory
It must be 64bit and 32bit without testing, I don't know. It is said that it is installed in windows, but it only uses virtualbox and vagrant under windows. The end result is a virtual machine with CF on windows. VirtualBox supports win, linux, and MacOS, so most of the following steps should be feasible on other OS.
1. Operate under windows instruction
-install virtualbox
Virtualbox [https://www.virtualbox.org/wiki/Downloads]
Just install it, there is no need to build a virtual machine by hand. Let's not talk about this. If you want to understand, there are a lot of information on the Internet.
-install vagrant
Vagrant [http://www.vagrantup.com/downloads.html]
Graphical installation, there is nothing to say.
-configure Vagrantfile to start the bosh lite (server) virtual machine
C:\ > cd d:\
D:\ > mkdir vagrant
D:\ > cd vagrant
This file is in the source code of boshlite. I have taken it out and modified it. Create this file under d:\ vagrant.
# VM_MEMORY = ENV.fetch ("VM_MEMORY", 4x1024). To_iVM_CORES = ENV.fetch ("VM_CORES", 4). To_iBOX_VERSION = 217Vagrant.configure ('2') do | config | config.vm.hostname='bosh-lite' config.vm.box = "boshlite-ubuntu1204-build# {BOX_VERSION}" config.vm.network: private_network, ip: '192.168.50.4' config.vm.provider: virtualbox do | v Override | # override.vm.box_url = "http://bosh-lite-build-artifacts.s3.amazonaws.com/bosh-lite/#{BOX_VERSION}/boshlite-virtualbox-ubuntu1204.box" override.vm.box_url =" file:///c:/temp/boshlite-virtualbox-ubuntu1204.box" v.customize ["modifyvm",: id, "--memory", VM_MEMORY] v.customize ["modifyvm",: id, "--cpus" VM_CORES] endend###
The virtual machine template of vagrant is best downloaded in advance (boshlite-virtualbox-ubuntu1204.box). If you do not download, vagrant up will be installed from the Internet, which is very slow. Download address: http://bosh-lite-build-artifacts.s3.amazonaws.com/bosh-lite/#{BOX_VERSION}/boshlite-virtualbox-ubuntu1204.box
I use version 217, so it's http://bosh-lite-build-artifacts.s3.amazonaws.com/bosh-lite/217/boshlite-virtualbox-ubuntu1204.box. If you want to use the latest version, check the version number from the source file of boshlite. Lazy people can download version 217 here.
The above Vagrantfile file assumes that the download file is placed in c:\ temp\ boshlite-virtualbox-ubuntu1204.box
D:\ > vagrant up
It doesn't matter if you report an error in the end, it can run normally later.
If you need to operate vagrant:
Vagrant halt (stop the virtual machine, note that all the Vagrantfile files are executed in the directory)
Vagrant destroy (delete the virtual machine, note that all the Vagrantfile files are executed in the directory. Delete default by default, there will be a prompt)
Vagrant up (start the virtual machine)
-add a route to access the CF component from windows to route through this bosh server (because the CF component is in this bosh server). Execute the next sentence in windows:
Route add 10.244.0.0/19 192.168.50.4
2. Operate in the linux created by vagrant
There are many package already installed in this boshlite's virtual machine, such as ruby and git, so using it for bosh client can reduce a lot of steps.
-ssh login, 127.0.0.1 ssh 2222 (or 192.168.50.4), user name / password is vagrant/vagrant. Instead of the ssh tool, go to SecureCRT or Putty yourself.
-change the source.list of apt to domestic origin (it will be much faster after the change)
Modify the source address:
$sudo cp / etc/apt/sources.list / etc/apt/sources.list.bak
$sudo vi / etc/apt/sources.list
:% s/us.arch/cn.arch/g
: wq
$sudo apt-get update
There are about 90 get tasks.
-install bundler
$sudo env PATH=$PATH gem install bundler
-download bosh-lite
$cd
$mkdir workspace
$cd workspace
Method 1: (speed is OK, recommended)
$git clone https://github.com/cloudfoundry/bosh-lite
Method 2: (use what I downloaded: download bosh-lite.tar here)
$tar xvf / vagrant/bosh-lite.tar
Note: the / vagrant directory in linux is actually the d:\ vagrant directory under windows, which is a share that vagrant established when starting the virtual machine. By putting the downloaded files you need under d:\ vagrant, you can save the steps and space from sftp to linux. Wherever / vagrant/xxx is used below, it is assumed that xxx has been placed in the d:\ vagrant directory. In addition, it must be started with vagrant up to have this sharing. Reboot is not allowed in linux, so pay attention to it.
And then
$cd bosh-lite
$bundle
There may be some warning to ignore. Depending on the network, it may take some time
Restart the virtual machine and bosh will be put in the path (use vagrant halt in windows, and then vagrant up). The reason is that it is not clear yet, but it will not take long to restart it.
-upload stemcell with bosh
$bosh target 192.168.50.4
Admin/admin
I have downloaded the following latest-bosh-stemcell-warden.tgz file, download it here. (or available from http://bosh-jenkins-gems-warden.s3.amazonaws.com/stemcells/latest-bosh-stemcell-warden.tgz, new, but not guaranteed to be used smoothly)
$bosh upload stemcell / vagrant/latest-bosh-stemcell-warden.tgz
-install spiff
$sudo apt-get install golang
$cd ~
$export GOPATH=~/go
$export PATH=$PATH:$GOPATH/bin
Method 1: (slow)
$go get github.com/vito/spiff
If there is a break in the middle, and then run and report an error, rm-r ~ / go/src, run again
Method 2: (I have downloaded the file: download go.tar)
$tar xvf / vagrant/go.tar
-deploy cloud foundry
$cd ~
$cd workspace
Mode 1: (very slow, may be interrupted)
$git clone https://github.com/cloudfoundry/cf-release
$cd cf-release
$. / update
$git checkout v169
$bosh create release releases/cf-169.yml # with cf-169.tgz, you don't need this sentence
$bosh upload release releases/cf-169.tgz
Method 2: (I have done the following files: download cf-release.tar, download cf-169.tgz)
$cd ~ / workspace
$tar xvf / vagrant/cf-release.tar
$bosh upload release / vagrant/cf-169.tgz
And then
$cd ~ / workspace/bosh-lite
$. / scripts/make_manifest_spiff
$bosh deploy
Deployment takes a long time, if the virtual machine is on the SSD hard disk, if the CPU is relatively strong, the speed will be faster.
-verify:
$bosh vms
....
+-+
| | Job/index | State | Resource Pool | IPs | |
+-+
| | api_z1/0 | running | large_z1 | 10.244.0.138 | |
| | etcd_leader_z1/0 | running | medium_z1 | 10.244.0.38 |
| | ha_proxy_z1/0 | running | router_z1 | 10.244.0.34 |
| | hm9000_z1/0 | running | medium_z1 | 10.244.0.142 | |
| | loggregator_trafficcontroller_z1/0 | running | small_z1 | 10.244.0.10 | |
| | loggregator_z1/0 | running | medium_z1 | 10.244.0.14 |
| | login_z1/0 | running | medium_z1 | 10.244.0.134 | |
| | 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 | |
+-+
If the above content is displayed, congratulations, the installation is successful!
If there is a problem, you can restart the system first:
$sudo reboot
Use bosh vms to check the components after VM is restarted. Each virtual machine may start slowly, and you can constantly use bosh vms to check the status. If an http500 error occurs, enter the following instructions:
Sudo sv restart director
After many experiments, if successful, a Cloud Foundry environment under a single VM can be completed in 2 hours. If you are interested, you can separate bosh server and CF, as well as the components of CF, so that you can deploy distributed and better understand the Cloud Foundry deployment process.
The above is all the contents of the article "how to install Cloud Foundry2.x in a single VM in BOSH lite under windows". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.