{"id":21536,"date":"2024-01-02T11:05:25","date_gmt":"2024-01-02T11:05:25","guid":{"rendered":"https:\/\/server.hk\/blog\/21536\/"},"modified":"2024-11-14T10:31:07","modified_gmt":"2024-11-14T02:31:07","slug":"mongodb-glossary-primary","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/21536\/","title":{"rendered":"MongoDB \u8a5e\u5f59\u8868 &#8211; \u4e3b\u6210\u54e1"},"content":{"rendered":"<h1 id=\"mongodb-glossary-primary-BtGBSMChcC\">MongoDB \u8a5e\u5f59\u8868 &#8211; \u4e3b\u6210\u54e1<\/h1>\n<p>\u5728\u6578\u64da\u5eab\u7684\u4e16\u754c\u4e2d\uff0cMongoDB \u7531\u65bc\u5176\u9748\u6d3b\u6027\u3001\u53ef\u64f4\u5c55\u6027\u548c\u6613\u7528\u6027\u800c\u53d7\u5230\u5ee3\u6cdb\u9078\u64c7\u3002\u7576\u60a8\u6df1\u5165\u4e86\u89e3 MongoDB \u751f\u614b\u7cfb\u7d71\u6642\uff0c\u60a8\u53ef\u80fd\u6703\u9047\u5230\u4e00\u4e9b\u5fc5\u9808\u7406\u89e3\u7684\u8853\u8a9e\u548c\u6982\u5ff5\u3002\u5176\u4e2d\u4e00\u500b\u8853\u8a9e\u662f\u300c\u4e3b\u6210\u54e1\u300d\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5011\u5c07\u63a2\u8a0e MongoDB \u4e2d\u7684\u4e3b\u6210\u54e1\u53ca\u5176\u5728\u6578\u64da\u5eab\u96c6\u7fa4\u4e2d\u7684\u91cd\u8981\u6027\u3002<\/p>\n<h2 id=\"what-is-a-primary-in-mongodb-BtGBSMChcC\">MongoDB \u4e2d\u7684\u4e3b\u6210\u54e1\u662f\u4ec0\u9ebc\uff1f<\/h2>\n<p>\u5728 MongoDB \u4e2d\uff0c\u4e3b\u6210\u54e1\u6307\u7684\u662f\u526f\u672c\u96c6\u4e2d\u4e3b\u8981\u7684\u526f\u672c\u96c6\u6210\u54e1\u3002\u526f\u672c\u96c6\u662f\u4e00\u7d44\u5b58\u5132\u76f8\u540c\u6578\u64da\u7684 MongoDB \u5be6\u4f8b\uff0c\u63d0\u4f9b\u5197\u9918\u548c\u9ad8\u53ef\u7528\u6027\u3002\u4e3b\u6210\u54e1\u8ca0\u8cac\u8655\u7406\u6240\u6709\u5beb\u5165\u64cd\u4f5c\uff0c\u4e26\u5145\u7576\u6578\u64da\u7684\u4e3b\u8981\u771f\u5be6\u4f86\u6e90\u3002<\/p>\n<p>\u7576\u5ba2\u6236\u7aef\u61c9\u7528\u7a0b\u5e8f\u5411\u526f\u672c\u96c6\u767c\u9001\u5beb\u5165\u8acb\u6c42\u6642\uff0c\u8a72\u8acb\u6c42\u6703\u88ab\u5c0e\u5411\u4e3b\u6210\u54e1\u3002\u4e3b\u6210\u54e1\u7136\u5f8c\u8655\u7406\u5beb\u5165\u64cd\u4f5c\uff0c\u4e26\u5c07\u8b8a\u66f4\u8907\u88fd\u5230\u526f\u672c\u96c6\u7684\u6b21\u6210\u54e1\u3002\u9019\u78ba\u4fdd\u6240\u6709\u6578\u64da\u4fee\u6539\u5728\u526f\u672c\u96c6\u4e2d\u4fdd\u6301\u540c\u6b65\uff0c\u7dad\u8b77\u6578\u64da\u4e00\u81f4\u6027\u3002<\/p>\n<h2 id=\"role-of-the-primary-BtGBSMChcC\">\u4e3b\u6210\u54e1\u7684\u89d2\u8272<\/h2>\n<p>MongoDB \u526f\u672c\u96c6\u4e2d\u7684\u4e3b\u6210\u54e1\u64c1\u6709\u5e7e\u500b\u95dc\u9375\u89d2\u8272\uff1a<\/p>\n<ul>\n<li><strong>\u8655\u7406\u5beb\u5165\u64cd\u4f5c\uff1a<\/strong>\u5982\u524d\u6240\u8ff0\uff0c\u4e3b\u6210\u54e1\u8ca0\u8cac\u8655\u7406\u6240\u6709\u5beb\u5165\u64cd\u4f5c\uff0c\u5305\u62ec\u63d2\u5165\u3001\u66f4\u65b0\u548c\u522a\u9664\u64cd\u4f5c\u3002\u5b83\u78ba\u4fdd\u8b8a\u66f4\u61c9\u7528\u65bc\u6578\u64da\u96c6\u4e26\u50b3\u64ad\u5230\u6b21\u6210\u54e1\u3002<\/li>\n<li><strong>\u9078\u8209\u65b0\u4e3b\u6210\u54e1\uff1a<\/strong>\u5728\u4e3b\u6210\u54e1\u6545\u969c\u6216\u7121\u6cd5\u4f7f\u7528\u7684\u60c5\u6cc1\u4e0b\uff0c\u526f\u672c\u96c6\u6703\u555f\u52d5\u9078\u8209\u904e\u7a0b\u4ee5\u9078\u64c7\u65b0\u7684\u4e3b\u6210\u54e1\u3002\u9078\u8209\u904e\u7a0b\u6d89\u53ca\u6b21\u6210\u54e1\u6295\u7968\uff0c\u7372\u5f97\u5927\u591a\u6578\u7968\u7684\u6210\u54e1\u6210\u70ba\u65b0\u7684\u4e3b\u6210\u54e1\u3002<\/li>\n<li><strong>\u5354\u8abf\u8b80\u53d6\u64cd\u4f5c\uff1a<\/strong>\u96d6\u7136\u4e3b\u6210\u54e1\u4e3b\u8981\u8655\u7406\u5beb\u5165\u64cd\u4f5c\uff0c\u4f46\u5728\u5fc5\u8981\u6642\u4e5f\u5354\u8abf\u8b80\u53d6\u64cd\u4f5c\u3002\u5982\u679c\u5ba2\u6236\u7aef\u61c9\u7528\u7a0b\u5e8f\u5411\u526f\u672c\u96c6\u767c\u9001\u8b80\u53d6\u8acb\u6c42\uff0c\u53ef\u4ee5\u5c07\u5176\u5c0e\u5411\u4e3b\u6210\u54e1\u4ee5\u7372\u53d6\u6700\u65b0\u6578\u64da\u3002<\/li>\n<\/ul>\n<h2 id=\"advantages-of-using-a-primary-BtGBSMChcC\">\u4f7f\u7528\u4e3b\u6210\u54e1\u7684\u512a\u52e2<\/h2>\n<p>MongoDB \u526f\u672c\u96c6\u4e2d\u7684\u4e3b\u6210\u54e1\u89d2\u8272\u63d0\u4f9b\u4e86\u5e7e\u500b\u512a\u52e2\uff1a<\/p>\n<ul>\n<li><strong>\u9ad8\u53ef\u7528\u6027\uff1a<\/strong>\u901a\u904e\u64c1\u6709\u4e00\u500b\u4e3b\u6210\u54e1\u548c\u591a\u500b\u6b21\u6210\u54e1\uff0cMongoDB \u78ba\u4fdd\u6578\u64da\u7684\u9ad8\u53ef\u7528\u6027\u3002\u5982\u679c\u4e3b\u6210\u54e1\u8b8a\u5f97\u4e0d\u53ef\u7528\uff0c\u5247\u53ef\u4ee5\u9078\u8209\u5176\u4e2d\u4e00\u500b\u6b21\u6210\u54e1\u4f5c\u70ba\u65b0\u7684\u4e3b\u6210\u54e1\uff0c\u5141\u8a31\u7cfb\u7d71\u7e7c\u7e8c\u904b\u884c\u800c\u4e0d\u6703\u4e2d\u65b7\u3002<\/li>\n<li><strong>\u6578\u64da\u4e00\u81f4\u6027\uff1a<\/strong>\u4e3b\u6210\u54e1\u78ba\u4fdd\u6240\u6709\u5beb\u5165\u64cd\u4f5c\u5728\u8907\u88fd\u5230\u6b21\u6210\u54e1\u4e4b\u524d\u61c9\u7528\u65bc\u6578\u64da\u96c6\u3002\u9019\u4fdd\u8b49\u4e86\u526f\u672c\u96c6\u7684\u6578\u64da\u4e00\u81f4\u6027\uff0c\u9632\u6b62\u4efb\u4f55\u885d\u7a81\u6216\u4e0d\u4e00\u81f4\u7684\u60c5\u6cc1\u3002<\/li>\n<li><strong>\u53ef\u64f4\u5c55\u6027\uff1a<\/strong>MongoDB \u5141\u8a31\u60a8\u901a\u904e\u6dfb\u52a0\u66f4\u591a\u526f\u672c\u96c6\u6210\u54e1\u4f86\u6c34\u5e73\u64f4\u5c55\u6578\u64da\u5eab\u3002\u4e3b\u6210\u54e1\u7ba1\u7406\u5beb\u5165\u64cd\u4f5c\u7684\u5206\u914d\uff0c\u5f9e\u800c\u5be6\u73fe\u61c9\u7528\u7a0b\u5e8f\u7684\u9ad8\u6548\u64f4\u5c55\u3002<\/li>\n<\/ul>\n<h2 id=\"conclusion-BtGBSMChcC\">\u7d50\u8ad6<\/h2>\n<p>\u5728 MongoDB \u4e2d\uff0c\u4e3b\u6210\u54e1\u662f\u8ca0\u8cac\u8655\u7406\u5beb\u5165\u64cd\u4f5c\u3001\u5354\u8abf\u8b80\u53d6\u64cd\u4f5c\u548c\u78ba\u4fdd\u6578\u64da\u4e00\u81f4\u6027\u7684\u4e3b\u8981\u526f\u672c\u96c6\u6210\u54e1\u3002\u5b83\u5728\u70ba\u60a8\u7684 MongoDB \u6578\u64da\u5eab\u63d0\u4f9b\u9ad8\u53ef\u7528\u6027\u3001\u6578\u64da\u5b8c\u6574\u6027\u548c\u53ef\u64f4\u5c55\u6027\u65b9\u9762\u767c\u63ee\u4e86\u81f3\u95dc\u91cd\u8981\u7684\u4f5c\u7528\u3002<\/p>\n<p>\u4e86\u89e3\u4e3b\u6210\u54e1\u7684\u6982\u5ff5\u5c0d\u65bc\u4efb\u4f55\u4f7f\u7528 MongoDB \u526f\u672c\u96c6\u7684\u4eba\u4f86\u8aaa\u90fd\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u3002\u5982\u679c\u60a8\u60f3\u4e86\u89e3\u66f4\u591a\u6709\u95dc MongoDB \u53ca\u5176\u529f\u80fd\u7684\u4fe1\u606f\uff0c\u8acb\u8003\u616e\u63a2\u7d22 <a href=\"https:\/\/server.hk\">Server.HK<\/a>\uff0c\u9019\u662f\u4e00\u5bb6\u63d0\u4f9b\u53ef\u9760\u4e14\u9ad8\u6548\u7684 MongoDB \u8a17\u7ba1\u89e3\u6c7a\u65b9\u6848\u7684\u9818\u5148 VPS \u8a17\u7ba1\u63d0\u4f9b\u5546\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MongoDB \u8a5e\u5f59\u8868 &#038;#82&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-21536","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21536","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=21536"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21536\/revisions"}],"predecessor-version":[{"id":23924,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21536\/revisions\/23924"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=21536"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=21536"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=21536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}