Bosh is an automated tool provided by Cloudfoundry to install deployment and upgrade Cloudfoundry, but is part of the cloudfoundry. Generally speaking, Bosh is a client/server structure, Bosh client is called Bosh Cli,bosh server driven by Bosh and other components, see HTTP// docs.cloudfoundry.org/bosh/
The complete Bosh is a distributed environment, this article in order to simplify the installation of Bosh, Bosh all the components installed on a virtual machine, Bosh this way of deployment is called Microbosh.
Describes the deployment of the Bosh client in a CentOS environment and the deployment of the Microbosh tool on an OpenStack environment.
3.1 Installing the Ruby environment
3.1.1 Authors use rbenv to manage Ruby, so install rbenv and ruby environments (if RBENV is already installed or use RVM to skip this step)
[Python]View Plaincopy
- # RM-RF $HOME/.rbenv
- # 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
- # source ~/.bash_profile
- # echo ' eval ' $ (rbenv init-) "' >> ~/.bash_profile
- # source ~/.bash_profile
- # rbenv Install 1.9.3-p547
- # rbenv Global 1.9.3-p547
3.1.2 Installing the Bosh client
[Python]View Plaincopy
- # rbenv Rehash
- # Gem Update--system
- # Gem Pristine Rake
- # Gem Install bundler OpenSSL
- # Gem Install Nokogiri----use-system-libraries
- # Gem Install PG----Use-system-libraries
- # Gem Install Bosh_cli
- # Gem Install Bosh_cli_plugin_micro
3.1.3 Create Bosh security group for placement of Microbosh and Cloudfoundry configuration Securitygroup (1), allowing Bosh access
[Python]View Plaincopy
- # Nova Secgroup-create Bosh "security group for Bosh access"
- # Nova Secgroup-add-rule Bosh UDP 53 53 0.0.0.0/0
- # Nova Secgroup-add-rule Bosh TCP 4222 4222 0.0.0.0/0
- # Nova Secgroup-add-rule Bosh UDP 68 68 0.0.0.0/0
- # Nova Secgroup-add-rule Bosh TCP 25555 25555 0.0.0.0/0
- # Nova Secgroup-add-group-rule Bosh bosh TCP 1 65535
- # Nova Secgroup-add-rule Bosh TCP 6868 6868 0.0.0.0/0
- # Nova Secgroup-add-rule Bosh TCP 53 53 0.0.0.0/0
- # Nova Secgroup-add-rule Bosh TCP 25250 25250 0.0.0.0/0
- # Nova Secgroup-add-rule Bosh TCP 25777 25777 0.0.0.0/0
(2) Create security group to allow SSH access
[Python]View Plaincopy
- # Nova Secgroup-create SSH "security group for SSH access"
- # Nova Secgroup-add-rule ssh icmp-1-1 0.0.0.0/0
- # Nova Secgroup-add-rule ssh TCP 22 22 0.0.0.0/0
- # Nova Secgroup-add-rule SSH UDP 68 68 0.0.0.0/0
(3) Create Cloudfoundry intranet security group
[Python]View Plaincopy
- # Nova Secgroup-create cf-private "CF Internal Security group"
- # Nova Secgroup-add-rule cf-private UDP 68 68 0.0.0.0/0
- # Nova Secgroup-add-rule cf-private UDP 3456 3456 0.0.0.0/0
- # Nova Secgroup-add-group-rule cf-private Bosh TCP 1 65535
(4) Create Cloudfoundry extranet access security group
[Python]View Plaincopy
- # Nova Secgroup-create cf-public "security Group for Cloudfoundry public access"
- # Nova Secgroup-add-rule cf-public TCP 443 443 0.0.0.0/0
- # Nova Secgroup-add-rule cf-public UDP 68 68 0.0.0.0/0
- # Nova Secgroup-add-rule cf-public TCP 80 80 0.0.0.0/0
3.2 Deployment of MicroBosh3.2.1 to create Microbosh keypair
[Python]View Plaincopy
- # Nova Keypair-add microbosh > Microbosh.cer
- # chmod Microbosh.cer
3.2.2 Creating a working directory
[Python]View Plaincopy
- # mkdir-p ~/bosh-workspace/deployments/microbosh-openstack
- # CD ~/bosh-workspace/deployments/microbosh-openstack
3.2.3 Creating a floating IP for Microbosh
[Python]View Plaincopy
- # Nova Floating-ip-create Public
- +--------------+-----------+----------+--------+
- | Ip | Server Id | Fixed Ip | Pool |
- +--------------+-----------+----------+--------+
- | 172.24.4.229 | | - | Public |
- +--------------+-----------+----------+--------+
3.2.4 Create and edit the deployment description file Microbosh.yml
[Ruby]View Plaincopy
- ---
- Name:microbosh-openstack
- Logging
- Level:debug
- Network
- Type:dynamic
- vip:172.24.4.229
- Cloud_properties:
- Net_id:bfc9b30b-8b44-4f97-a762-c39b2f774d78
- Resources
- persistent_disk:16384
- Cloud_properties:
- Instance_type:m1.medium
- Cloud
- Plugin:openstack
- Properties
- OpenStack
- auth_url:http://<ip>:5000/v2.0
- Username:demo
- Api_key:73b3b497ca3a42d1
- Tenant:demo
- Default_security_groups: ["ssh", "bosh"]
- Default_key_name:microbosh
- Private_key: $HOME/microbosh.cer
- Apply_spec:
- Properties
- Director
- Max_threads:3
- Hm
- Resurrector_enabled: True
- NTP: # This example uses, the North American NTP servers. Edit for your region.
- -<NTP Server ip>
Here's a brief look at what this deployment file means
* Network describes the properties of the network in OpenStack
In the author's OpenStack environment, the network is OpenStack neutron networks, so the intranet uses DHCP to obtain the IP, so the type is dynamic. The net_id in Cloud_properties is an intranet address that can use DHCP to obtain IP, which can be obtained using neutron net-list
[Python]View Plaincopy
- # neutron Net-list
- +--------------------------------------+---------+--------------------------------------------------+
- | ID | name | Subnets |
- +--------------------------------------+---------+--------------------------------------------------+
- | 0fbe7f27-e732-4954-9134-5486d7617727 | public | 110583d9-a905-428a-a494-3c95e4a6bca6 |
- | bfc9b30b-8b44-4f97-a762-c39b2f774d78 | private | 052030e6-626a-4a57-b8dc-b8ab239f419d 10.0. 0.0/24 |
- +--------------------------------------+---------+--------------------------------------------------+
In order to be able to access the Microbosh from the extranet, we need to specify a floating IP for Bosh director, Bosh will automatically associate this IP to Bosh director
* Resource describes how much resources are allocated for the Micro Bosh Director, Instance_type defines the OpenStack Flavor,persistent_disk for this virtual machine defines the permanent disks that are attached to this virtual machine
* Cloud describes how to access OpenStack, where most of the content can be found in the Keystonerc_demo generated by the installation,
[Python]View Plaincopy
- # Cat $HOME/keystonerc_demo
- Export Os_username=demo
- Export Os_tenant_name=demo
- Export os_password=73b3b497ca3a42d1
- Export os_auth_url=http://<ip>:35357/v2. 0/
- Export ps1=' [\[email protected]\h \w (keystone_demo)]\$ '
* Apply_spec defines the properties of the Micro Bosh, which we only need to modify one, that is, the time server address <NTP server IP>, for example, modified to time.asia.apple.com
3.2.5 Download Microbosh virtual machine template (Stemcell) (1) For GFW's sake, add the following sentence to the/etc/hosts
54.231.244.8 s3.amazonaws.com
(2) Create Stemcell directory
[Python]View Plaincopy
- # mkdir-p ~/bosh-workspace/stemcells
- # CD ~/bosh-workspace/stemcells
(3) Download the Stemcell of micro Bosh
[Python]View Plaincopy
- # Bosh Public StemCells | Grep-i OpenStack
- | bosh-stemcell-2427-openstack-kvm-ubuntu.tgz |
- | bosh-stemcell-2624-openstack-kvm-centos.tgz |
- | bosh-stemcell-2624-openstack-kvm-ubuntu-lucid.tgz |
- | bosh-stemcell-2749-openstack-kvm-centos-go_agent.tgz |
- | bosh-stemcell-2749-openstack-kvm-ubuntu-trusty-go_agent.tgz |
- | bosh-stemcell-2652-openstack-kvm-ubuntu-lucid-go_agent.tgz |
- | bosh-stemcell-2719.1-openstack-kvm-centos-go_agent.tgz |
- | bosh-stemcell-2719.1-openstack-kvm-ubuntu-trusty-go_agent.tgz |
- | bosh-stemcell-2719.2-openstack-kvm-centos-go_agent.tgz |
- | bosh-stemcell-2719.2-openstack-kvm-ubuntu-trusty-go_agent.tgz |
- | bosh-stemcell-2719.3-openstack-kvm-ubuntu-trusty-go_agent.tgz |
[Python]View Plaincopy
- # Bosh download Public Stemcell bosh-stemcell-2652-openstack-kvm-ubuntu-lucid-go_agent.tgz
Although this Stemcell is not the latest version, but I verify through, the updated version of the Stemcell I did not try to
(4) Deploying Micro Bosh
* Set Deployment Profile
[Python]View Plaincopy
- # CD ~/bosh-workspace/deployments
- # Bosh Micro Deployment Microbosh-openstack
* Deploy Micro Bosh
[Python]View Plaincopy
- # Bosh Micro Deploy ~/BOSH-WORKSPACE/STEMCELLS/BOSH-STEMCELL-2652-OPENSTACK-KVM-UBUNTU-LUCID-GO_AGENT.TGZ
(5) Verifying micro Bosh
[Python]View Plaincopy
- # bosh target <microbosh IP address>
Where the Microbosh IP address is a pre-applied floating IP
(6) using SSH to access micro Bosh
[Python]View Plaincopy
- # ssh-i <path to Microbosh private key> [email Protected]<microbosh ip>
Open Source PAAs Scenario: Deploy Cloudfoundry (iii) deployment on OpenStack Bosh