基于vSphere的BOSH部署攻略

   本篇为自己部署的记录,有写的不明确的欢迎指正 

 

1.在其中一台主机上安装虚拟机BoshCli(ubuntu10操作系统),使用一台PC亦可

 

2.BoshCli上安装ruby环境

 

   参见http://oldfritters.iteye.com/blog/1824841

 

3.安装bosh_cli

 

sudo apt-get -y install libsqlite3-dev genisoimage
gem install bosh_deployer
gem install bosh_cli

 

4.下载微 BOSH Stemcell

% mkdir -p ~/stemcells 
% cd stemcells 
% bosh public stemcells 
 ......
 To download use 'bosh download public stemcell <stemcell_name>'. 
% bosh download public stemcell micro-bosh-stemcell-vsphere-0.6.4.tgz

 

5.创建项目目录

 

mkdir ~/deployments
cd ~/deployments
mkdir micro01

    在micro01中创建文件micro_bosh.yml,内容如下:

---
name: micro01
network:
  ip: 10.0.0.12
  netmask: 255.255.255.0
  gateway: 10.0.0.1
  dns:
  - 202.119.32.6
  - 202.119.32.12
  cloud_properties:
    name: VM Network
resources:
  persistent_disk: 16384
  cloud_properties:
    ram: 4096
    disk: 16384
    cpu: 2
cloud:
  plugin: vsphere
  properties:
    agent:
      ntp:
       - time.bnu.edu.cn
       - ntp02.las01.emcatmos.com
    vcenters:
      - host: 10.0.0.6
        user: administrator
        password: QWEqwe123@
        datacenters:
          - name: vDataCenter
            vm_folder: vm_folder
            template_folder: template_folder
            disk_path: boshdeployer
            datastore_pattern: NFSDataStore
            persistent_datastore_pattern: NFSDataStore
            allow_mixed_datastores: true
            clusters:
              - vCluster

 

bosh micro deployment micro_bosh.yml
  

6.部署一个新的micro BOSH 实例并创建一个新的持久磁盘

 

bosh micro deploy ~/stemcells/micro-bosh-stemcell-vsphere-0.6.4.tgz 

   查看微 BOSH 部署的状态      bosh status

   列出部署                                bosh micro deployments

   删除微 BOSH 部署                 bosh micro delete

....................................................................

 

7.安装BOSH

git clone git@github.com:cloudfoundry/bosh-release.git
cd bosh-release
git checkout 9e0b649da80a563ba64229069299c57f72ab54ad
bosh upload stemcell bosh-stemcell-vsphere-0.6.7.tgz
bosh upload release releases/bosh-11.yml
bosh deployment bosh.yml
bosh deploy

 

8.安装cloud foundry(即cf)

bosh target 10.0.0.23 #target到你的director
 git clone git@github.com:cloudfoundry/cf-release.git
 cd cf-release
 bosh upload release releases/appcloud-129.yml # use the highest number available - inspecting the files in this directory
bosh deployment ~/deployments/cloudfoundry.yml

    以下是一个

---
name: cf-dev
director_uuid: df1194df-6753-46f8-b05f-ef8d29381801

release:
  name: appcloud
  version: 127

compilation:
  workers: 8
  network: default
  cloud_properties:
    ram: 2048
    disk: 8096
    cpu: 4

update:
  canaries: 1
  canary_watch_time: 3000-90000
  update_watch_time: 3000-90000
  max_in_flight: 4
  max_errors: 4

networks:

- name: default
  subnets:
  - range: 10.0.0.0/24
    reserved:
    - 10.0.0.10 - 10.0.0.29
    static:
    - 10.0.0.30 - 10.0.0.160
    gateway: 10.0.0.1
    dns:
    - 202.119.32.6
    - 202.119.32.12
    cloud_properties:
      name: VM Network

resource_pools:

- name: infrastructure
  network: default
  size: 28
  stemcell:
    name: bosh-stemcell
    version: 0.8.0
  cloud_properties:
    ram: 2048
    disk: 8192
    cpu: 1
  env:
    bosh:
      # password generated using mkpasswd -m sha-512
      password: $6$leYJSesP$fPm2lwx4Pw/5ZmafFH3h0sMjnMhdH02uC4K7Te0Bu48YhS7o3PFxfsv.V/is.Ty29Ol1j2lvWLcMiE99AvoMy/

