{"id":27189,"date":"2014-02-06T19:39:32","date_gmt":"2014-02-06T11:39:32","guid":{"rendered":"http:\/\/www.yankay.com\/?p=27189"},"modified":"2021-03-28T20:03:08","modified_gmt":"2021-03-28T12:03:08","slug":"cloudfoundry-v2-with-microcf","status":"publish","type":"post","link":"http:\/\/yankay.com\/cloudfoundry-v2-with-microcf\/","title":{"rendered":"CloudFoundry v2\u9762\u9762\u8c08\uff0c\u5185\u8d60MicroCFv2\u798f\u5229"},"content":{"rendered":"\n

<\/p>\n\n\n

CloudFoundry \u662f\u4e1a\u754c\u9886\u5148\u7684PaaS\u4e91\u5e73\u53f0\uff0c\u53ef\u4ee5\u4e3a\u5e94\u7528\u63d0\u4f9b\u8fd0\u884c\u5e73\u53f0\uff0c\u7c7b\u4f3c\u4e8e\u8fd0\u884c\u7740\u65e0\u6570\u5e94\u7528\u7684\u7099\u624b\u53ef\u70ed\u7684HeroKu\u3002\u6700\u8fd1\u53d1\u5e03\u7684\u7b2c\u4e8c\u4ee3\uff0c\u529f\u80fd\u4e0a\u6709\u4e86\u6781\u5927\u7684\u6269\u5145\uff0c\u5982BuildPack, Service Broker v2, loggregator\uff0c\u5e76\u4e14\u7528GoLang\u91cd\u5199\u4e86\u5927\u90e8\u5206\u7ec4\u4ef6\u63d0\u5347\u6027\u80fd\uff0c\u5982GoRouter,CLI,HM9000\u3002\u672c\u6587\u5e26\u60a8\u8d70\u8fdb\u8fd9\u4e2a\u5927\u89c2\u56ed\u3002\u8fd8\u63d0\u4f9b\u4e00\u4e2aMicroCFv2\u4e0b\u8f7d\uff0c\u6ee1\u8db3\u60a8\u8bd5\u4e00\u8bd5\u7684\u613f\u671b\uff0c\u53ea\u6b64\u4e00\u5bb6\u54e6\u3002<\/p>\n

\"\"<\/p>\n

CloudFoundry v1\u5df2\u7ecf\u51fa\u73b0\u8f83\u957f\u65f6\u95f4\uff0c\u5728\u4e09\u5e74\u524dEMC\u4e2d\u56fd\u7814\u7a76\u9662\u5c31\u53c2\u4e0e\u5176\u7814\u7a76\u3002\u5bf9CloudFoundry v1\u7684\u7814\u7a76\u53ef\u4ee5\u53c2\u89c1\u5f6d\u9e9f\u300a\u6df1\u5165 Cloud Foundry<\/a>\u300b\u3002\u5728CloudFoundry v2\u8bde\u751f\u524d\u7684\u4e09\u5e74\u91cc\uff0c\u4e00\u4e9b\u4e8b\u60c5\u53d1\u751f\u4e86\u5de8\u53d8\u3002\u5916\u90e8\u73af\u5883\u65b9\u9762\uff0cAWS\u8d70\u5411\u6210\u719f\uff0cHeroku\u9010\u6e10\u6210\u529f\uff0c\u6478\u7d22\u5230\u4e86PaaS\u6210\u529f\u7684\u9053\u8def\u3002OpenStack\u98ce\u8d77\u4e91\u6d8c\uff0cDocker\u5e26\u7740\u5c0f\u4f19\u4f34\u4eec\u5f02\u519b\u7a81\u8d77\u3002\u9762\u5bf9\u8fd9\u4e9b\uff0cCloudFoundry\u9762\u4e34\u7684\u7ade\u4e89\u52a0\u5267\uff0c\u4f46\u540c\u65f6\u4e5f\u6709\u4e86\u53ef\u4ee5\u914d\u5408\u7684\u4f19\u4f34\u3002\u800cCloudFoundry\u5185\u90e8\u4e5f\u53d1\u751f\u4e86\u53d8\u5316\uff0c\u539f\u5148\u96b6\u5c5e\u4e8e\u4e13\u653b\u865a\u62df\u5316\u7684VmWare\uff0c\u73b0\u5728\u4e0e\u65f6\u4ff1\u8fdb\uff0c\u6210\u4e3a\u4e86\u4e13\u653b\u5927\u6570\u636e\u7684Pivotal\u7684\u4e00\u90e8\u5206\u3002\u800cCloudFoundry v2\u662fCloudFoundry\u5f52\u4e8ePivotal\u7684\u7b2c\u4e00\u4e2a\u7248\u672c\uff0c\u6210\u4e3a\u8fd9\u5bb6\u5174\u65b0\u5927\u6570\u636e\u516c\u53f8\u7684\u6218\u7565\u4e00\u90e8\u5206\u3002<\/p>\n

\u5982\u679c\u60f3\u8bd5\u8bd5CloudFoundry\u516c\u6709\u4e91\uff0c\u53ef\u4ee5\u5728\u5b98\u7f51<\/a>\u4e0a\u7533\u8bf7\u8d26\u6237\u3002\u4e0b\u6587\u4e3b\u8981\u9488\u5bf9\u81ea\u5efaCloudFoundry\u3002<\/p>\n

\u65b0\u67b6\u6784<\/h2>\n

\u662f\u9aa1\u5b50\u662f\u9a6c\uff0c\u770b\u770b\u67b6\u6784\u5c31\u61c2\u4e86\u3002\u5728\u770b\u7b2c\u4e8c\u4ee3\u7684\u67b6\u6784\u4e4b\u524d\uff0c\u6211\u4eec\u56de\u987e\u4e00\u4e0b\u4e4b\u524d\u7684\u67b6\u6784\u3002<\/p>\n

\u7528\u6237\u901a\u8fc7VMC Client\u5c06\u5e94\u7528\u4e0a\u4f20\u5230Cloud Controller \u4e0a\uff0cCloud Controller\u5c06\u5e94\u7528\u90e8\u7f72\u5230DEA Pool\u4e0a\u9762\u3002\u7528\u6237\u53ef\u4ee5\u901a\u8fc7Router\u8bbf\u95ee\u5230\u5404\u81ea\u7684\u5e94\u7528\uff0cHealth Manager\u67e5\u770b\u5404\u4e2aAPP\u72b6\u6001\uff0c\u4fdd\u8bc1\u53ef\u4ee5\u81ea\u52a8\u91cd\u542f\u3002\u540c\u65f6Cloud Controller\u8fd8\u63d0\u4f9b\u4e86\u5404\u79cdServices\uff0c\u5982MySQL\uff0cRedis\u7b49\u7b49\u3002<\/p>\n

\u5728\u4e0a\u4e00\u4ee3\u67b6\u6784\u4e2d\uff0cCloudFoundry\u5448\u73b0\u51fa\u5927\u5305\u5927\u63fd\u7684\u65b9\u5f0f\uff0cAPP\u7684\u90e8\u7f72\u4e5f\u597d\uff0cService\u7684\u63d0\u4f9b\u4e5f\u597d\uff0c\u90fd\u81ea\u5df1\u505a\u3002\u867d\u7136\u6269\u5c55Runtime\u548cService\u5e76\u4e0d\u9ebb\u70e6\uff0c\u4f46\u662f\u8fd9\u9700\u8981\u201cCloudFoundry\u201d\u7ba1\u7406\u5458\u7684\u4ecb\u5165\uff0c\u79df\u6237\u662f\u6ca1\u6709\u529e\u6cd5\u505a\u8fd9\u4e9b\u7684\u3002\u53e6\u5916\u79c1\u6709\u4e91\u7684\u73a9\u5bb6\u5f80\u5f80\u90fd\u6709\u7740\u5b9a\u5236Runtime\u548cService\u7684\u9700\u6c42\uff0c\u5185\u7f6e\u7684Service\u5f88\u96be\u6ee1\u8db3\u9700\u8981\u3002\u5f53\u7136\u8fd8\u6709\u4e00\u4e9b\u95ee\u9898\uff0c\u5982Router\u6027\u80fd\u4e0d\u4f73\uff0c\u534f\u8bae\u532e\u4e4f\u3002Health Manager\u5355\u70b9\u3002<\/p>\n

\u5728\u65b0\u7684\u67b6\u6784\u4e2d\uff0cCloudFoundry\u6709\u7740\u66f4\u52a0\u5f00\u653e\u7684\u73a9\u6cd5\u3002<\/p>\n

\u7b2c\u4e8c\u4ee3CloudFoundry\u51e0\u4e4e\u5c06V1\u65f6\u4ee3\u7ec4\u4ef6\u5168\u90e8\u91cd\u5199\uff0c\u6ee1\u8db3\u65b0\u7684\u9700\u8981\u3002<\/p>\n

APP\u65b9\u9762\uff0c\u5728\u4e0a\u4f20\u5e94\u7528\u7684\u65f6\u5019\uff0c\u7528\u6237\u53ef\u4ee5\u540c\u65f6\u4e0a\u4f20\u4e00\u4e2aBuildPack\uff0c\u8fd9\u6837\u79df\u6237\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u8981\u6765\u90e8\u7f72\u5e94\u7528\uff0c\u65e0\u9700\u901a\u77e5\u4e91\u7ba1\u7406\u5458\u3002BuildPack\u662fHeroku\u7684\u90e8\u7f72\u673a\u5236\uff0c\u5728\u793e\u533a\u6709\u7740\u4e30\u5bcc\u7684\u8d44\u6e90\u3002\u56e0\u6b64CloudFoundry\u548cHeroku\u662f\u517c\u5bb9\u7684\u3002\u53ef\u4ee5\u90e8\u7f72\u5728Heroku\u4e0a\u7684\u5e94\u7528\uff0c\u4e5f\u53ef\u4ee5\u90e8\u7f72\u5728CloudFoundry\u4e0a\u3002\u8fd8\u6709\u5f88\u591a\u5176\u4ed6PaaS\u4e5f\u4f7f\u7528BuildPack\uff0cBuildPack\u5df2\u7ecf\u6210\u4e3aPaaS\u5e94\u7528\u90e8\u7f72\u7684\u4e8b\u5b9e\u6807\u51c6\u3002<\/p>\n

Serivce\u65b9\u9762\uff0c\u4e0d\u518d\u5185\u5efaService\uff0c\u800c\u662f\u4f7f\u7528\u4e00\u4e2a\u66f4\u52a0\u7b80\u6d01\u7684Service Broker\u548cUser Provided Service\u8bbe\u8ba1\u3002\u7528\u6237\u53ef\u4ee5\u5c06Service Broker\u4f7f\u7528\u73b0\u6709\u7684XaaS\u4e0a\u9762\uff0c\u5982\u679cOpenStack Trove, AWS RDS\u3002Heroku \u6709\u5f88\u591a\u5c0f\u4f19\u4f34\u4eec<\/a>\u00a0\u53ef\u4ee5\u63d0\u4f9b\u5404\u79cd\u5404\u6837\u7684Service\uff0c\u6bd4\u5982\u76d1\u63a7\u670d\u52a1Relic,\u56fd\u5185\u4e5f\u6709\u5f88\u591a\uff0c\u5982\u76d1\u63a7\u5b9d\u3002GAE\u5f0f\u7684PaaS\u8bc1\u660e\u5173\u95e8\u73a9Service\u662f\u4e0d\u884c\u7684\uff0cCloudFoundry\u8d70\u5411\u4e86\u5f00\u653e\u7684\u9053\u8def\u3002\u53e6\u5916User Provided Service\u53ef\u4ee5\u8ba9\u63a5\u4e0a\u7528\u6237\u73b0\u6709\u670d\u52a1\uff0c\u5982Oracle\uff0c\u4fdd\u62a4\u73b0\u6709\u8d44\u4ea7\u3002<\/p>\n

\u5927\u6570\u636e\u6df1\u5165\u4eba\u5fc3\uff0cCloudFoundry\u73b0\u5728\u7684loggregator\u53ef\u4ee5\u8ba9\u5e94\u7528\u7684\u65e5\u5b50\u6d41\u8fdbService\u4e2d\u3002\u5b9e\u65f6\u6570\u636e\u5206\u6790\u6210\u4e3a\u53ef\u80fd\u3002<\/p>\n

\u65b0\u7684\u7684CloudFoundry\u5bf9\u8fd0\u884c\u5728IaaS\u6709\u7740\u5929\u751f\u7684\u4eb2\u548c\u529b\u3002BOSH\u53ef\u4ee5\u975e\u5e38\u65b9\u4fbf\u7684\u90e8\u7f72CF\u3002Router\u7684\u6027\u80fd\u74f6\u9888\u5f97\u5230\u89e3\u51b3\u3002UAA\u53ef\u4ee5\u63d0\u4f9b\u7b2c\u4e09\u65b9\u8ba4\u8bc1\u3002Health Manager\u4e5f\u4e0d\u518d\u662f\u5355\u70b9\u3002<\/p>\n

\u5f00\u653e\u7684App Runtime<\/h2>\n

\u5f00\u653e\u7684App Runtime\u7684\u529b\u91cf\u6765\u81ea\u5982Build Pack\u3002\u6211\u4eec\u53ef\u4ee5\u6d4f\u89c8\u5148App \u90e8\u7f72\u7684\u5168\u8fc7\u7a0b\u3002<\/p>\n

\u00a0<\/p>\n

    \n
  1. \u7528\u6237\u4f7f\u7528\u4f7f\u7528CF PUSH\u547d\u4ee4\u4e0a\u4f20\u5e94\u7528<\/li>\n
  2. CLI\u544a\u77e5CCNG\u521b\u5efa\u4e00\u4e2a\u5e94\u7528<\/li>\n
  3. CCNG\u5728\u6570\u636e\u5e93\u4e2d\u52a0\u5165\u8be5\u5e94\u7528\u7684\u8bb0\u5f55\u4f8b\u5982\u5e94\u7528\u540d\u79f0\uff0cBuildPack\u9009\u62e9<\/li>\n
  4. CLI\u4e0a\u4f20\u7a0b\u5e8f<\/li>\n
  5. CCNG\u5c06\u7a0b\u5e8f\u5b58\u8d77\u6765<\/li>\n
  6. CLI\u542f\u52a8\u5e94\u7528<\/li>\n
  7. \u7531\u4e8e\u5e94\u7528\u5c1a\u672a\u90e8\u7f72\uff0c\u6240\u4ee5CCNG\u627e\u4e00\u53f0DEA\uff0c\u5728\u8be5DEA\u5185\u6267\u884cBuildPack\u6765\u90e8\u7f72\u5e94\u7528<\/li>\n
  8. DEA\u8f93\u51fa\u8fd0\u884cBuildPack\u7684\u4fe1\u606f<\/li>\n
  9. BuildPack\u6267\u884c\u5b8c\u6bd5\uff0c\u8f93\u51fa\u662f\u4e00\u4e2aDropLet\u6587\u4ef6(\u7f16\u8bd1\u6253\u5305\u7684\u7ed3\u679c)\uff0cDEA\u5c06\u8be5\u6587\u4ef6\u5b58\u8d77\u6765<\/li>\n
  10. DEA\u5c06\u6253\u5305\u60c5\u51b5\u6c47\u62a5\u7ed9CCNG<\/li>\n
  11. CCNG\u9009\u62e9\u4e00\u4e2aDEA\u6765\u90e8\u7f72\u5e94\u7528<\/li>\n
  12. \u5e94\u7528\u5728DEA\u4e2d\u8fd0\u884c\uff0c\u8fd0\u884c\u7ed3\u679c\u8f93\u51fa\u5230CCNG<\/li>\n<\/ol>\n

    \u53ef\u4ee5\u770b\u5230\uff0cBuildPack\u548cAPP\u4e00\u6837\u90fd\u662f\u5728\u4e00\u6837\u7684\u73af\u5883(DEA)\u4e2d\u6267\u884c\u7684\u3002BuildPack\u975e\u5e38\u7b80\u6d01\uff0c\u53ea\u9700\u8981\u4e09\u4e2a\u811a\u672c\u3002<\/p>\n