开源的PaaS方案:在OpenStack上部署CloudFoundry (四)使用Micro Bosh部署CloudFoundry

使用bosh部署应用是需要两部分,一个是创建虚拟机使用的模板stemcell,另外一个是应该的Release。所以,部署CloudFoundry之前需要上传stencil和release

4.1 使用bosh上传Stemcell

[python] view plaincopy

  1. # bosh upload stemcell ~/stemcell/bosh-stemcell-2652-openstack-kvm-ubuntu-lucid-go_agent.tgz
  2. # bosh stemcells
  3. +------------------------------------------+---------+--------------------------------------+
  4. | Name                                     | Version | CID                                  |
  5. +------------------------------------------+---------+--------------------------------------+
  6. | bosh-openstack-kvm-ubuntu-lucid-go_agent | 2652*   | 5a6ddcc0-29e6-4b65-a769-8dd8a99eb5df |
  7. +------------------------------------------+---------+--------------------------------------+
  8. (*) Currently in-use
  9. Stemcells total: 1

4.2 使用bosh上传CloudFoundry

[python] view plaincopy

  1. # cd ~/bosh-workspace/releases/cf-release
  2. # bosh upload release releases/cf-170.yml
  3. # bosh releases+------+----------+-------------+
  4. | Name | Versions | Commit Hash |
  5. +------+----------+-------------+
  6. | cf   | 170*     | 0c0c72c3+   |
  7. +------+----------+-------------+
  8. (*) Currently deployed
  9. (+) Uncommitted changes
  10. Releases total: 1

4.3 创建部署描述文件

