`
zhangqiaoqifgdqsn
  • 浏览: 14720 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

vSphere部署Cloud Foundry V2 (4) ---- 使用 micro bosh 部署 bosh

阅读更多

Cloud Foundry V2 的文章目录在 Cloud Foundry V2 相关文章目录

我会不定期的做一些文章的更改,如有不便之处还要谅解。

在部署中遇到了什么问题可以在下面留言。

本博客的所有yml stemcell 和 release 都能在百度云上下载 http://pan.baidu.com/s/1pJHkPYV

 

如果你有对配置文件或者CF运维有什么更好的想法请联系我,我非常需要你的帮助

 

1、将stemcell上传至 micro bosh

登录到 micro bosh 上 默认密码为 admin

bosh target https://192.168.1.203:25555
Target set to `micro'
Your username: admin
Enter password: *****
Logged in as `admin'

 上传 stemcell

bosh upload stemcell ~/stemcells/bosh-stemcell-2427-vsphere-esxi-ubuntu.tgz
Verifying stemcell...
File exists and readable OK
Verifying tarball...
Read tarball OK
Manifest exists OK
Stemcell image file OK
Stemcell properties OK
Stemcell info
-------------
Name: bosh-vsphere-esxi-ubuntu
Version: 2427
Checking if stemcell already exists...
No
Uploading stemcell...
bosh-stemcell: 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| 385.9MB 18.2MB/s Time: 00:00:21
Director task 1
  Started update stemcell
  Started update stemcell > Extracting stemcell archive. Done (00:00:04)
  Started update stemcell > Verifying stemcell manifest. Done (00:00:01)
  Started update stemcell > Checking if this stemcell already exists. Done (00:00:00)
  Started update stemcell > Uploading stemcell bosh-vsphere-esxi-ubuntu/2427 to the cloud. Done (00:02:25)
  Started update stemcell > Save stemcell bosh-vsphere-esxi-ubuntu/2427 (sc-f487c612-1863-46a8-8cf5-ab0447f4f4f9). Done (00:00:00)
     Done update stemcell (00:02:30)
Task 1 done
Started	 2014-10-15 06:43:52 UTC
Finished	2014-10-15 06:46:22 UTC
Duration	00:02:30
Stemcell uploaded and created.

 

 

 2、上传bosh的release至micro bosh

git clone https://github.com/cloudfoundry/bosh.git
bosh upload release ~/bosh/release/releases/bosh-109.yml
Copying packages
----------------
nginx (3) SKIP
genisoimage (3) SKIP
powerdns (3) SKIP
blobstore (33) SKIP
ruby (7) SKIP
mysql (1) SKIP
nats (3) SKIP
common (2) SKIP
director (40) SKIP
redis (3) SKIP
registry (29) SKIP
libpq (2) SKIP
postgres (2) SKIP
health_monitor (34) SKIP
Copying jobs
------------
powerdns (4) FOUND LOCAL
blobstore (4) FOUND LOCAL
nats (5) FOUND LOCAL
director (15) FOUND LOCAL
redis (3) FOUND LOCAL
registry (2) FOUND LOCAL
postgres (6) FOUND LOCAL
health_monitor (6) FOUND LOCAL
Building tarball
----------------
Generated /tmp/d20141016-21679-l2zk07/d20141016-21679-11esjot/release.tgz
Release size: 23.9K
Verifying release...
File exists and readable OK
。。。。。。。。。。。。。。。。
Monit file for 'health_monitor' OK
Release info
------------
Name: bosh
Version: 42
Packages
  - nginx (3)
  - genisoimage (3)
  - powerdns (3)
  - blobstore (33)
  - ruby (7)
  - mysql (1)
  - nats (3)
  - common (2)
  - director (40)
  - redis (3)
  - registry (29)
  - libpq (2)
  - postgres (2)
  - health_monitor (34)
Jobs
  - powerdns (4)
  - blobstore (4)
  - nats (5)
  - director (15)
  - redis (3)
  - registry (2)
  - postgres (6)
  - health_monitor (6)

 在执行这个命令的时候由于网络不稳定导致ruby的httpclient异常一直执行中断,所以写了一个脚本只要中断了会不停的去下载,适合在深更半夜里开,替你加班。

 

创建一个shell脚本

bosh deployment ~/deployments/bosh.yml 
Deployment set to `/home/base/deployments/bosh.yml'
 vi download.sh

 输入以下内容