- name: deas
  network: default
  size: 2
  stemcell:
    name: bosh-stemcell
    version: 0.8.0
  cloud_properties:
    ram: 8192
    disk: 16384
    cpu: 4
  env:
    bosh:
      # password generated using mkpasswd -m sha-512
      password: $6$leYJSesP$fPm2lwx4Pw/5ZmafFH3h0sMjnMhdH02uC4K7Te0Bu48YhS7o3PFxfsv.V/is.Ty29Ol1j2lvWLcMiE99AvoMy/

- name: services_3gb
  network: default
  size: 2
  stemcell:
    name: bosh-stemcell
    version: 0.8.0
  cloud_properties:
    ram: 3072
    disk: 8192
    cpu: 8
  env:
    bosh:
      # password generated using mkpasswd -m sha-512
      password: $6$leYJSesP$fPm2lwx4Pw/5ZmafFH3h0sMjnMhdH02uC4K7Te0Bu48YhS7o3PFxfsv.V/is.Ty29Ol1j2lvWLcMiE99AvoMy/

- name: services_13gb
  network: default
  size: 1
  stemcell:
    name: bosh-stemcell
    version: 0.8.0
  cloud_properties:
    ram: 13312
    disk: 8192
    cpu: 8
  env:
    bosh:
      # password generated using mkpasswd -m sha-512
      password: $6$leYJSesP$fPm2lwx4Pw/5ZmafFH3h0sMjnMhdH02uC4K7Te0Bu48YhS7o3PFxfsv.V/is.Ty29Ol1j2lvWLcMiE99AvoMy/

- name: services_21gb
  network: default
  size: 2
  stemcell:
    name: bosh-stemcell
    version: 0.8.0
  cloud_properties:
    ram: 21504
    disk: 8192
    cpu: 8
  env:
    bosh:
      # password generated using mkpasswd -m sha-512
      password: $6$leYJSesP$fPm2lwx4Pw/5ZmafFH3h0sMjnMhdH02uC4K7Te0Bu48YhS7o3PFxfsv.V/is.Ty29Ol1j2lvWLcMiE99AvoMy/

jobs:

- name: debian_nfs_server
  release: appcloud
  template: debian_nfs_server
  instances: 1
  resource_pool: infrastructure
  persistent_disk: 8192
  networks:
  - name: default
    static_ips:
    - 10.0.0.30

- name: services_nfs
  release: appcloud
  template: debian_nfs_server
  instances: 1
  resource_pool: infrastructure
  persistent_disk: 10240
  properties:
    debian_nfs_server:
      no_root_squash: true
  networks:
  - name: default
    static_ips:
    - 10.0.0.60

- name: syslog_aggregator
  release: appcloud
  template: syslog_aggregator
  instances: 1
  resource_pool: infrastructure
  persistent_disk: 100000
  networks:
  - name: default
    static_ips:
    - 10.0.0.61

- name: nats
  release: appcloud
  template: nats
  instances: 1
  resource_pool: infrastructure
  networks:
  - name: default
    static_ips:
    - 10.0.0.31

- name: hbase_slave
  release: appcloud
  template: hbase_slave
  instances: 3
  resource_pool: infrastructure
  persistent_disk: 2048
  networks:
  - name: default
    static_ips:
    - 10.0.0.67
    - 10.0.0.68
    - 10.0.0.69

- name: hbase_master
  release: appcloud
  template: hbase_master
  instances: 1
  resource_pool: infrastructure
  persistent_disk: 2048
  networks:
  - name: default
    static_ips:
    - 10.0.0.70

- name: opentsdb
  release: appcloud
  template: opentsdb
  instances: 1
  resource_pool: infrastructure
  networks:
  - name: default
    static_ips:
    - 10.0.0.63

- name: collector
  release: appcloud
  template: collector
  instances: 1
  resource_pool: infrastructure
  networks:
  - name: default
    static_ips:
    - 10.0.0.64