[ruby] view plaincopy

  1. <%
  2. director_uuid = "REPLACE-DIRECTOR_UUID"
  3. static_ip = "REPLACE-IP-ADDRESS"
  4. root_domain = "#{static_ip}.xip.io"
  5. deployment_name = ‘cf‘
  6. cf_release = ‘170‘
  7. protocol = ‘http‘
  8. common_password = ‘mysecretpassword‘
  9. %>
  10. ---
  11. name: <%= deployment_name %>
  12. director_uuid: <%= director_uuid %>
  13. releases:
  14. - name: cf
  15. version: <%= cf_release %>
  16. compilation:
  17. workers: 3
  18. network: default
  19. reuse_compilation_vms: true
  20. cloud_properties:
  21. instance_type: m1.large
  22. update:
  23. canaries: 0
  24. canary_watch_time: 30000-600000
  25. update_watch_time: 30000-600000
  26. max_in_flight: 32
  27. serial: false
  28. networks:
  29. - name: default
  30. type: dynamic
  31. cloud_properties:
  32. security_groups:
  33. - default
  34. - bosh
  35. - cf-private
  36. - name: external
  37. type: dynamic
  38. cloud_properties:
  39. security_groups:
  40. - default
  41. - bosh
  42. - cf-public
  43. - name: floating
  44. type: vip
  45. cloud_properties: {}
  46. resource_pools:
  47. - name: common
  48. network: default
  49. size: 14
  50. stemcell:
  51. name: bosh-openstack-kvm-ubuntu-lucid
  52. version: latest
  53. cloud_properties:
  54. instance_type: m1.small
  55. - name: large
  56. network: default
  57. size: 3
  58. stemcell:
  59. name: bosh-openstack-kvm-ubuntu-lucid
  60. version: latest
  61. cloud_properties:
  62. instance_type: m1.medium
  63. jobs:
  64. - name: nats
  65. templates:
  66. - name: nats
  67. - name: nats_stream_forwarder
  68. instances: 1
  69. resource_pool: common
  70. networks:
  71. - name: default
  72. default: [dns, gateway]
  73. - name: syslog_aggregator
  74. templates:
  75. - name: syslog_aggregator
  76. instances: 1
  77. resource_pool: common
  78. persistent_disk: 65536
  79. networks:
  80. - name: default
  81. default: [dns, gateway]
  82. - name: nfs_server
  83. templates:
  84. - name: debian_nfs_server
  85. instances: 1
  86. resource_pool: common
  87. persistent_disk: 65535
  88. networks:
  89. - name: default
  90. default: [dns, gateway]
  91. - name: postgres
  92. templates:
  93. - name: postgres
  94. instances: 1
  95. resource_pool: common
  96. persistent_disk: 65536
  97. networks:
  98. - name: default
  99. default: [dns, gateway]
  100. properties:
  101. db: databases
  102. - name: uaa
  103. templates:
  104. - name: uaa
  105. instances: 1
  106. resource_pool: common
  107. networks:
  108. - name: default
  109. default: [dns, gateway]
  110. - name: loggregator
  111. templates:
  112. - name: loggregator
  113. instances: 1
  114. resource_pool: common
  115. networks:
  116. - name: default
  117. default: [dns, gateway]
  118. - name: trafficcontroller
  119. templates:
  120. - name: loggregator_trafficcontroller
  121. instances: 1
  122. resource_pool: common
  123. networks:
  124. - name: default
  125. default: [dns, gateway]
  126. - name: cloud_controller
  127. templates:
  128. - name: cloud_controller_ng
  129. instances: 1
  130. resource_pool: common
  131. networks:
  132. - name: default
  133. default: [dns, gateway]
  134. properties:
  135. ccdb: ccdb
  136. - name: cloud_controller_worker
  137. templates:
  138. - name: cloud_controller_worker
  139. instances: 1
  140. resource_pool: common
  141. networks:
  142. - name: default
  143. default: [dns, gateway]
  144. properties:
  145. ccdb: ccdb
  146. - name: clock_global
  147. templates:
  148. - name: cloud_controller_clock
  149. instances: 1
  150. resource_pool: common
  151. networks:
  152. - name: default
  153. default: [dns, gateway]
  154. properties:
  155. ccdb: ccdb
  156. - name: etcd
  157. templates:
  158. - name: etcd
  159. instances: 1
  160. resource_pool: common
  161. persistent_disk: 10024
  162. networks:
  163. - name: default
  164. default: [dns, gateway]
  165. - name: health_manager
  166. templates:
  167. - name: hm9000
  168. instances: 1
  169. resource_pool: common
  170. networks:
  171. - name: default
  172. default: [dns, gateway]
  173. - name: dea
  174. templates:
  175. - name: dea_logging_agent
  176. - name: dea_next
  177. instances: 3
  178. resource_pool: large
  179. networks:
  180. - name: default
  181. default: [dns, gateway]
  182. - name: router
  183. templates:
  184. - name: gorouter
  185. instances: 1
  186. resource_pool: common
  187. networks:
  188. - name: default
  189. default: [dns, gateway]
  190. - name: haproxy
  191. templates:
  192. - name: haproxy
  193. instances: 1
  194. resource_pool: common
  195. networks:
  196. - name: external
  197. default: [dns, gateway]
  198. - name: floating
  199. static_ips:
  200. - <%= static_ip %>
  201. properties:
  202. networks:
  203. apps: external
  204. properties:
  205. domain: <%= root_domain %>
  206. system_domain: <%= root_domain %>
  207. system_domain_organization: ‘admin‘
  208. app_domains:
  209. - <%= root_domain %>
  210. haproxy: {}
  211. networks:
  212. apps: default
  213. nats:
  214. user: nats
  215. password: <%= common_password %>
  216. address: 0.nats.default.<%= deployment_name %>.microbosh
  217. port: 4222
  218. machines:
  219. - 0.nats.default.<%= deployment_name %>.microbosh
  220. syslog_aggregator:
  221. address: 0.syslog-aggregator.default.<%= deployment_name %>.microbosh
  222. port: 54321
  223. nfs_server:
  224. address: 0.nfs-server.default.<%= deployment_name %>.microbosh
  225. network: "*.<%= deployment_name %>.microbosh"
  226. idmapd_domain: "localdomain"
  227. debian_nfs_server:
  228. no_root_squash: true
  229. loggregator_endpoint:
  230. shared_secret: <%= common_password %>
  231. host: 0.trafficcontroller.default.<%= deployment_name %>.microbosh
  232. loggregator:
  233. servers:
  234. zone:
  235. -  0.loggregator.default.<%= deployment_name %>.microbosh
  236. traffic_controller:
  237. zone: ‘zone‘
  238. logger_endpoint:
  239. use_ssl: <%= protocol == ‘https‘ %>
  240. port: 80
  241. ssl:
  242. skip_cert_verify: true
  243. router:
  244. endpoint_timeout: 60
  245. status:
  246. port: 8080
  247. user: gorouter
  248. password: <%= common_password %>
  249. servers:
  250. z1:
  251. - 0.router.default.<%= deployment_name %>.microbosh
  252. z2: []
  253. etcd:
  254. machines:
  255. - 0.etcd.default.<%= deployment_name %>.microbosh
  256. dea: &dea
  257. disk_mb: 102400
  258. disk_overcommit_factor: 2
  259. memory_mb: 15000
  260. memory_overcommit_factor: 3
  261. directory_server_protocol: <%= protocol %>
  262. mtu: 1460
  263. deny_networks:
  264. - 169.254.0.0/16 # Google Metadata endpoint
  265. dea_next: *dea
  266. disk_quota_enabled: false
  267. dea_logging_agent:
  268. status:
  269. user: admin
  270. password: <%= common_password %>
  271. databases: &databases
  272. db_scheme: postgres
  273. address: 0.postgres.default.<%= deployment_name %>.microbosh
  274. port: 5524
  275. roles:
  276. - tag: admin
  277. name: ccadmin
  278. password: <%= common_password %>
  279. - tag: admin
  280. name: uaaadmin
  281. password: <%= common_password %>
  282. databases:
  283. - tag: cc
  284. name: ccdb
  285. citext: true
  286. - tag: uaa
  287. name: uaadb
  288. citext: true
  289. ccdb: &ccdb
  290. db_scheme: postgres
  291. address: 0.postgres.default.<%= deployment_name %>.microbosh
  292. port: 5524
  293. roles:
  294. - tag: admin
  295. name: ccadmin
  296. password: <%= common_password %>
  297. databases:
  298. - tag: cc
  299. name: ccdb
  300. citext: true
  301. ccdb_ng: *ccdb
  302. uaadb:
  303. db_scheme: postgresql
  304. address: 0.postgres.default.<%= deployment_name %>.microbosh
  305. port: 5524
  306. roles:
  307. - tag: admin
  308. name: uaaadmin
  309. password: <%= common_password %>
  310. databases:
  311. - tag: uaa
  312. name: uaadb
  313. citext: true
  314. cc: &cc
  315. srv_api_uri: <%= protocol %>://api.<%= root_domain %>
  316. jobs:
  317. local:
  318. number_of_workers: 2
  319. generic:
  320. number_of_workers: 2
  321. global:
  322. timeout_in_seconds: 14400
  323. app_bits_packer:
  324. timeout_in_seconds: null
  325. app_events_cleanup:
  326. timeout_in_seconds: null
  327. app_usage_events_cleanup:
  328. timeout_in_seconds: null
  329. blobstore_delete:
  330. timeout_in_seconds: null
  331. blobstore_upload:
  332. timeout_in_seconds: null
  333. droplet_deletion:
  334. timeout_in_seconds: null
  335. droplet_upload:
  336. timeout_in_seconds: null
  337. model_deletion:
  338. timeout_in_seconds: null
  339. bulk_api_password: <%= common_password %>
  340. staging_upload_user: upload
  341. staging_upload_password: <%= common_password %>
  342. quota_definitions:
  343. default:
  344. memory_limit: 10240
  345. total_services: 100
  346. non_basic_services_allowed: true
  347. total_routes: 1000
  348. trial_db_allowed: true
  349. resource_pool:
  350. resource_directory_key: cloudfoundry-resources
  351. fog_connection:
  352. provider: Local
  353. local_root: /var/vcap/nfs/shared
  354. packages:
  355. app_package_directory_key: cloudfoundry-packages
  356. fog_connection:
  357. provider: Local
  358. local_root: /var/vcap/nfs/shared
  359. droplets:
  360. droplet_directory_key: cloudfoundry-droplets
  361. fog_connection:
  362. provider: Local
  363. local_root: /var/vcap/nfs/shared
  364. buildpacks:
  365. buildpack_directory_key: cloudfoundry-buildpacks
  366. fog_connection:
  367. provider: Local
  368. local_root: /var/vcap/nfs/shared
  369. install_buildpacks:
  370. - name: java_buildpack
  371. package: buildpack_java
  372. - name: ruby_buildpack
  373. package: buildpack_ruby
  374. - name: nodejs_buildpack
  375. package: buildpack_nodejs
  376. - name: go_buildpack
  377. package: buildpack_go
  378. db_encryption_key: <%= common_password %>
  379. hm9000_noop: false
  380. diego: false
  381. newrelic:
  382. license_key: null
  383. environment_name: <%= deployment_name %>
  384. ccng: *cc
  385. login:
  386. enabled: false
  387. uaa:
  388. url: <%= protocol %>://uaa.<%= root_domain %>
  389. no_ssl: <%= protocol == ‘http‘ %>
  390. cc:
  391. client_secret: <%= common_password %>
  392. admin:
  393. client_secret: <%= common_password %>
  394. batch:
  395. username: batch
  396. password: <%= common_password %>
  397. clients:
  398. cf:
  399. override: true
  400. authorized-grant-types: password,implicit,refresh_token
  401. authorities: uaa.none
  402. scope: cloud_controller.read,cloud_controller.write,openid,password.write,cloud_controller.admin,scim.read,scim.write
  403. access-token-validity: 7200
  404. refresh-token-validity: 1209600
  405. admin:
  406. secret: <%= common_password %>
  407. authorized-grant-types: client_credentials
  408. authorities: clients.read,clients.write,clients.secret,password.write,scim.read,uaa.admin
  409. scim:
  410. users:
  411. - admin|<%= common_password %>|scim.write,scim.read,openid,cloud_controller.admin,uaa.admin,password.write
  412. - services|<%= common_password %>|scim.write,scim.read,openid,cloud_controller.admin
  413. jwt:
  414. signing_key: |
  415. -----BEGIN RSA PRIVATE KEY-----
  416. REPLACE+ME+WITH+A+REAL+RSA+PRIVATE+KEY+++++++++++++asdfghj123122
  417. 123456789+++++REPLACE+ME+WITH+A+REAL+RSA+PRIVATE+KEY++++++++++++
  418. asd34++123456789+++++REPLACE+ME+WITH+A+REAL+RSA+PRIVATE+KEY+++++
  419. KVy7psa8xzElSyzqx7oJyfJ1JZyOzToj9T5SfTIq396agbHJWVfYphNahvZ/7uMX
  420. sdfvsdfgvKVy7psALKSFOa8xzElSyzqx7oJyfJ1JZyOzToj9T5SfTIq396agbHJW
  421. VfYphNahvZ/7uMXKVy7psa8xzElSyzqx7oJyfJ1JZyOO:9T5SfTIq396agbHJWVf
  422. YphNasvZ/7uMXFzqx7oJyfJ1JZyOzToj9T5SfTIq396agbHJWVfYphNahvZ/7uMX
  423. sedfsyzqx7oJyfJ1JZyOzToj9TDASWDASD5SfTIq396agbHJWVfYphNahvZ/7uMX
  424. -----END RSA PRIVATE KEY-----
  425. verification_key: |
  426. -----BEGIN PUBLIC KEY-----
  427. REPLACE+ME+WITH+A+VALID+PUBLIC+KEY++++++++++MIGfMA0GCSqGSIb3DQEBAQUA
  428. AASAqHxf+ZH9BL1gk9Y6kCnbM5R60gfwjyW1/dQPjOzn9N394zd2FJoFHwdq9Qs0wBug
  429. BUGBUGspULZVNRxq7veq/fzwIDAQAB
  430. -----END PUBLIC KEY-----