while true
do
    bosh upload release ~/bosh/release/releases/bosh-109.yml
    if [ $? -eq 0 ] 
    then
        break
    fi 
done

 运行脚本

sh download.sh

 

 3、编写 bosh 配置文件

查看stemcells名字和版本。

bosh stemcells
+--------------------------+---------+-----------------------------------------+
| Name | Version | CID |
+--------------------------+---------+-----------------------------------------+
| bosh-vsphere-esxi-ubuntu | 2427 | sc-f487c612-1863-46a8-8cf5-ab0447f4f4f9 |
+--------------------------+---------+-----------------------------------------+
(*) Currently in-use
Stemcells total: 1

 查看releases的名字和版本

bosh releases

+------+----------+-------------+
| Name | Versions | Commit Hash |
+------+----------+-------------+
| bosh | 109*     | 01851c1c+   |
+------+----------+-------------+
(*) Currently deployed
(+) Uncommitted changes

Releases total: 1

 查看bosh状态

bosh status
Config
             /home/chance/.bosh_config

Director
  Name       micro
  URL        https://192.168.1.100:25555
  Version    1.2427.0 (release:921db96c bosh:921db96c)
  User       admin
  UUID       f8a07fe6-d4a7-4dfc-815f-26b1633a76d7
  CPI        vsphere
  dns        enabled (domain_name: microbosh)
  compiled_package_cache disabled
  snapshots  disabled

Deployment
  Manifest   /home/chance/deployments/bosh.yml

 编写bosh配置文件

touch bosh.yml
vi bosh yml
---
name: bosh
# 此处uuid就是bosh status里的UUID
director_uuid: 43f500b6-c68f-46c9-b390-711b4cb9dcec

release:
  name: bosh
  version: 109

compilation:
  workers: 3
  network: default
  reuse_compilation_vms: true
  cloud_properties:
    ram: 2024
    disk: 4048
    cpu: 4

update:
  canaries: 1
  canary_watch_time: 3000-120000
  update_watch_time: 3000-120000
  max_in_flight: 4

networks:
- name: default
  subnets:
  - reserved:
    - 192.168.1.10 - 192.168.1.19
    static:
    - 192.168.1.20 - 192.168.1.30
    range: 192.168.1.0/24
    gateway: 192.168.1.1
    dns:
    - 218.2.135.1
    - 61.147.37.1
    cloud_properties:
      name: VM Network

resource_pools:
- name: small
  stemcell:
    name: bosh-vsphere-esxi-ubuntu
    version: 2427
  network: default
  size: 7
  cloud_properties:
    ram: 1024
    disk: 20480
    cpu: 1

- name: director
  stemcell:
    name: bosh-vsphere-esxi-ubuntu
    version: 2427
  network: default
  size: 1
  cloud_properties:
    ram: 1024
    disk: 20480
    cpu: 2

jobs:
- name: nats
  template: nats
  instances: 1
  resource_pool: small
  networks:
  - name: default
    static_ips:
    - 192.168.1.20

- name: postgres
  template: postgres
  instances: 1
  resource_pool: small
  persistent_disk: 2048
  networks:
  - name: default
    static_ips:
    - 192.168.1.21

- name: redis
  template: redis
  instances: 1
  resource_pool: small
  networks:
  - name: default
    static_ips:
    - 192.168.1.22

- name: powerdns
  template: powerdns
  instances: 1
  resource_pool: small
  networks:
  - name: default
    static_ips:
    - 192.168.1.26

- name: director
  template: director
  instances: 1
  resource_pool: director
  persistent_disk: 2048
  networks:
  - name: default
    static_ips:
    - 192.168.1.23

- name: blobstore
  template: blobstore
  instances: 1
  resource_pool: small
  persistent_disk: 20480
  networks:
  - name: default
    static_ips:
    - 192.168.1.24

- name: registry
  template: registry
  instances: 1
  resource_pool: small
  networks:
  - name: default
    static_ips:
    - 192.168.1.27

- name: health_monitor
  template: health_monitor
  instances: 1
  resource_pool: small
  networks:
  - name: default
    static_ips:
    - 192.168.1.25
    
