{"id":21915,"date":"2024-01-02T17:26:23","date_gmt":"2024-01-02T17:26:23","guid":{"rendered":"https:\/\/server.hk\/blog\/21915\/"},"modified":"2024-11-14T10:25:06","modified_gmt":"2024-11-14T02:25:06","slug":"how-to-fix-mongodb-error-code-335-tenantmigrationforgotten","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/21915\/","title":{"rendered":"\u5982\u4f55\u4fee\u5fa9 MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 335 &#8211; TenantMigrationForgotten"},"content":{"rendered":"<h1 id=\"how-to-fix-mongodb-error-code-335-tenantmigrationforgotten-cEaiEzhEjQ\">\u5982\u4f55\u4fee\u5fa9 MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 335 &#8211; TenantMigrationForgotten<\/h1>\n<p>MongoDB \u662f\u4e00\u7a2e\u53d7\u6b61\u8fce\u7684\u958b\u6e90 NoSQL \u6578\u64da\u5eab\uff0c\u63d0\u4f9b\u9ad8\u6027\u80fd\u3001\u53ef\u64f4\u5c55\u6027\u548c\u9748\u6d3b\u6027\u3002\u7136\u800c\uff0c\u50cf\u4efb\u4f55\u8edf\u4ef6\u4e00\u6a23\uff0c\u5b83\u53ef\u80fd\u6703\u9047\u5230\u9700\u8981\u89e3\u6c7a\u7684\u932f\u8aa4\u3002\u5176\u4e2d\u4e00\u500b\u932f\u8aa4\u662f MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 335 &#8211; TenantMigrationForgotten\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5011\u5c07\u63a2\u8a0e\u9019\u500b\u932f\u8aa4\u7684\u542b\u7fa9\u4ee5\u53ca\u5982\u4f55\u4fee\u5fa9\u5b83\u3002<\/p>\n<h2 id=\"understanding-the-mongodb-error-code-335-tenantmigrationforgotten-cEaiEzhEjQ\">\u7406\u89e3 MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 335 &#8211; TenantMigrationForgotten<\/h2>\n<p>\u7576\u79df\u6236\u9077\u79fb\u88ab\u907a\u5fd8\u6216\u672a\u80fd\u6210\u529f\u5b8c\u6210\u6642\uff0c\u6703\u767c\u751f MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 335 &#8211; TenantMigrationForgotten\u3002\u5728 MongoDB \u4e2d\uff0c\u79df\u6236\u6307\u7684\u662f\u908f\u8f2f\u6578\u64da\u5eab\u6216\u5171\u4eab\u76f8\u540c\u8cc7\u6e90\u7684\u7528\u6236\u7fa4\u3002\u9032\u884c\u79df\u6236\u9077\u79fb\u662f\u70ba\u4e86\u79fb\u52d5\u6578\u64da\u6216\u5c0d\u79df\u6236\u7684\u6578\u64da\u5eab\u7d50\u69cb\u9032\u884c\u66f4\u6539\u3002<\/p>\n<p>\u7576\u79df\u6236\u9077\u79fb\u88ab\u907a\u5fd8\u6216\u672a\u5b8c\u6210\u6642\uff0c\u53ef\u80fd\u5c0e\u81f4\u6578\u64da\u5eab\u4e2d\u7684\u4e0d\u4e00\u81f4\uff0c\u4e26\u5f15\u8d77\u5404\u7a2e\u554f\u984c\u3002\u8207\u6b64\u932f\u8aa4\u4ee3\u78bc\u76f8\u95dc\u7684\u932f\u8aa4\u6d88\u606f\u901a\u5e38\u6703\u63d0\u4f9b\u66f4\u591a\u6709\u95dc\u5177\u9ad4\u554f\u984c\u7684\u8a73\u7d30\u4fe1\u606f\u3002<\/p>\n<h2 id=\"fixing-the-mongodb-error-code-335-tenantmigrationforgotten-cEaiEzhEjQ\">\u4fee\u5fa9 MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 335 &#8211; TenantMigrationForgotten<\/h2>\n<p>\u8981\u4fee\u5fa9 MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 335 &#8211; TenantMigrationForgotten\uff0c\u8acb\u9075\u5faa\u4ee5\u4e0b\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"1-identify-the-affected-tenant-cEaiEzhEjQ\">1. \u78ba\u8a8d\u53d7\u5f71\u97ff\u7684\u79df\u6236<\/h3>\n<p>\u7b2c\u4e00\u6b65\u662f\u78ba\u5b9a\u53d7\u9077\u79fb\u554f\u984c\u5f71\u97ff\u7684\u79df\u6236\u3002\u9019\u53ef\u4ee5\u901a\u904e\u5206\u6790\u8207\u932f\u8aa4\u76f8\u95dc\u7684\u932f\u8aa4\u6d88\u606f\u6216\u65e5\u8a8c\u4f86\u5b8c\u6210\u3002\u5c0b\u627e\u4efb\u4f55\u6307\u5411\u7279\u5b9a\u79df\u6236\u6216\u6578\u64da\u5eab\u7684\u53c3\u8003\u3002<\/p>\n<h3 id=\"2-check-the-migration-status-cEaiEzhEjQ\">2. \u6aa2\u67e5\u9077\u79fb\u72c0\u614b<\/h3>\n<p>\u63a5\u8457\uff0c\u6aa2\u67e5\u53d7\u5f71\u97ff\u79df\u6236\u7684\u9077\u79fb\u72c0\u614b\u3002\u4f7f\u7528 MongoDB \u547d\u4ee4\u884c\u4ecb\u9762\u6216\u6578\u64da\u5eab\u7ba1\u7406\u5de5\u5177\u67e5\u8a62\u9077\u79fb\u72c0\u614b\u3002\u5c0b\u627e\u4efb\u4f55\u672a\u5b8c\u6210\u6216\u672a\u6c7a\u7684\u9077\u79fb\u3002<\/p>\n<h3 id=\"3-resume-or-rollback-the-migration-cEaiEzhEjQ\">3. \u7e7c\u7e8c\u6216\u56de\u6efe\u9077\u79fb<\/h3>\n<p>\u5982\u679c\u60a8\u767c\u73fe\u4efb\u4f55\u672a\u5b8c\u6210\u6216\u672a\u6c7a\u7684\u9077\u79fb\uff0c\u60a8\u6709\u5169\u500b\u9078\u64c7\uff1a\u7e7c\u7e8c\u6216\u56de\u6efe\u9077\u79fb\u3002<\/p>\n<p>\u8981\u7e7c\u7e8c\u9077\u79fb\uff0c\u8acb\u78ba\u4fdd\u4efb\u4f55\u5fc5\u8981\u7684\u8cc7\u6e90\u6216\u4f9d\u8cf4\u9805\u53ef\u7528\uff0c\u4e26\u518d\u6b21\u57f7\u884c\u9077\u79fb\u547d\u4ee4\u3002\u76e3\u63a7\u904e\u7a0b\u4ee5\u78ba\u4fdd\u5176\u6210\u529f\u5b8c\u6210\u3002<\/p>\n<p>\u5982\u679c\u7121\u6cd5\u7e7c\u7e8c\u9077\u79fb\u6216\u7e7c\u7e8c\u672a\u80fd\u89e3\u6c7a\u554f\u984c\uff0c\u8acb\u8003\u616e\u56de\u6efe\u9077\u79fb\u3002\u9019\u5305\u62ec\u6062\u5fa9\u9077\u79fb\u904e\u7a0b\u4e2d\u6240\u505a\u7684\u4efb\u4f55\u66f4\u6539\u3002\u56de\u6efe\u6642\u8981\u5c0f\u5fc3\uff0c\u56e0\u70ba\u5b83\u53ef\u80fd\u5c0e\u81f4\u6578\u64da\u4e1f\u5931\u6216\u4e0d\u4e00\u81f4\u3002<\/p>\n<h3 id=\"4-verify-the-database-consistency-cEaiEzhEjQ\">4. \u9a57\u8b49\u6578\u64da\u5eab\u4e00\u81f4\u6027<\/h3>\n<p>\u5b8c\u6210\u9077\u79fb\u6216\u56de\u6efe\u5f8c\uff0c\u9a57\u8b49\u53d7\u5f71\u97ff\u79df\u6236\u7684\u6578\u64da\u5eab\u4e00\u81f4\u6027\u3002\u9032\u884c\u5fb9\u5e95\u7684\u6e2c\u8a66\u548c\u9a57\u8b49\uff0c\u4ee5\u78ba\u4fdd\u6240\u6709\u6578\u64da\u5b8c\u6574\u4e14\u6578\u64da\u5eab\u5982\u9810\u671f\u822c\u904b\u4f5c\u3002<\/p>\n<h3 id=\"5-prevent-future-migration-issues-cEaiEzhEjQ\">5. \u9632\u6b62\u672a\u4f86\u7684\u9077\u79fb\u554f\u984c<\/h3>\n<p>\u70ba\u4e86\u9632\u6b62\u985e\u4f3c\u7684\u9077\u79fb\u554f\u984c\u767c\u751f\uff0c\u5efa\u7acb\u4e00\u500b\u7a69\u5065\u7684\u9077\u79fb\u6d41\u7a0b\u3002\u9019\u500b\u904e\u7a0b\u61c9\u5305\u62ec\u5fb9\u5e95\u7684\u898f\u5283\u3001\u6e2c\u8a66\u548c\u9077\u79fb\u76e3\u63a7\u3002\u8a18\u9304\u6240\u6d89\u53ca\u7684\u6b65\u9a5f\u4e26\u78ba\u4fdd\u6240\u6709\u5718\u968a\u6210\u54e1\u4e00\u81f4\u9075\u5faa\u6b64\u904e\u7a0b\u3002<\/p>\n<h2 id=\"summary-cEaiEzhEjQ\">\u7e3d\u7d50<\/h2>\n<p>MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 335 &#8211; TenantMigrationForgotten \u6703\u767c\u751f\u65bc\u79df\u6236\u9077\u79fb\u88ab\u907a\u5fd8\u6216\u672a\u5b8c\u6210\u7684\u60c5\u6cc1\u3002\u8981\u4fee\u5fa9\u6b64\u932f\u8aa4\uff0c\u8b58\u5225\u53d7\u5f71\u97ff\u79df\u6236\uff0c\u6aa2\u67e5\u9077\u79fb\u72c0\u614b\uff0c\u4e26\u7e7c\u7e8c\u6216\u56de\u6efe\u9077\u79fb\u3002\u5b8c\u6210\u9077\u79fb\u6216\u56de\u6efe\u5f8c\uff0c\u9a57\u8b49\u6578\u64da\u5eab\u4e00\u81f4\u6027\u3002\u8981\u9632\u6b62\u672a\u4f86\u7684\u9077\u79fb\u554f\u984c\uff0c\u8acb\u5efa\u7acb\u7a69\u5065\u7684\u9077\u79fb\u6d41\u7a0b\u3002<\/p>\n<p>\u5982\u9700\u53ef\u9760\u548c\u9ad8\u6027\u80fd\u7684 VPS \u6258\u7ba1\u89e3\u6c7a\u65b9\u6848\uff0c\u8acb\u8003\u616e <a href=\"https:\/\/server.hk\">Server.HK<\/a>\u3002\u6211\u5011\u7684\u6258\u7ba1\u670d\u52d9\u65e8\u5728\u6eff\u8db3\u5404\u7a2e\u898f\u6a21\u4f01\u696d\u7684\u9700\u6c42\uff0c\u63d0\u4f9b\u5353\u8d8a\u7684\u6027\u80fd\u548c\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4fee\u5fa9 MongoDB \u932f\u8aa4\u4ee3&#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":[101],"tags":[],"class_list":["post-21915","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21915","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=21915"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21915\/revisions"}],"predecessor-version":[{"id":23416,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21915\/revisions\/23416"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=21915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=21915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=21915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}