其中REPLACE-DIRECTOR_UUID为Bosh Director的UUID,

[python] view plaincopy

  1. # bosh status
  2. Config
  3. /root/.bosh_config
  4. Director
  5. Name       microbosh-openstack
  6. URL        https://172.24.4.227:25555
  7. Version    1.2652.0 (00000000)
  8. User       admin
  9. UUID       04fd1b77-9522-459e-8f56-bfe83b7c5624
  10. CPI        openstack
  11. dns        enabled (domain_name: microbosh)
  12. compiled_package_cache disabled
  13. snapshots  disabled
  14. Deployment
  15. Manifest   /root/bosh/bosh-workspace/deployments/cf/demo.yml
  16. REPLACE-IP-ADDRESS是预先分配好的floating ip
  17. # nova floating-ip-create public

root_domain是部署CloudFoundry使用的域名,部署CloudFoundry必须有一个通配符域名(Wildcard DNS record),例如, 如果使用的域名为example.com,那么example.com和*.example.com都要解析为同一IP地址,即前面申请的floating ip。 如果没有这样的域名,可以试一下xip.io提供的动态域名,它可以把<ip>.xip.io和*.<ip>.xip.io都解析为<ip>, 例如,login.111.222.111.222.xip.io会被解析为111.222.111.222