properties:
  env:

  nats:
    user: NaTs
    password: nAtS
    address: 192.168.1.20
    port: 4222

  redis:
    address: 192.168.1.22
    port: 25255
    password: rEdIs

  postgres:
    user: PoStGrEs
    password: pOsTgReS
    address:  192.168.1.21
    port: 5432
    database: bosh

  dns:
    address: 192.168.1.26
    user: PoWeRdNs
    password: pOwErDnS
    db:
      host: 192.168.1.21
      user: PoStGrEs
      password: pOsTgReS
    databases:
      name: pOwErDnS
    webserver:
      password: pOwErDnS
    recursor: 192.168.1.100

  blobstore:
    address: 192.168.1.24
    port: 25251
    backend_port: 25552
    agent:
      user: AgEnT
      password: aGeNt
    director:
      user: DiReCtOr
      password: dIrEcToR

  director:
    name: bosh_director
    address: 192.168.1.23
    port: 25555
    db:
      host: 192.168.1.21
      user: PoStGrEs
      password: pOsTgReS

  registry:
    address: 192.168.1.27
    http:
      user: ReGiStRy
      password: rEgIsTrY
    db:
      host: 192.168.1.21
      user: PoStGrEs
      password: pOsTgReS

  hm:
    http:
      port: 25923
      user: AdMiN
      password: pAsSwOrD
    director_account:
      user: AdMiN
      password: pAsSwOrD
    event_nats_enabled: false
    email_notifications: false
    tsdb_enabled: false
    pagerduty_enabled: false
    varz_enabled: true

  vcenter:
    address: 192.168.1.6
    user: administrator
    password: ******
    datacenters:
      - name: vDataCenter
        vm_folder: zhangqiaoqi_CF/vm_folder_bosh
        template_folder: zhangqiaoqi_CF/template_folder_bosh
        disk_path: boshdeployer_bosh
        datastore_pattern: NFSDataStore
        persistent_datastore_pattern: NFSDataStore
        allow_mixed_datastores: true
        clusters:
        - vCluster

 

 

3、部署 bosh 

检测部署文件有无语法错误,并指定配置文件

bosh deployment ~/deployments/bosh.yml 
Deployment set to `/home/base/deployments/bosh.yml'

 bosh 部署

bosh deploy


Processing deployment manifest
------------------------------
Getting deployment properties from director...
Unable to get properties list from director, trying without it...
Compiling deployment manifest...
Cannot get current deployment information from director, possibly a new deployment
Please review all changes carefully
Deploying
---------
Deployment name: `bosh.yml'
Director name: `micro01'
Are you sure you want to deploy? (type 'yes' to continue): yes
Director task 7
  Started preparing deployment
  Started preparing deployment > Binding deployment. Done (00:00:00)
  Started preparing deployment > Binding releases. Done (00:00:00)
  Started preparing deployment > Binding existing deployment. Done (00:00:00)
  Started preparing deployment > Binding resource pools. Done (00:00:00)
  Started preparing deployment > Binding stemcells. Done (00:00:00)
  Started preparing deployment > Binding templates. Done (00:00:00)
  Started preparing deployment > Binding properties. Done (00:00:00)
  Started preparing deployment > Binding unallocated VMs. Done (00:00:00)
  Started preparing deployment > Binding instance networks. Done (00:00:00)
     Done preparing deployment (00:00:00)
  Started preparing package compilation
  Started preparing package compilation > Finding packages to compile. Done (00:00:00)
     Done preparing package compilation (00:00:00)
  Started compiling packages
  Started compiling packages > genisoimage/3. Done (00:05:20)
  Started compiling packages > nginx/3. Done (00:02:02)
  Started compiling packages > mysql/1. Done (00:01:19)
  Started compiling packages > libpq/2. Done (00:01:32)
  Started compiling packages > redis/3. Done (00:01:36)
  Started compiling packages > postgres/2. Done (00:01:14)
  Started compiling packages > ruby/7. Done (00:03:31)
  Started compiling packages > health_monitor/34. Done (00:02:13)
  Started compiling packages > director/40. Done (00:07:52)
  Started compiling packages > nats/3. Done (00:01:18)
     Done compiling packages (00:27:57)
  Started preparing dns > Binding DNS. Done (00:00:01)
  Started creating bound missing vms
  Started creating bound missing vms > small/0
  Started creating bound missing vms > small/1
  Started creating bound missing vms > small/3
  Started creating bound missing vms > small/2
  Started creating bound missing vms > small/4
  Started creating bound missing vms > director/0
     Done creating bound missing vms > small/3 (00:02:12)
     Done creating bound missing vms > small/2 (00:02:12)
     Done creating bound missing vms > small/4 (00:02:12)
     Done creating bound missing vms > director/0 (00:02:12)
     Done creating bound missing vms > small/1 (00:02:12)
     Done creating bound missing vms > small/0 (00:02:13)
     Done creating bound missing vms (00:02:13)
  Started binding instance vms
  Started binding instance vms > nats/0
  Started binding instance vms > postgres/0
  Started binding instance vms > redis/0
  Started binding instance vms > director/0
  Started binding instance vms > blobstore/0
  Started binding instance vms > health_monitor/0
     Done binding instance vms > director/0 (00:00:01)
     Done binding instance vms > nats/0 (00:00:01)
     Done binding instance vms > postgres/0 (00:00:01)
     Done binding instance vms > health_monitor/0 (00:00:01)
     Done binding instance vms > redis/0 (00:00:01)
     Done binding instance vms > blobstore/0 (00:00:01)
     Done binding instance vms (00:00:01)
  Started preparing configuration > Binding configuration. Done (00:00:00)
  Started updating job nats > nats/0 (canary). Done (00:01:10)
  Started updating job postgres > postgres/0 (canary). Done (00:01:30)
  Started updating job redis > redis/0 (canary). Done (00:01:08)
  Started updating job director > director/0 (canary). Done (00:01:33)
  Started updating job blobstore > blobstore/0 (canary). Done (00:01:30)
  Started updating job health_monitor > health_monitor/0 (canary). Done (00:01:09)
Task 7 done
Started	 2014-10-20 01:16:08 UTC
Finished	2014-10-20 01:54:20 UTC
Duration	00:38:12
Deployed `bosh.yml' to `micro'

 查看bosh

