Open Source PAAs Scenario: Deploy Cloudfoundry (iii) deployment on OpenStack Bosh

Source: Internet
Author: User
Tags ssh access

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
  1. # RM-RF $HOME/.rbenv
  2. # git clone git://github.com/sstephenson/rbenv.git $HOME/.rbenv
  3. # git clone https://github.com/sstephenson/ruby-build.git $HOME/.rbenv/plugins/ruby-build
  4. # echo ' Export path= ' $HOME/.rbenv/bin: $PATH "' >> ~/.bash_profile
  5. # source ~/.bash_profile
  6. # echo ' eval ' $ (rbenv init-) "' >> ~/.bash_profile
  7. # source ~/.bash_profile
  8. # rbenv Install 1.9.3-p547
  9. # rbenv Global 1.9.3-p547


3.1.2 Installing the Bosh client [Python]View Plaincopy
    1. # rbenv Rehash
    2. # Gem Update--system
    3. # Gem Pristine Rake
    4. # Gem Install bundler OpenSSL
    5. # Gem Install Nokogiri----use-system-libraries
    6. # Gem Install PG----Use-system-libraries
    7. # Gem Install Bosh_cli
    8. # 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
  1. # Nova Secgroup-create Bosh "security group for Bosh access"
  2. # Nova Secgroup-add-rule Bosh UDP 53 53 0.0.0.0/0
  3. # Nova Secgroup-add-rule Bosh TCP 4222 4222 0.0.0.0/0
  4. # Nova Secgroup-add-rule Bosh UDP 68 68 0.0.0.0/0
  5. # Nova Secgroup-add-rule Bosh TCP 25555 25555 0.0.0.0/0
  6. # Nova Secgroup-add-group-rule Bosh bosh TCP 1 65535
  7. # Nova Secgroup-add-rule Bosh TCP 6868 6868 0.0.0.0/0
  8. # Nova Secgroup-add-rule Bosh TCP 53 53 0.0.0.0/0
  9. # Nova Secgroup-add-rule Bosh TCP 25250 25250 0.0.0.0/0
  10. # Nova Secgroup-add-rule Bosh TCP 25777 25777 0.0.0.0/0




(2) Create security group to allow SSH access [Python]View Plaincopy
    1. # Nova Secgroup-create SSH "security group for SSH access"
    2. # Nova Secgroup-add-rule ssh icmp-1-1 0.0.0.0/0
    3. # Nova Secgroup-add-rule ssh TCP 22 22 0.0.0.0/0
    4. # Nova Secgroup-add-rule SSH UDP 68 68 0.0.0.0/0




(3) Create Cloudfoundry intranet security group [Python]View Plaincopy
    1. # Nova Secgroup-create cf-private "CF Internal Security group"
    2. # Nova Secgroup-add-rule cf-private UDP 68 68 0.0.0.0/0
    3. # Nova Secgroup-add-rule cf-private UDP 3456 3456 0.0.0.0/0
    4. # Nova Secgroup-add-group-rule cf-private Bosh TCP 1 65535



(4) Create Cloudfoundry extranet access security group [Python]View Plaincopy
    1. # Nova Secgroup-create cf-public "security Group for Cloudfoundry public access"
    2. # Nova Secgroup-add-rule cf-public TCP 443 443 0.0.0.0/0
    3. # Nova Secgroup-add-rule cf-public UDP 68 68 0.0.0.0/0
    4. # 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
    1. # Nova Keypair-add microbosh > Microbosh.cer
    2. # chmod Microbosh.cer


3.2.2 Creating a working directory [Python]View Plaincopy
    1. # mkdir-p ~/bosh-workspace/deployments/microbosh-openstack
    2. # CD ~/bosh-workspace/deployments/microbosh-openstack



3.2.3 Creating a floating IP for Microbosh [Python]View Plaincopy
    1. # Nova Floating-ip-create Public
    2. +--------------+-----------+----------+--------+
    3. | Ip | Server Id | Fixed Ip | Pool |
    4. +--------------+-----------+----------+--------+
    5. |           172.24.4.229 | | -        |  Public |
    6. +--------------+-----------+----------+--------+