在部署CloudFoundry过程中,需要设置很多密码,例如访问各个虚拟机,CloudFoundry默认的管理员账户等,在此例中,同一设置为common_password。在生产环境中,比较合理的做法是设置为不同的密码。

4.4 部署CloudFoundry

[python] view plaincopy

  1. # bosh deployment cf/demo.yml
  2. # bosh deploy

4.5 部署完成后,可以使用如下命令查看各个虚拟机运行状况

[python] view plaincopy

  1. # bosh vms
时间: 2024-11-05 12:10:36

开源的PaaS方案:在OpenStack上部署CloudFoundry (四)使用Micro Bosh部署CloudFoundry的相关文章

开源的PaaS方案:在OpenStack上部署CloudFoundry (二)部署OpenStack

硬件要求 安装OpenStack 1 安装CentOS 65系统并清空iptables防火墙规则 2 安装系统需要的工具包包括Openstack依赖的和CloudFoundry依赖的 3 安装EPEL repo 4 Upgrade 当前系统 5 安装openstack repo 目前CloudFoundry最高只能支持Havana版的Openstack 6 安装packstack 7 同步时间 8 安装单节点openstack 配置Openstack 0 安装后的Openstack Dashbo

开源的PaaS方案:在OpenStack上部署CloudFoundry (一)简介