bosh vms
Deployment `bosh'

Director task 14

Task 14 done

+------------------+---------+---------------+--------------+
| Job/index        | State   | Resource Pool | IPs          |
+------------------+---------+---------------+--------------+
| blobstore/0      | running | small         | 192.168.1.24 |
| director/0       | running | director      | 192.168.1.23 |
| health_monitor/0 | running | small         | 192.168.1.25 |
| nats/0           | running | small         | 192.168.1.20 |
| postgres/0       | running | small         | 192.168.1.21 |
| powerdns/0       | running | small         | 192.168.1.26 |
| redis/0          | running | small         | 192.168.1.22 |
+------------------+---------+---------------+--------------+

VMs total: 7

 

分享到:
评论

相关推荐

    cloud foundry 大规模部署(bosh)及平台运营完整中文手册

    - **安装 Cloud Foundry**: 使用 BOSH CLI 和相应的 Deployment Manifest 文件来部署 Cloud Foundry。 ##### 2. **在 OpenStack 上部署** - **环境准备**: 准备好 OpenStack 环境,并安装 BOSH CLI。 - **安装 BOSH...

    vsphere-documentation-67u2-EN.zip

    vsphere-esxi-672-installation-setup-guide.pdf vsphere-esxi-672-upgrade-guide.pdf vsphere-esxi-vcenter-server-672-appliance-configuration-guide.pdf vsphere-esxi-vcenter-server-672-availability-guide...

    vsphere-esxi-vcenter-server-51用户文档

    "vsphere-esxi-vcenter-server-51-host-profiles-guide.pdf"讲解了vSphere主机配置文件的使用,这是一种自动化管理策略,可统一应用到多个ESXi主机。通过主机配置文件,可以标准化环境设置,简化管理和维护工作。 ...

    CCIE-DC vSphere6.0专题视频.zip

    4-vSphere6.0-授权介绍 5-vSphere6.0-课程拓扑介绍 6-vSphere6.0-设计和部署ESXi6.0 7-vSphere6.0-vCenter设计和部署 8-vSphere6.0-共享存储和FC存储介绍 9-vSphere6.0-OpenFiler安装 10-vSphere6.0-设置iSCSI网络 ...

    vsphere-esxi-vcenter-server-511-host-management-guide.pdf

    ### vsphere-esxi-vcenter-server-511-host-management-guide.pdf 知识点解析 #### 一、vCenter Server 和主机管理概述 - **产品版本**:本文档涉及的产品包括 VMware ESXi 5.1 和 vCenter Server 5.1 的 Update 1...

    Cloud Foundry平台概述

    此外,Cloud Foundry还与vSphere/vCloud等本地IaaS平台深度集成,为企业提供了公共、私有或混合的PaaS/IaaS解决方案。这不仅促进了国内云计算技术的发展,也为开发者提供了更多样化的选择和便利。 #### 开始使用...

    VMware vSphere的客户端安装程序VMware-viclient-all-5.1.0-1064113

    VMware-viclient-all-5.1.0-1064113.exe是VMware vSphere的客户端安装程序。它与之前版本的VMware vSphere客户端有所不同,版本号已经升级到5.1.0。 安装VMware-viclient-all-5.1.0-1064113.exe可以让你通过图形...

    NVIDIA-GRID-vSphere-7.0-440.87-443.05.zip

    4. "440.87-443.05-grid-licensing-user-guide.pdf":许可证用户指南,解释了vGPU的授权机制和管理,对于确保合规使用至关重要。 5. "440.87-443.05-grid-vgpu-release-notes-vmware-vsphere.pdf":发布说明,列出...

    vsphere-esxi-vcenter-server-70-vsphere-with-kubernetes-guide.pdf

    vSphere融合kubernetes平台配置手册,提供有关使用 vSphere Client 配置和管理vSphere with Kubernetes的信息。此外,还提供了有关使用 kubectl 连接到在 vSphere with Kubernetes上运行的命名空间以及在指定的命名...

    VMware vSphere的客户端安装程序VMware-viclient-all-4.1.0-258902

    VMware-viclient-all-4.1.0-258902.exe是VMware vSphere的客户端安装程序。vSphere是VMware推出的一款云计算产品,它提供了一套完整的虚拟化解决方案,包括服务器虚拟化、存储虚拟化、网络虚拟化等。 VMware-...

    vsphere-esxi-vcenter-server-501-installation-setup-guide

    ### vsphere-esxi-vcenter-server-501-installation-setup-guide #### 关于vSphere安装与设置 vSphere是VMware公司提供的一套全面的虚拟化解决方案,它可以帮助企业简化IT基础设施并提高资源利用率。本指南主要...

    vsphere-documentation-67.zip

    "vsphere-vcenter-server-67-installation-guide.pdf"则为vCenter Server 6.7的安装指南,提供了详细的安装步骤和注意事项,帮助用户无误地部署vSphere的核心组件。 "vsphere-esxi-vcenter-server-67-platform-...

    vsphere连接工具VMware-viclient-all-5.0.0-455964.exe

    在esxi 5.0版本中有多个小版本,有好多小版本通过vsphere连接的时候经常不兼容导致无法连接,这个版本VMware-viclient-all-5.0.0-455964 可以根据后面版本号和你服务器上安装的exsi进行对比,如果相同就能使用

    VMware-vSphere-SDK-6.0.0.zip

    VMware vSphere SDK是 VMware 公司为开发者提供的一个强大工具集,用于构建与VMware vSphere环境交互的应用程序和服务。vSphere SDK允许开发者通过编程方式管理虚拟化基础设施,包括虚拟机、虚拟网络、存储以及其他...

    vsphere-esxi-vcenter-server-55-availability-guide

    ### vsphere-esxi-vcenter-server-55-availability-guide 知识点解析 #### 关于 vSphere 可用性 vSphere 是 VMware 提供的一套全面的虚拟化平台,能够帮助企业在数据中心环境中优化资源利用效率并提升应用服务的...

    vSphere-vCenter-Esxi-Vmware虚拟机管理工具,可以连接到任何vCenter机器进行批量创建主机等操作

    vSphere-vCenter-Esxi-Vmware虚拟机管理工具,可以连接到任何vCenter机器进行批量创建主机,批量关机,批量开机,批量重启,批量删除释放等操作。后端接口Django开发,用户界面易语言开发。

    vmware vsphere 6.5安装配置资料(中文版).zip

    vsphere-esxi-vcenter-server-65-appliance-configuration-guide vsphere-esxi-vcenter-server-65-availability-guide vsphere-esxi-vcenter-server-65-host-management-guide vsphere-esxi-vcenter-server-65-host-...

    离线安装vsphere-automation-sdk-python(python3.8.1)

    python3.8 离线安装安装vsphere sdk

    vsphere-esxi-vcenter-server-65-installation-setup-guide

    安装完vCenter Server或部署vCenter Server Appliance之后,需要进行一些后续操作,比如使用vSphere Web Client登录到vCenter Server,安装VMware增强型身份验证插件,以及收集vCenter Server的日志文件。...

Global site tag (gtag.js) - Google Analytics