- name: dashboard
  release: appcloud
  template: dashboard
  instances: 1
  resource_pool: infrastructure
  networks:
  - name: default

- name: ccdb_ng
  release: appcloud
  template: postgres
  instances: 1
  resource_pool: infrastructure
  persistent_disk: 2048
  networks:
  - name: default
    static_ips:
    - 10.0.0.32
  properties:
    db: ccdb_ng

- name: uaadb
  release: appcloud
  template: postgres
  instances: 1
  resource_pool: infrastructure
  persistent_disk: 2048
  networks:
  - name: default
    static_ips:
    - 10.0.0.33
  properties:
    db: uaadb

- name: vcap_redis
  release: appcloud
  template: vcap_redis
  instances: 1
  resource_pool: infrastructure
  networks:
  - name: default
    static_ips:
    - 10.0.0.34

- name: services_redis
  release: appcloud
  template: vcap_redis
  instances: 1
  resource_pool: infrastructure
  persistent_disk: 2048
  networks:
  - name: default
    static_ips:
    - 10.0.0.62
  properties:
    vcap_redis:
      port: 3456
      password: fksaefblsdf9
      maxmemory: 2000000000
      persistence:
        dir: /var/vcap/store/vcap_redis

- name: uaa
  release: appcloud
  template: uaa
  instances: 1
  resource_pool: infrastructure
  networks:
  - name: default

- name: login
  release: appcloud
  template: login
  instances: 1
  resource_pool: infrastructure
  networks:
  - name: default

- name: cloud_controller_ng
  release: appcloud
  template: cloud_controller_ng
  instances: 1
  resource_pool: infrastructure
  networks:
  - name: default

- name: router
  release: appcloud
  template: gorouter
  instances: 1
  resource_pool: infrastructure
  networks:
  - name: default
    default: [dns, gateway]

- name: health_manager_next
  release: appcloud
  template: health_manager_next
  instances: 1
  resource_pool: infrastructure
  networks:
  - name: default
    static_ips:
    - 10.0.0.66
  properties:
    cc_props: ccng
    hm_props: health_manager_ccng

- name: dea_next
  release: appcloud
  template: dea_next
  instances: 1
  resource_pool: deas
  update:
    max_in_flight: 8
  networks:
  - name: default

- name: mysql_node_100
  release: appcloud
  template: mysql_node_ng
  instances: 1
  resource_pool: services_3gb
  persistent_disk: 12058
  properties:
    plan: "100"
  networks:
  - name: default
    static_ips:
    - 10.0.0.45

- name: mysql_gateway
  release: appcloud
  template: mysql_gateway
  instances: 1
  resource_pool: infrastructure
  networks:
  - name: default
  properties:
    uaa_client_id: "vmc"
    uaa_endpoint: https://uaa.your.domain.org
    uaa_client_auth_credentials:
      username: your-admin@your-org.com
      password: your-admin-password

- name: mongodb_node_100
  release: appcloud
  template: mongodb_node_ng
  instances: 1
  resource_pool: services_21gb
  persistent_disk: 63729
  properties:
    plan: "100"
  networks:
  - name: default
    static_ips:
    - 10.0.0.49

- name: mongodb_gateway
  release: appcloud
  template: mongodb_gateway
  instances: 1
  resource_pool: infrastructure
  networks:
  - name: default
  properties:
    uaa_client_id: "vmc"
    uaa_endpoint: https://uaa.your.domain.org
    uaa_client_auth_credentials:
      username: your-admin@your-org.com
      password: your-admin-password

- name: redis_node_100
  release: appcloud
  template: redis_node_ng
  instances: 1
  resource_pool: services_13gb
  persistent_disk: 7168
  properties:
    plan: "100"
  networks:
  - name: default
    static_ips:
    - 10.0.0.47

- name: redis_gateway
  release: appcloud
  template: redis_gateway
  instances: 1
  resource_pool: infrastructure
  networks:
  - name: default
  properties:
    uaa_client_id: "vmc"
    uaa_endpoint: https://uaa.your.domain.org
    uaa_client_auth_credentials:
      username: your-admin@your-org.com
      password: your-admin-password