目录(?)[-] OpenStack简介 OpenStack是一个美国国家航空航天局和Rackspace合作研发的以Apache许可证授权并且是一个自由软件和开放源代码项目 OpenStack是一个云平台管理的项目它不是一个软件这个项目由几个主要的组件组合起来完成一些具体的工作 CloudFoundry简介 PaaS(Platform as a Service)是业界一个比较热门的话题.本文以简洁的方式介绍一种完全使用开源软件迅速部署一个PaaS平台的技术方案:基于OpenStack平台部署Cl

开源的PaaS方案:在OpenStack上部署CloudFoundry (三)部署BOSH

BOSH是CloudFoundry提供的用来安装部署和升级CloudFoundry的自动化工具,可是说是CloudFoundry的一部分.总体来说,BOSH是Client/Server结构, BOSH客户端称作BOSH CLI,BOSH服务器端由BOSH Director,NATS,HealthMonitor等组件组成, 详见http://docs.cloudfoundry.org/bosh/ 完整的BOSH是一个分布式的环境,本文为了简化BOSH的安装,将BOSH所有的组件安装在一个虚拟机上,

开源的PaaS方案:在OpenStack上部署CloudFoundry (五)常见问题

部署CloudFoundry可能遇到的问题 1. Bosh 报告 OpenStack API Request Entity Too Large error 解决办法,修改/etc/nova/api-paste.conf文件,添加limits属性 [python] view plaincopy [filter:ratelimit] paste.filter_factory = nova.api.openstack.compute.limits:RateLimitingMiddleware.fact

Exchange2013与Office365做Exchange Online混合部署(四)之混合部署(下)

接上文,我们在正确选择完公网证书之后,继续混合部署的配置 9. 输入完整的外发FQDN BTW:大家在这一步可以看到一个叫做 Exchange Online Protection(FOPE)服务路由的概念,这个东西是微软Office365提供给Exchange Online用户的一个免费的反垃圾邮件的智能路由网关设备,可以大量高效的拦截垃圾邮件,效果相当不错,这一点大家可以在今后的工作中感受一下,效果甚至好过现在主流的类似梭子鱼.赛门.趋势产品.当然了,这些产品的管理审核功能是FOPE无法自定义

[转载] 一共81个,开源大数据处理工具汇总(上)

原文: http://www.36dsj.com/archives/24852 本文一共分为上下两部分.我们将针对大数据开源工具不同的用处来进行分类,并且附上了官网和部分下载链接,希望能给做大数据的朋友做个参考.下面是第一部分. 查询引擎 一.Phoenix 贡献者::Salesforce 简介:这是一个Java中间层,可以让开发者在Apache HBase上执行SQL查询.Phoenix完全使用Java编写,代码位于GitHub上,并且提供了一个客户端可嵌入的JDBC驱动. Phoenix查询

部署OpenStack问题汇总(四)--openstack中nova-compute状态status显示为&#39;XXX&#39;的问题

第一次部署openstack的时候就遇见了这个问题,当时的版本是havana, 现在部署essex的时候又遇到了这个问题,经过一番折腾,解决了这个问题,记录下来,以免以后忘记. =========================================================== 1.查看/var/log/nova/nova-compute.log文件其中出现了这样的情况: Domain not found: no domain with matching name 'insta

openstack swift 源码分析之swift单机部署

本文对在单机部署swift 其中每一个细节做详细的介绍,并对配置做相应的解释 PC物理机    Ubuntu-12.04-desktop-64位 Swift 版本:1.13.1 Swift-client   1.2.0 注意:本文所有操作都是在root权限下进行的. 1 .下载swift 和swift-client 源代码,本文利用git从github获取其源代码 获取swift源代码 git clone https://github.com/openstack/swift.git 获取pyth

开源框架】Android之史上最全最简单最有用的第三方开源库收集整理,有助于快速开发

[原][开源框架]Android之史上最全最简单最有用的第三方开源库收集整理,有助于快速开发,欢迎各位... 时间 2015-01-05 10:08:18 我是程序猿,我为自己代言 原文  http://blog.csdn.net/caoyouxing/article/details/42418591 主题 开源 安卓开发 http://www.tuicool.com/articles/jyA3MrU Android开源库 自己一直很喜欢Android开发,就如博客签名一样, 我是程序猿,我为自