{"id":23790,"date":"2022-11-15T01:46:29","date_gmt":"2022-11-14T17:46:29","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=23790"},"modified":"2022-11-15T01:46:38","modified_gmt":"2022-11-14T17:46:38","slug":"docker-kubernetes-with-mangdb","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/docker-kubernetes-with-mangdb.html","title":{"rendered":"\u5728Docker\u548cKubernetes\u4e0a\u8fd0\u884cMongoDB\u5fae\u670d\u52a1"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nDocker \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5e94\u7528\u5bb9\u5668\u5f15\u64ce\uff0c\u8ba9\u5f00\u53d1\u8005\u53ef\u4ee5\u6253\u5305\u4ed6\u4eec\u7684\u5e94\u7528\u4ee5\u53ca\u4f9d\u8d56\u5305\u5230\u4e00\u4e2a\u53ef\u79fb\u690d\u7684\u5bb9\u5668\u4e2d\uff0c\u7136\u540e\u53d1\u5e03\u5230\u4efb\u4f55\u6d41\u884c\u7684 Linux \u673a\u5668\u4e0a\uff0c\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u865a\u62df\u5316\u3002\u5bb9\u5668\u662f\u5b8c\u5168\u4f7f\u7528\u6c99\u7bb1\u673a\u5236\uff0c\u76f8\u4e92\u4e4b\u95f4\u4e0d\u4f1a\u6709\u4efb\u4f55\u63a5\u53e3\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u00a0\"\u5728Docker\u548cKubernetes\u4e0a\u8fd0\u884cMongoDB\u5fae\u670d\u52a1\"<\/a><\/p>\n

\u672c\u6587\u4ecb\u7ecd\u4e86\u5229\u7528Docker\u548cKubernetes\u642d\u5efa\u4e00\u5957\u5177\u6709\u5197\u4f59\u5907\u4efd\u96c6\u5408\u7684MongoDB\u670d\u52a1\uff0c\u4ece\u5bb9\u5668\u5bf9CI\u548cCD\u5f15\u53d1\u7684\u6539\u53d8\u5165\u624b\uff0c\u8ba8\u8bba\u4e86\u5bb9\u5668\u6280\u672f\u5bf9MongoDB\u5e26\u6765\u7684\u6311\u6218\u548c\u673a\u4f1a\uff0c\u7136\u540e\u5b9e\u6218\u5982\u4f55\u90e8\u7f72\u4e00\u5957\u7a33\u5b9a\u7684MongoDB\u670d\u52a1\uff0c\u975e\u5e38\u7684\u5e72\u8d27~<\/p>\n

\u4ecb\u7ecd<\/strong><\/div>\n

\u60f3\u5c1d\u8bd5\u5728\u7b14\u8bb0\u672c\u7535\u8111\u4e0a\u8fd0\u884cMongoDB\u4e48?\u5e0c\u671b\u901a\u8fc7\u6267\u884c\u4e00\u4e2a\u7b80\u5355\u7684\u547d\u4ee4\uff0c\u7136\u540e\u5c31\u6709\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u3001\u81ea\u7ec4\u7ec7\u7684\u6c99\u76d2\u4e48?\u5e76\u53ef\u518d\u901a\u8fc7\u4e00\u6761\u547d\u4ee4\u5c31\u53ef\u4ee5\u79fb\u9664\u6240\u6709\u7684\u75d5\u8ff9\u4e48?<\/p>\n

\u9700\u8981\u5728\u591a\u4e2a\u73af\u5883\u4e2d\u8fd0\u884c\u76f8\u540c\u7684\u5e94\u7528\u7a0b\u5e8f\u6808?\u521b\u5efa\u81ea\u5df1\u7684\u5bb9\u5668\u955c\u50cf\uff0c\u4f7f\u5f97\u5f00\u53d1\u3001\u6d4b\u8bd5\u3001\u64cd\u4f5c\u548c\u652f\u6301\u56e2\u961f\u542f\u52a8\u4e00\u4efd\u5b8c\u5168\u76f8\u540c\u7684\u73af\u5883\u3002
\n\u5bb9\u5668\u6b63\u5728\u6539\u53d8\u6574\u4e2a\u8f6f\u4ef6\u751f\u547d\u5468\u671f;\u5b83\u8986\u76d6\u4e86\u4ece\u6700\u521d\u7684\u6280\u672f\u8bd5\u9a8c\u5230\u901a\u8fc7\u5f00\u53d1\u3001\u6d4b\u8bd5\u3001\u90e8\u7f72\u548c\u652f\u6301\u7684\u6982\u5ff5\u8bc1\u660e\u3002
\n\u9605\u8bfb\u5fae\u670d\u52a1\uff1a\u5bb9\u5668\u548c\u7f16\u6392\u767d\u76ae\u4e66(https:\/\/www.mongodb.com\/collateral\/microservices-containers-and-orchestration-explained)\u3002<\/p>\n

\u7f16\u6392\u5de5\u5177\u7ba1\u7406\u7740\u591a\u4e2a\u5bb9\u5668\u5982\u4f55\u521b\u5efa\u3001\u5347\u7ea7\u548c\u9ad8\u53ef\u7528\u3002\u7f16\u6392\u540c\u6837\u7ba1\u7406\u7740\u5bb9\u5668\u5982\u4f55\u8fde\u63a5\uff0c\u5e76\u5229\u7528\u591a\u4e2a\u5fae\u670d\u52a1\u5bb9\u5668\u521b\u5efa\u7a33\u5b9a\u7684\u5e94\u7528\u670d\u52a1\u3002
\n\u4e30\u5bcc\u7684\u529f\u80fd\u3001\u7b80\u5355\u7684\u5de5\u5177\u3001\u5f3a\u5927\u7684API\u8ba9\u5bb9\u5668\u548c\u7f16\u6392\u5f97\u5230DevOps\u56e2\u961f\u7684\u9752\u7750\u3002DevOps\u5de5\u7a0b\u5e08\u5c06\u5b83\u4eec\u6574\u5408\u5230\u6301\u7eed\u96c6\u6210(CI)\u548c\u6301\u7eed\u4ea4\u4ed8(CD)\u5de5\u4f5c\u6d41\u4e2d\u3002<\/p>\n

\u672c\u7bc7\u6587\u7ae0\u5c06\u63a2\u7d22\u5728\u5c1d\u8bd5\u8fd0\u884c\u548c\u7f16\u6392MongoDB\u5bb9\u5668\u65f6\u9047\u5230\u7684\u95ee\u9898\uff0c\u5e76\u63cf\u8ff0\u5982\u4f55\u514b\u670d\u8fd9\u4e9b\u95ee\u9898\u3002<\/p>\n

\u5bf9\u4e8eMongoDB\u7684\u601d\u8003<\/strong><\/div>\n

\u91c7\u7528\u5bb9\u5668\u548c\u7f16\u6392\u8fd0\u884cMongoDB\u5e26\u6765\u4e86\u4e00\u4e9b\u65b0\u7684\u601d\u8003\uff1a
\nMongoDB\u6570\u636e\u5e93\u8282\u70b9\u662f\u6709\u72b6\u6001\u7684\u3002\u82e5\u4e00\u4e2a\u5bb9\u5668\u6302\u4e86\uff0c\u5e76\u4e14\u88ab\u91cd\u65b0\u7f16\u6392\uff0c\u6570\u636e\u4e22\u5931\u662f\u4e0d\u80fd\u63a5\u53d7\u7684(\u867d\u7136\u5b83\u53ef\u4ee5\u4ece\u5176\u4ed6\u8282\u70b9\u4e2d\u6062\u590d\u6570\u636e\uff0c\u4f46\u662f\u5f88\u8d39\u65f6)\u3002\u4e3a\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0cKubernetes\u4e2d\u7684\u5377\u62bd\u8c61(Volume abstraction)\u7279\u6027\u5c06\u7528\u4e8e\u6620\u5c04MongoDB\u6570\u636e\u6587\u4ef6\u5939\u5230\u4e00\u4e2a\u6301\u4e45\u5316\u5730\u5740\uff0c\u907f\u514d\u5bb9\u5668\u7684\u5931\u8d25\u6216\u91cd\u7f16\u6392\u3002<\/p>\n

\u540c\u4e00\u7ec4MongoDB\u6570\u636e\u5e93\u5907\u4efd\u8282\u70b9\u4e4b\u95f4\u9700\u8981\u901a\u4fe1\uff0c\u5373\u4f7f\u662f\u5728\u91cd\u7f16\u6392\u4e4b\u540e\u3002\u540c\u4e00\u5197\u4f59\u5907\u4efd\u96c6\u5408\u7684\u8282\u70b9\u5fc5\u987b\u77e5\u9053\u5168\u90e8\u5176\u4ed6\u8282\u70b9\u7684\u5730\u5740\uff0c\u4f46\u662f\u5f53\u67d0\u4e2a\u5bb9\u5668\u91cd\u7f16\u6392\u4e4b\u540e\uff0c\u5b83\u7684IP\u5730\u5740\u4f1a\u53d8\u5316\u3002\u4f8b\u5982\uff0c\u6240\u6709Kubernetes\u5185\u7684\u5bb9\u5668\u5171\u4eab\u4e00\u4e2aIP\u5730\u5740\uff0c\u5f53pod\u88ab\u91cd\u7f16\u6392\u4e4b\u540e\u8fd9\u4e2a\u5730\u5740\u5c31\u4f1a\u6539\u53d8\u3002\u5728Kubernetes\u4e2d\uff0c\u8fd9\u4e2a\u95ee\u9898\u53ef\u4ee5\u901a\u8fc7\u8054\u7cfbKubernetes\u670d\u52a1\u4e0eMongoDB\u8282\u70b9\u6765\u89e3\u51b3\uff0c\u91c7\u7528Kubernetes\u7684DNS\u670d\u52a1\u63d0\u4f9b\u4e3b\u673a\u540d\u7ed9\u91cd\u7f16\u6392\u4e4b\u540e\u7684\u670d\u52a1\u3002<\/p>\n

\u4e00\u65e6\u6bcf\u4e2a\u72ec\u7acb\u7684MongoDB\u8282\u70b9(\u6bcf\u4e2a\u8282\u70b9\u5728\u5355\u72ec\u5bb9\u5668\u4e2d)\u542f\u52a8\u8d77\u6765\uff0c\u5907\u4efd\u96c6\u5408\u5fc5\u987b\u521d\u59cb\u5316\uff0c\u5e76\u628a\u6bcf\u4e2a\u8282\u70b9\u52a0\u5165\u8fdb\u6765\u3002\u8fd9\u9700\u8981\u7f16\u6392\u5de5\u5177\u63d0\u4f9b\u989d\u5916\u7684\u903b\u8f91\u3002\u7279\u522b\u662f\u5907\u4efd\u96c6\u5408\u4e2d\u53ea\u6709\u4e00\u4e2aMongoDB\u8282\u70b9\u65f6\uff0c\u5fc5\u987b\u6267\u884crs.initiate\u548crs.add\u547d\u4ee4\u3002
\n\u5982\u679c\u7f16\u6392\u6846\u67b6\u63d0\u4f9b\u81ea\u52a8\u5316\u91cd\u7f16\u6392\u5bb9\u5668\u529f\u80fd(\u5982Kubernetes\u7684\u7279\u6027)\uff0c\u90a3\u4e48\u8fd9\u53ef\u4ee5\u63d0\u9ad8MongoDB\u7684\u5bb9\u707e\u6027\uff0c\u8282\u70b9\u4f1a\u5728\u6302\u6389\u4e4b\u540e\u81ea\u52a8\u91cd\u65b0\u521b\u5efa\uff0c\u6062\u590d\u5230\u5b8c\u6574\u5197\u4f59\u6c34\u5e73\u4e14\u4e0d\u9700\u8981\u4eba\u5de5\u5e72\u9884\u3002<\/p>\n

\u5f53\u7f16\u6392\u6846\u67b6\u638c\u63a7\u6240\u6709\u5bb9\u5668\u7684\u72b6\u6001\u65f6\uff0c\u5b83\u5e76\u4e0d\u7ba1\u7406\u5bb9\u5668\u5185\u7684\u5e94\u7528\u6216\u8005\u5907\u4efd\u6570\u636e\u3002\u8fd9\u5c31\u610f\u5473\u7740\u91c7\u7528\u4e00\u4e2a\u6709\u6548\u7684\u7ba1\u7406\u548c\u5907\u4efd\u65b9\u6848\u5f88\u91cd\u8981\uff0c\u5982MongoDB Cloud Manager\uff0c\u5305\u62ecMongoDB Enterprise Advanced\u548cMongoDB Professional\u4e24\u90e8\u5206\u3002\u8003\u8651\u5230\u9700\u8981\u521b\u5efa\u955c\u50cf\uff0c\u53ef\u91c7\u7528\u4f60\u503e\u5411\u7684MongoDB\u7248\u672c\u548cMongoDB Automation Agent\u3002<\/p>\n

\u5229\u7528Docker\u548cKubernetes\u5b9e\u73b0MongoDB\u5197\u4f59\u5907\u4efd<\/strong><\/div>\n

\u5982\u524d\u4e00\u8282\u6240\u8ff0\uff0cMongoDB\u8fd9\u7c7b\u5206\u5e03\u5f0f\u6570\u636e\u5e93\u5728\u5229\u7528\u7f16\u6392\u6846\u67b6(\u5982Kubernetes)\u8fdb\u884c\u90e8\u7f72\u65f6\u9700\u8981\u989d\u5916\u8003\u8651\u3002\u672c\u8282\u5c06\u5bf9\u8fd9\u90e8\u5206\u7ec6\u8282\u8fdb\u884c\u5206\u6790\uff0c\u5e76\u4ecb\u7ecd\u5982\u4f55\u5b9e\u73b0\u3002<\/p>\n

\u9996\u5148\uff0c\u6211\u4eec\u5728\u4e00\u4e2a\u5355\u72ec\u7684Kubernetes\u96c6\u7fa4(\u540c\u4e00\u4e2a\u6570\u636e\u4e2d\u5fc3\u5185\uff0c\u5e76\u4e0d\u5b58\u5728\u7269\u7406\u4e0a\u7684\u5197\u4f59\u5907\u4efd)\u4e2d\u521b\u5efa\u6574\u4e2aMongoDB\u5197\u4f59\u96c6\u5408\u3002\u5982\u679c\u8de8\u591a\u4e2a\u6570\u636e\u4e2d\u5fc3\u8fdb\u884c\u521b\u5efa\uff0c\u5176\u6b65\u9aa4\u4e5f\u5dee\u5f02\u4e0d\u5927\uff0c\u540e\u7eed\u5c06\u4f1a\u4ecb\u7ecd\u3002
\n\u5907\u4efd\u4e2d\u7684\u6bcf\u4e2a\u6210\u5458\u90fd\u8fd0\u884c\u5728\u72ec\u81ea\u7684pod\u4e2d\uff0c\u53ea\u66b4\u9732\u5176IP\u5730\u5740\u548c\u7aef\u53e3\u3002\u56fa\u5b9a\u7684IP\u5730\u5740\u5bf9\u4e8e\u5916\u90e8\u5e94\u7528\u548c\u5176\u4ed6\u5197\u4f59\u5907\u4efd\u8282\u70b9\u975e\u5e38\u91cd\u8981\uff0c\u5b83\u51b3\u5b9a\u4e86\u54ea\u4e9bpod\u5c06\u88ab\u91cd\u65b0\u90e8\u7f72\u3002<\/p>\n

\u4e0b\u56fe\u5c55\u793a\u4e86\u5176\u4e2d\u4e00\u4e2apod\u4e0e\u5173\u8054\u7684\u5197\u4f59\u63a7\u5236\u5668\u548c\u670d\u52a1\u7684\u5173\u7cfb\u3002<\/p>\n

\"\u5728Docker\u548cKubernetes\u4e0a\u8fd0\u884cMongoDB\u5fae\u670d\u52a1\"<\/a><\/p>\n

\u6df1\u5165\u8fd9\u4e9b\u914d\u7f6e\u4e2d\u63cf\u8ff0\u7684\u8d44\u6e90\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n

\n

\u542f\u52a8\u6838\u5fc3\u8282\u70b9mongo-node1\uff0c\u8be5\u8282\u70b9\u5305\u62ec\u4e86\u4e00\u4e2a\u53eb\u505a\u7684mongo\u7684\u955c\u50cf\uff0c\u6765\u6e90\u4e8eDocker Hub\uff0c\u5176\u66b4\u973227107\u7aef\u53e3\u3002
\nKubernetes\u7684\u5377\u7279\u6027\u7528\u4e8e\u6620\u5c04\/data\/db\u6587\u4ef6\u5939\u5230\u6301\u4e45\u5316\u76ee\u5f55mongo-persistent-storage1;\u8be5\u76ee\u5f55\u4e3aGoogle Cloud\u4e0a\u521b\u5efa\u7684\u76ee\u5f55\u6620\u5c04mongodb-disk1\uff0c\u7528\u4e8e\u6301\u4e45\u5316MongoDB\u7684\u6570\u636e\u3002
\n\u5bb9\u5668\u7531pod\u8fdb\u884c\u7ba1\u7406\uff0c\u6807\u8bb0\u4e3amongo-node\uff0c\u540c\u65f6\u5bf9rod\u63d0\u4f9b\u4e00\u4e2a\u968f\u673a\u751f\u6210\u7684\u540d\u5b57\u3002
\n\u5197\u4f59\u63a7\u5236\u5668\u547d\u540d\u4e3amongo-rc1\uff0c\u7528\u4e8e\u786e\u4fddmongo-node1\u7684\u5b9e\u4f8b\u4e00\u76f4\u5904\u4e8e\u8fd0\u884c\u4e2d\u3002
\n\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u547d\u540d\u4e3amongo-svc-a\u752827017\u66b4\u9732\u7aef\u53e3\u3002\u8be5\u670d\u52a1\u901a\u8fc7pod\u7684\u6807\u7b7e\u5339\u914d\u6b63\u786e\u7684\u670d\u52a1\u5230\u5bf9\u5e94\u7684pod\u4e0a\uff0c\u5bf9\u5916\u66b4\u9732\u7684ip\u548c\u7aef\u53e3\u7ed9\u5e94\u7528\u7a0b\u5e8f\u4f7f\u7528\uff0c\u540c\u65f6\u7528\u4e8e\u5197\u4f59\u5907\u4efd\u96c6\u5408\u4e2d\u5404\u8282\u70b9\u7684\u901a\u4fe1\u3002\u867d\u7136\u6bcf\u4e2a\u5bb9\u5668\u62e5\u6709\u5185\u90e8ip\uff0c\u4f46\u662f\u5f53\u5bb9\u5668\u88ab\u91cd\u542f\u6216\u8005\u79fb\u52a8\u4e4b\u540e\u5b83\u4eec\u4f1a\u53d8\u66f4\uff0c\u56e0\u6b64\u4e0d\u80fd\u7528\u4e8e\u5197\u4f59\u5907\u4efd\u96c6\u5408\u4e4b\u95f4\u7684\u901a\u4fe1\u3002<\/p>\n<\/blockquote>\n

\u4e0b\u56fe\u5c55\u793a\u4e86\u5197\u4f59\u5907\u4efd\u53ca\u4e2d\u7684\u53e6\u4e00\u4e2a\u6210\u5458\u4fe1\u606f\uff1a<\/p>\n

\"\u5728Docker\u548cKubernetes\u4e0a\u8fd0\u884cMongoDB\u5fae\u670d\u52a1\"<\/a><\/p>\n

90%\u7684\u914d\u7f6e\u662f\u76f8\u540c\u7684\uff0c\u53ea\u6709\u51e0\u5904\u4e0d\u540c\uff1a<\/p>\n

\n

\u786c\u76d8\u548c\u5377\u7684\u540d\u5b57\u5fc5\u987b\u662f\u552f\u4e00\u7684\uff0c\u4e8e\u662f\u91c7\u7528mongodb-disk2\u548cmongo-persisitent-storage2
\nPod\u5206\u914d\u5230jane\u5b9e\u4f8b\uff0c\u540c\u65f6\u8282\u70b9\u547d\u540d\u4e3amongo-node2\uff0c\u7528\u4e8e\u533a\u5206\u65b0\u670d\u52a1\u4e0e\u56fe1\u4e2d\u7684Pod
\n\u5197\u4f59\u63a7\u5236\u547d\u540d\u4e3amongo-rc2
\n\u670d\u52a1\u547d\u540d\u4e3amongo-svc-b\uff0c\u5e76\u83b7\u53d6\u4e00\u4e2a\u4e0d\u540c\u7684\u5916\u90e8IP\u5730\u5740(\u672c\u4f8b\u5b50\u4e2d\uff0cKubernets\u5206\u914d\u4e3a104.1.4.5)<\/p>\n<\/blockquote>\n

\u7b2c\u4e09\u4e2a\u5197\u4f59\u5907\u4efd\u6210\u5458\u7684\u914d\u7f6e\u4eff\u7167\u4e0a\u8ff0\u7684\u6a21\u5f0f\u8fdb\u884c\uff0c\u4e0b\u56fe\u5c55\u793a\u4e86\u5b8c\u6574\u7684\u5197\u4f59\u914d\u7f6e\u96c6\u5408\uff1a<\/p>\n

\"\u5728Docker\u548cKubernetes\u4e0a\u8fd0\u884cMongoDB\u5fae\u670d\u52a1\"<\/a><\/p>\n

\u6ce8\u610f\uff0c\u5373\u4f7f\u914d\u7f6e\u5982\u56fe3\u4e00\u6837\uff0c\u5728\u4e00\u4e2a\u4e09\u4e2a\u6216\u8005\u591a\u4e2a\u8282\u70b9\u7684Kubernetes\u96c6\u7fa4\u4e0a\uff0cKubernetes\u53ef\u80fd\u4f1a\u8c03\u5ea6\u4e24\u4e2a\u6216\u8005\u591a\u4e2aMongoDB\u5197\u4f59\u5907\u4efd\u6210\u5458\u5728\u540c\u4e00\u4e2a\u5bbf\u4e3b\u673a\u4e0a\u3002\u8fd9\u662f\u56e0\u4e3aKubernetes\u5c06\u4e09\u4e2apod\u89c6\u4e3a\u4e09\u4e2a\u72ec\u7acb\u7684\u670d\u52a1\u3002<\/p>\n

\u4e3a\u4e86\u589e\u52a0\u5197\u4f59\uff0c\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u989d\u5916\u7684headless\u670d\u52a1\u3002\u8be5\u670d\u52a1\u4e0d\u5177\u5907\u63d0\u4f9b\u5916\u90e8\u670d\u52a1\u7684\u80fd\u529b\uff0c\u751a\u81f3\u6ca1\u6709\u5916\u90e8IP\u5730\u5740\uff0c\u4f46\u662f\u5b83\u7528\u4e8e\u901a\u77e5Kubernetes\u8fd9\u4e09\u4e2aMongoDB Pod\u662f\u5c5e\u4e8e\u540c\u4e00\u4e2a\u670d\u52a1\uff0c\u4e8e\u662fKubernetes\u4f1a\u5c06\u5b83\u4eec\u8c03\u5ea6\u5728\u4e0d\u540c\u7684\u8282\u70b9\u4e0a\u3002<\/p>\n

\"\u5728Docker\u548cKubernetes\u4e0a\u8fd0\u884cMongoDB\u5fae\u670d\u52a1\"<\/a><\/p>\n

\u5177\u4f53\u7684\u914d\u7f6e\u6587\u4ef6\u548c\u76f8\u5173\u64cd\u4f5c\u547d\u4ee4\u53ef\u4ee5\u4ece\u300a\u542f\u52a8\u5fae\u670d\u52a1\uff1a\u5bb9\u5668&\u8c03\u5ea6\u8bf4\u660e\u767d\u76ae\u4e66\u300b\u4e2d\u627e\u5230\u3002\u5176\u4e2d\u5305\u542b\u4e86\u4e09\u4e2a\u7279\u6b8a\u7684\u6b65\u9aa4\u786e\u4fdd\u5408\u5e76\u4e09\u4e2aMongoDB\u5230\u4e00\u4e2a\u529f\u80fd\u4e2d\uff0c\u5373\u672c\u6587\u4e2d\u63cf\u8ff0\u7684\u5197\u4f59\u5907\u4efd\u3002<\/p>\n

\u591a\u4e2a\u53ef\u7528\u533a\u57dfMongoDB\u5197\u4f59\u96c6\u5408<\/strong><\/div>\n

\u6240\u6709\u5197\u4f59\u90e8\u4ef6\u5747\u8fd0\u884c\u5728\u540c\u4e00\u4e2aGCE\u96c6\u7fa4\u4e0a\u65f6\u5177\u6709\u5f88\u9ad8\u7684\u98ce\u9669\uff0c\u5728\u540c\u4e00\u4e2azone\u7684\u96c6\u7fa4\u4e5f\u4e00\u6837\u3002\u5982\u679c\u53d1\u751f\u4e00\u4e2a\u91cd\u5927\u4e8b\u4ef6\u5bfc\u81f4\u53ef\u7528zone\u79bb\u7ebf\uff0c\u90a3\u4e48MongoDB\u5197\u4f59\u96c6\u5408\u4e5f\u5c31\u4e0d\u53ef\u7528\u3002\u5982\u679c\u9700\u8981\u5730\u7406\u4e0a\u7684\u5197\u4f59\u5907\u4efd\uff0c\u90a3\u4e48\u4e09\u4e2apod\u9700\u8981\u8fd0\u884c\u5728\u4e0d\u540c\u7684zone\u5185\u3002<\/p>\n

\u53ea\u9700\u8981\u5f88\u5c11\u7684\u6539\u52a8\u5c31\u53ef\u4ee5\u521b\u5efa\u8fd9\u6837\u4e00\u4e2a\u5197\u4f59\u5907\u4efd\u96c6\u5408\u3002\u6bcf\u4e00\u4e2a\u96c6\u7fa4\u9700\u8981\u72ec\u81ea\u7684Kubernetes YAML\u6587\u4ef6\u6765\u5b9a\u4e49pod\u3001\u5197\u4f59\u63a7\u5236\u5668\u548c\u670d\u52a1\u3002\u7136\u540e\uff0c\u5c31\u53ef\u4ee5\u5b8c\u6210\u4e00\u4e2azone\u7684\u96c6\u7fa4\u521b\u5efa\u3001\u6301\u4e45\u5316\u5b58\u50a8\u548cMongoDB\u8282\u70b9\u3002<\/p>\n

\u4e0b\u56fe\u5c55\u793a\u4e86\u8fd0\u884c\u5728\u4e0d\u540czone\u4e0a\u7684\u5197\u4f59\u7ed3\u5408\uff1a<\/p>\n

\"\u5728Docker\u548cKubernetes\u4e0a\u8fd0\u884cMongoDB\u5fae\u670d\u52a1\"<\/a><\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/os.51cto.com\/art\/201607\/515108.htm<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/docker-kubernetes-with-mangdb.html<\/a>\u7f16\u8f91\u5458\uff1a\u738b\u8f89\uff0c\u5ba1\u6838\u5458\uff1a\u51af\u632f\u534e<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

 \u672c\u6587\u4ecb\u7ecd\u4e86\u5229\u7528Docker\u548cKubernetes\u642d\u5efa\u4e00\u5957\u5177\u6709\u5197\u4f59\u5907\u4efd\u96c6\u5408\u7684MongoDB\u670d\u52a1\uff0c\u4ece\u5bb9\u5668\u5bf9CI\u548cCD\u5f15\u53d1\u7684\u6539\u53d8\u5165\u624b\uff0c\u8ba8\u8bba\u4e86\u5bb9\u5668\u6280\u672f\u5bf9MongoDB\u5e26\u6765\u7684\u6311\u6218\u548c\u673a\u4f1a\uff0c\u7136\u540e\u5b9e\u6218\u5982\u4f55\u90e8\u7f72\u4e00\u5957\u7a33\u5b9a\u7684MongoDB\u670d\u52a1\uff0c\u975e\u5e38\u7684\u5e72\u8d27~<\/p>\n","protected":false},"author":63,"featured_media":24145,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-23790","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/23790","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=23790"}],"version-history":[{"count":18,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/23790\/revisions"}],"predecessor-version":[{"id":257395,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/23790\/revisions\/257395"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/24145"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=23790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=23790"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=23790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}