- name: rabbit_node_100
  release: appcloud
  template: rabbit_node_ng
  instances: 1
  resource_pool: services_21gb
  persistent_disk: 3072
  properties:
    plan: "100"
  networks:
  - name: default
    static_ips:
    - 10.0.0.51

- name: rabbit_gateway
  release: appcloud
  template: rabbit_gateway
  instances: 1
  resource_pool: infrastructure
  networks:
  - name: default
  properties:
    uaa_client_id: "vmc"
    uaa_endpoint: https://uaa.your.domain.org
    uaa_client_auth_credentials:
      username: your-admin@your-org.com
      password: the_admin_pw

- name: postgresql_node_100
  release: appcloud
  template: postgresql_node_ng
  instances: 1
  resource_pool: services_3gb
  persistent_disk: 15861
  properties:
    plan: "100"
  networks:
  - name: default
    static_ips:
    - 10.0.0.53

- name: postgresql_gateway
  release: appcloud
  template: postgresql_gateway
  instances: 1
  resource_pool: infrastructure
  networks:
  - name: default
  properties:
    uaa_client_id: "vmc"
    uaa_endpoint: https://uaa.your.domain.org
    uaa_client_auth_credentials:
      username: your-admin@your-org.com
      password: the_admin_pw

- name: backup_manager
  release: appcloud
  template: backup_manager
  instances: 1
  resource_pool: infrastructure
  networks:
  - name: default
    static_ips:
    - 10.0.0.57

- name: service_utilities
  release: appcloud
  template: service_utilities
  instances: 1
  resource_pool: infrastructure
  networks:
  - name: default
    static_ips:
    - 10.0.0.58

- name: serialization_data_server
  release: appcloud
  template: serialization_data_server
  instances: 1
  resource_pool: infrastructure
  networks:
  - name: default
    static_ips:
    - 10.0.0.59

properties:
  domain: cf.local

  networks:
    apps: default
    management: default

  nats:
    user: nats
    password: asdfasdfasdf
    address: 10.0.0.31
    port: 4222