3.2.4 Create and edit the deployment description file Microbosh.yml [Ruby]View Plaincopy
  1. ---
  2. Name:microbosh-openstack
  3. Logging
  4. Level:debug
  5. Network
  6. Type:dynamic
  7. vip:172.24.4.229
  8. Cloud_properties:
  9. Net_id:bfc9b30b-8b44-4f97-a762-c39b2f774d78
  10. Resources
  11. persistent_disk:16384
  12. Cloud_properties:
  13. Instance_type:m1.medium
  14. Cloud
  15. Plugin:openstack
  16. Properties
  17. OpenStack
  18. auth_url:http://<ip>:5000/v2.0
  19. Username:demo
  20. Api_key:73b3b497ca3a42d1
  21. Tenant:demo
  22. Default_security_groups: ["ssh", "bosh"]
  23. Default_key_name:microbosh
  24. Private_key: $HOME/microbosh.cer
  25. Apply_spec:
  26. Properties
  27. Director
  28. Max_threads:3
  29. Hm
  30. Resurrector_enabled: True
  31. NTP: # This example uses, the North American NTP servers.  Edit for your region.
  32. -<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
  1. # neutron Net-list
  2. +--------------------------------------+---------+--------------------------------------------------+
  3. | ID | name | Subnets |
  4. +--------------------------------------+---------+--------------------------------------------------+
  5. | 0fbe7f27-e732-4954-9134-5486d7617727 | public |  110583d9-a905-428a-a494-3c95e4a6bca6 |
  6. | bfc9b30b-8b44-4f97-a762-c39b2f774d78 | private | 052030e6-626a-4a57-b8dc-b8ab239f419d 10.0.   0.0/24 |
  7. +--------------------------------------+---------+--------------------------------------------------+



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
    1. # Cat $HOME/keystonerc_demo
    2. Export Os_username=demo
    3. Export Os_tenant_name=demo
    4. Export os_password=73b3b497ca3a42d1
    5. Export os_auth_url=http://<ip>:35357/v2. 0/
    6. 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
    1. # mkdir-p ~/bosh-workspace/stemcells
    2. # CD ~/bosh-workspace/stemcells



(3) Download the Stemcell of micro Bosh [Python]View Plaincopy
  1. # Bosh Public StemCells | Grep-i OpenStack
  2. |  bosh-stemcell-2427-openstack-kvm-ubuntu.tgz |
  3. |  bosh-stemcell-2624-openstack-kvm-centos.tgz |
  4. |  bosh-stemcell-2624-openstack-kvm-ubuntu-lucid.tgz |
  5. |  bosh-stemcell-2749-openstack-kvm-centos-go_agent.tgz |
  6. |  bosh-stemcell-2749-openstack-kvm-ubuntu-trusty-go_agent.tgz |
  7. |  bosh-stemcell-2652-openstack-kvm-ubuntu-lucid-go_agent.tgz |
  8. |  bosh-stemcell-2719.1-openstack-kvm-centos-go_agent.tgz |
  9. |  bosh-stemcell-2719.1-openstack-kvm-ubuntu-trusty-go_agent.tgz |
  10. |  bosh-stemcell-2719.2-openstack-kvm-centos-go_agent.tgz |
  11. |  bosh-stemcell-2719.2-openstack-kvm-ubuntu-trusty-go_agent.tgz |
  12. |  bosh-stemcell-2719.3-openstack-kvm-ubuntu-trusty-go_agent.tgz |



[Python]View Plaincopy
    1. # 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
    1. # CD ~/bosh-workspace/deployments
    2. # Bosh Micro Deployment Microbosh-openstack



* Deploy Micro Bosh

[Python]View Plaincopy
    1. # Bosh Micro Deploy ~/BOSH-WORKSPACE/STEMCELLS/BOSH-STEMCELL-2652-OPENSTACK-KVM-UBUNTU-LUCID-GO_AGENT.TGZ



(5) Verifying micro Bosh [Python]View Plaincopy
    1. # 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
      1. # ssh-i <path to Microbosh private key> [email Protected]<microbosh ip>

Open Source PAAs Scenario: Deploy Cloudfoundry (iii) deployment on OpenStack Bosh

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.