#required for uaa batch until it is removed
  ccdb:
    address: 127.0.0.1
    port: 12345
    roles:
    - tag: admin
      name: a-ccdb-user-name
      password: a-ccdb-password
    databases: 
    - tag: cc
      name: foobar

  ccdb_ng:
    address: 10.0.0.32
    port: 5524
    pool_size: 10
    roles:
    - tag: admin
      name: ccadmin
      password: asdfasdf80456
    databases:
    - tag: cc
      name: appcloud
      citext: true

  health_manager_ccng:
    shadow_mode: disable
    cc_partition: ng

  uaadb:
    address: 10.0.0.33
    port: 2544
    roles:
    - tag: admin
      name: root
      password: asdfsadf9089089345
    databases:
    - tag: uaa
      name: uaa

  cc:
    srv_api_uri: http://ccng.local

  ccng:
    srv_api_uri: http://ccng.local
    external_host: ccng
    logging_level: debug
    bulk_api_password: asdfjklhsadfhljkfas
    uaa_resource_id: cloud_controller
    staging_upload_user: jkfgjkfg
    staging_upload_password: lfgklfgfg

  vcap_redis:
    address: 10.0.0.34
    port: 5454
    password: jkfgkjfgjkfgjkfgjk
    maxmemory: 2000000000 # 2GB

  router:
    status:
      port: 8080
      user: 0dfg0dfg0dfg
      password: kdfgkdfgkdfgdfg4

  dashboard:
    uaa:
      client_id: dashboard
      client_secret: 0dfgmsfgngrioger
    users:
      - [dash-user, dash-password]

  dea:
    max_memory: 8192

  dea_next:
    memory_mb: 8192
    memory_overcommit_factor: 4
    disk_mb: 16384
    disk_overcommit_factor: 4
    num_instances: 256

  nfs_server:
    address: 10.0.0.30
    network: 10.0.0.0/24

  hbase_master:
    address: 10.0.0.70
    hbase_master:
      port: 60000
      webui_port: 60010
      heap_size: 1024
    hbase_zookeeper:
      heap_size: 1024
    hadoop_namenode:
      port: 9000

  opentsdb:
    address: 10.0.0.63
    port: 4242

  hbase_slave:
    hbase_regionserver:
      port: 60020
      heap_size: 1024
    addresses:
    - 10.0.0.67
    - 10.0.0.68
    - 10.0.0.69

  service_plans:
    mysql:
      "100":
        description: "Shared server, shared VM, 1MB memory, 10MB storage, 10 connections"
        free: true
        job_management:
          high_water: 900
          low_water: 100
        configuration:
          capacity: 500
          max_db_size: 10
          key_buffer: 512
          innodb_buffer_pool_size: 512
          max_allowed_packet: 16
          thread_cache_size: 128
          query_cache_size: 128
          max_long_query: 3
          max_long_tx: 30
          max_clients: 10
          max_connections: 1000
          table_open_cache: 2000
          innodb_tables_per_database: 50
          connection_pool_size:
            min: 5
            max: 10
          backup:
            enable: true
          lifecycle:
            enable: true
            serialization: enable
            snapshot:
              quota: 1
          warden:
            enable: false
    postgresql:
      "100":
        description: "Shared server, shared VM, 1MB memory, 10MB storage, 10 connections"
        free: true
        job_management:
          high_water: 900
          low_water: 100
        configuration:
          capacity: 500
          max_db_size: 10
          max_long_query: 3
          max_long_tx: 10
          max_clients: 10
          max_connections: 1000
          shared_buffers: 320
          effective_cache_size: 1142
          shmmax: 397410304
          checkpoint_segments: 16
          checkpoint_segments_max: 50
          maintenance_work_mem: 30
          backup:
            enable: true
          lifecycle:
            enable: true
            serialization: enable
            snapshot:
              quota: 1
          warden:
            enable: false
    mongodb:
      "100":
        description: "Dedicated server, shared VM, 250MB storage, 10 connections"
        free: true
        job_management:
          high_water: 230
          low_water: 20
        configuration:
          capacity: 125
          max_clients: 10
          quota_files: 4
          quota_data_size: 240
          enable_journaling: true
          backup:
            enable: true
          lifecycle:
            enable: true
            serialization: enable
            snapshot:
              quota: 1
    redis:
      "100":
        description: "Dedicated server, shared VM, 20MB memory, 50 connections"
        free: true
        job_management:
          high_water: 410
          low_water: 40
        configuration:
          capacity: 220
          max_memory: 20
          memory_overhead: 20
          max_clients: 50
          persistent: true
          backup:
            enable: true
          lifecycle:
            enable: true
            serialization: enable
            snapshot:
              quota: 1
    rabbit:
      "100":
        description: "Dedicated server, shared VM, 1MB messages/day, 10 connections"
        free: true
        job_management:
          high_water: 280
          low_water: 20
        configuration:
          capacity: 150
          max_disk: 10
          max_clients: 10
          vm_memory_high_watermark: 0.00587
          free_disk_low_water: 0.01832
          bandwidth_quotas:
            per_day: 1
            per_second: 0.01
          filesystem_quota: true

  serialization_data_server:
    upload_token: asdf9asd9asd9ad9ads9ads
    use_nginx: true
    upload_timeout: 10
    port: 8080
    upload_file_expire_time: 600
    purge_expired_interval: 30

  service_backup:
    nfs_server:
      address: 10.0.0.30
      export_dir: /var/vcap/store/shared

  service_migration:
    nfs_server:
      address: 10.0.0.30
      export_dir: /var/vcap/store/shared

  service_backup_manager:
    enable: true

  service_snapshot_manager:
    enable: true

  service_job_manager:
    # enable: true

  service_lifecycle:
    download_url: service-serialization.cf.local
    mount_point: /var/vcap/service_lifecycle
    tmp_dir: /var/vcap/service_lifecycle/tmp_dir
    resque:
      host: 10.0.0.62
      port: 3456
      password: sfgasdgfasdfg
    nfs_server:
      address: 10.0.0.30
      export_dir: /var/vcap/store/shared
    serialization_data_server:
    - 10.0.0.59

  mysql_gateway:
    token: uiasdfkasdfophasdfkjadsf
    default_plan: "100"
    supported_versions: ["5.5"]
    version_aliases:
      current: "5.5"
    cc_api_version: v2
  mysql_node:
    password: adfsadfsadsv
    supported_versions: ["5.5"]
    default_version: "5.5"
    max_tmp: 1024

  redis_gateway:
    token: u9sadfy9adfspsadonjasdfhjopadfs
    default_plan: "100"
    supported_versions: ["2.6"]
    version_aliases:
      current: "2.6"
    cc_api_version: v2
  redis_node:
    command_rename_prefix: foobar
    supported_versions: ["2.6"]
    default_version: "2.6"

  mongodb_gateway:
    token: asdfasdfadfs090uadsf9fsrg
    default_plan: "100"
    supported_versions: ["2.2"]
    version_aliases:
      current: "2.2"
    cc_api_version: v2
  mongodb_node:
    supported_versions: ["2.2"]
    default_version: "2.2"
    max_tmp: 900

  rabbit_gateway:
    token: asdfuiasdfojiasdfjosadfjks
    default_plan: "100"
    supported_versions: ["2.8"]
    version_aliases:
      current: "2.8"
    cc_api_version: v2
  rabbit_node:
    supported_versions: ["2.8"]
    default_version: "2.8"

  postgresql_gateway:
    token: asdfg0uadsfophiasdfhophoads
    supported_plan: "100"
    supported_versions: ["9.1"]
    version_aliases:
      current: "9.1"
    cc_api_version: v2
  postgresql_node:
    supported_versions: ["9.1"]
    default_version: "9.1"
    password: puafsp0uadfsophdsafjoidfs

  syslog_aggregator:
    address: 10.0.0.61
    port: 54321

  uaa:
    catalina_opts: -Xmx768m -XX:MaxPermSize=256m
    url: http://uaa.cf.local
    resource_id: account_manager
    client_secret: somesecret
    token_secret: tokensecret
    cc:
      token_secret: asdfasdfasdfadfs
      client_secret: asdfasdfasdffth
    admin:
      client_secret: erthth45ydbgaerg
    login:
      client_secret: 457dgnsrgw457sdg
    batch:
      username: sdfgjwetrysdgf
      password: 235dshsbsdgssd
    client:
      override: true
      autoapprove:
        - vmc
        - my
        - portal
        - micro
        - support-signon
        - login
    clients:
      dashboard:
        secret: w4ydbsbJUetdrgdsg
        scope: openid,dashboard.user
        authorities: uaa.admin,uaa.resource,tokens.read,scim.read,scim.write
        authorized-grant-types: client_credentials,authorization_code,refresh_token
      portal:
        override: true
        id: portal
        scope: scim.write,scim.read,openid,cloud_controller.read,cloud_controller.write
        authorities: scim.write,scim.read,openid,cloud_controller.read,cloud_controller.write,password.write,uaa.admin
        secret: portalsecret
        authorized-grant-types: authorization_code,client_credentials,password,implicit
        access-token-validity: 1209600
        refresh-token-validity: 1209600
      support-services:
        scope: scim.write,scim.read,openid,cloud_controller.read,cloud_controller.write
        secret: ssosecretsso
        id: support-services
        authorized-grant-types: authorization_code,client_credentials
        redirect-uri: http://support-signon.cf.your.domain.com
        authorities: portal.users.read
        access-token-validity: 1209600
        refresh-token-validity: 1209600
      vmc:
        override: true
        authorized-grant-types: implicit
        authorities: uaa.none
        scope: cloud_controller.read,cloud_controller.write,openid,password.write,cloud_controller.admin,scim.read,scim.write
    scim:
      users:
      - your-admin@your-org.com|your-admin-password|scim.write,scim.read,openid,cloud_controller.admin
      - dash-user|dash-password|openid,dashboard.user

 

 

 

 

本文固定链接:http://www.verydemo.com/demo_c119_i1960.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值