{"id":21958,"date":"2024-01-02T18:09:23","date_gmt":"2024-01-02T18:09:23","guid":{"rendered":"https:\/\/server.hk\/blog\/21958\/"},"modified":"2024-11-14T10:24:19","modified_gmt":"2024-11-14T02:24:19","slug":"how-to-fix-mongodb-error-code-12586-backgroundoperationinprogressfordatabase-3","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/21958\/","title":{"rendered":"\u5982\u4f55\u4fee\u5fa9MongoDB\u932f\u8aa4\u78bc &#8211; 12586 &#8211; BackgroundOperationInProgressForDatabase"},"content":{"rendered":"<h1 id=\"how-to-fix-mongodb-error-code-12586-backgroundoperationinprogressfordatabase-RRdboLwckh\">\u5982\u4f55\u4fee\u5fa9MongoDB\u932f\u8aa4\u78bc &#8211; 12586 &#8211; BackgroundOperationInProgressForDatabase<\/h1>\n<p>MongoDB\u662f\u4e00\u500b\u53d7\u6b61\u8fce\u7684\u958b\u6e90NoSQL\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff0c\u63d0\u4f9b\u9ad8\u6027\u80fd\u3001\u53ef\u64f4\u5c55\u6027\u548c\u9748\u6d3b\u6027\u3002\u7136\u800c\uff0c\u50cf\u6240\u6709\u8edf\u4ef6\u4e00\u6a23\uff0c\u5b83\u53ef\u80fd\u6703\u9047\u5230\u6703\u5f71\u97ff\u6b63\u5e38\u904b\u4f5c\u7684\u932f\u8aa4\u3002\u5176\u4e2d\u4e00\u500b\u932f\u8aa4\u662fMongoDB\u932f\u8aa4\u78bc &#8211; 12586 &#8211; BackgroundOperationInProgressForDatabase\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5011\u5c07\u63a2\u8a0e\u9020\u6210\u9019\u500b\u932f\u8aa4\u7684\u539f\u56e0\u4e26\u63d0\u4f9b\u89e3\u6c7a\u65b9\u6848\u3002<\/p>\n<h2 id=\"understanding-mongodb-error-code-12586-RRdboLwckh\">\u7406\u89e3MongoDB\u932f\u8aa4\u78bc &#8211; 12586<\/h2>\n<p>\u7576\u7279\u5b9a\u6578\u64da\u5eab\u5df2\u6709\u80cc\u666f\u64cd\u4f5c\u5728\u9032\u884c\u6642\uff0c\u6703\u51fa\u73feMongoDB\u932f\u8aa4\u78bc &#8211; 12586\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u5728\u5617\u8a66\u57f7\u884c\u67d0\u4e9b\u7ba1\u7406\u4efb\u52d9\u6642\u767c\u751f\uff0c\u4f8b\u5982\u5275\u5efa\u6216\u522a\u9664\u96c6\u5408\u3001\u5275\u5efa\u7d22\u5f15\u6216\u9032\u884c\u6578\u64da\u5eab\u5099\u4efd\u3002\u932f\u8aa4\u4fe1\u606f\u53ef\u80fd\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<p><code>BackgroundOperationInProgressForDatabase: A background operation is currently running for the database.<\/code><\/p>\n<p>\u6b64\u932f\u8aa4\u8868\u660eMongoDB\u5df2\u7d93\u5728\u70ba\u6307\u5b9a\u6578\u64da\u5eab\u57f7\u884c\u80cc\u666f\u64cd\u4f5c\uff0c\u4e26\u963b\u6b62\u4efb\u4f55\u4e26\u884c\u7684\u7ba1\u7406\u64cd\u4f5c\u3002<\/p>\n<h2 id=\"possible-causes-of-mongodb-error-code-12586-RRdboLwckh\">MongoDB\u932f\u8aa4\u78bc &#8211; 12586\u7684\u53ef\u80fd\u539f\u56e0<\/h2>\n<p>\u60a8\u53ef\u80fd\u6703\u9047\u5230MongoDB\u932f\u8aa4\u78bc &#8211; 12586\u7684\u539f\u56e0\u6709\u5e7e\u500b\uff1a<\/p>\n<ul>\n<li><strong>\u9577\u6642\u9593\u904b\u884c\u7684\u64cd\u4f5c\uff1a<\/strong> \u5982\u679c\u6709\u9577\u6642\u9593\u904b\u884c\u7684\u64cd\u4f5c\uff0c\u5982\u7d22\u5f15\u69cb\u5efa\u6216\u5927\u91cf\u6578\u64da\u9077\u79fb\uff0cMongoDB\u53ef\u80fd\u4ecd\u5728\u80cc\u666f\u4e2d\u8655\u7406\u5b83\u5011\uff0c\u5c0e\u81f4\u932f\u8aa4\u3002<\/li>\n<li><strong>\u4e26\u767c\u554f\u984c\uff1a<\/strong> \u5982\u679c\u5c0d\u540c\u4e00\u6578\u64da\u5eab\u540c\u6642\u57f7\u884c\u591a\u500b\u7ba1\u7406\u64cd\u4f5c\uff0cMongoDB\u53ef\u80fd\u6703\u9047\u5230\u885d\u7a81\u4e26\u89f8\u767c\u932f\u8aa4\u3002<\/li>\n<li><strong>\u786c\u4ef6\u9650\u5236\uff1a<\/strong> \u7cfb\u7d71\u8cc7\u6e90\u4e0d\u8db3\uff0c\u5982CPU\u3001\u5167\u5b58\u6216\u78c1\u789f\u7a7a\u9593\uff0c\u53ef\u80fd\u5c0e\u81f4\u80cc\u666f\u64cd\u4f5c\u9700\u8981\u66f4\u9577\u6642\u9593\u5b8c\u6210\uff0c\u5f9e\u800c\u7522\u751f\u932f\u8aa4\u3002<\/li>\n<\/ul>\n<h2 id=\"fixing-mongodb-error-code-12586-RRdboLwckh\">\u4fee\u5fa9MongoDB\u932f\u8aa4\u78bc &#8211; 12586<\/h2>\n<p>\u8981\u89e3\u6c7aMongoDB\u932f\u8aa4\u78bc &#8211; 12586\uff0c\u60a8\u53ef\u4ee5\u9075\u5faa\u4ee5\u4e0b\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"1-check-for-long-running-operations-RRdboLwckh\">1. \u6aa2\u67e5\u9577\u6642\u9593\u904b\u884c\u7684\u64cd\u4f5c<\/h3>\n<p>\u4f7f\u7528MongoDB\u547d\u4ee4\u884c\u754c\u9762\u6216\u5982MongoDB Compass\u7b49GUI\u5de5\u5177\u6aa2\u67e5\u662f\u5426\u6709\u4efb\u4f55\u6b63\u5728\u9032\u884c\u7684\u9577\u6642\u9593\u904b\u884c\u64cd\u4f5c\u3002\u67e5\u627e\u53ef\u80fd\u5c0e\u81f4\u932f\u8aa4\u7684\u64cd\u4f5c\uff0c\u5982\u7d22\u5f15\u69cb\u5efa\u6216\u6578\u64da\u9077\u79fb\u3002\u5982\u679c\u767c\u73fe\u4efb\u4f55\uff0c\u8acb\u7b49\u5f85\u5b83\u5011\u5b8c\u6210\u5f8c\u518d\u8a66\u5716\u57f7\u884c\u7ba1\u7406\u4efb\u52d9\u3002<\/p>\n<h3 id=\"2-ensure-sequential-execution-of-administrative-operations-RRdboLwckh\">2. \u78ba\u4fdd\u7ba1\u7406\u64cd\u4f5c\u7684\u9806\u5e8f\u57f7\u884c<\/h3>\n<p>\u5982\u679c\u60a8\u5728\u540c\u4e00\u6578\u64da\u5eab\u4e0a\u57f7\u884c\u591a\u500b\u7ba1\u7406\u64cd\u4f5c\uff0c\u8acb\u78ba\u4fdd\u5b83\u5011\u662f\u9806\u5e8f\u57f7\u884c\uff0c\u800c\u4e0d\u662f\u540c\u6642\u9032\u884c\u3002\u9019\u53ef\u4ee5\u5e6b\u52a9\u907f\u514d\u885d\u7a81\uff0c\u9632\u6b62\u932f\u8aa4\u7684\u767c\u751f\u3002<\/p>\n<h3 id=\"3-increase-system-resources-RRdboLwckh\">3. \u589e\u52a0\u7cfb\u7d71\u8cc7\u6e90<\/h3>\n<p>\u5982\u679c\u60a8\u7684\u7cfb\u7d71\u8cc7\u6e90\u4e0d\u8db3\uff0c\u8003\u616e\u589e\u52a0\u53ef\u7528\u7684CPU\u3001\u5167\u5b58\u6216\u78c1\u789f\u7a7a\u9593\u3002\u9019\u53ef\u4ee5\u5e6b\u52a9\u52a0\u5feb\u80cc\u666f\u64cd\u4f5c\u7684\u901f\u5ea6\uff0c\u6e1b\u5c11\u9047\u5230\u932f\u8aa4\u7684\u6a5f\u6703\u3002<\/p>\n<h3 id=\"4-restart-mongodb-RRdboLwckh\">4. \u91cd\u555fMongoDB<\/h3>\n<p>\u5982\u679c\u4ee5\u4e0a\u65b9\u6cd5\u90fd\u7121\u6cd5\u89e3\u6c7a\uff0c\u91cd\u555fMongoDB\u670d\u52d9\u5f80\u5f80\u80fd\u5920\u89e3\u6c7a\u6b64\u932f\u8aa4\u3002\u8acb\u6839\u64da\u60a8\u7684\u64cd\u4f5c\u7cfb\u7d71\u9075\u5faa\u6b63\u78ba\u7684\u91cd\u555f\u7a0b\u5e8f\u3002<\/p>\n<h2 id=\"summary-RRdboLwckh\">\u7e3d\u7d50<\/h2>\n<p>MongoDB\u932f\u8aa4\u78bc &#8211; 12586 &#8211; BackgroundOperationInProgressForDatabase\u53ef\u80fd\u5728\u7279\u5b9a\u6578\u64da\u5eab\u5df2\u6709\u80cc\u666f\u64cd\u4f5c\u6642\u51fa\u73fe\u3002\u6b64\u932f\u8aa4\u53ef\u80fd\u7531\u9577\u6642\u9593\u904b\u884c\u7684\u64cd\u4f5c\u3001\u4e26\u767c\u554f\u984c\u6216\u786c\u4ef6\u9650\u5236\u5f15\u8d77\u3002\u8981\u4fee\u5fa9\u6b64\u932f\u8aa4\uff0c\u8acb\u6aa2\u67e5\u662f\u5426\u6709\u6b63\u5728\u9032\u884c\u7684\u64cd\u4f5c\u3001\u78ba\u4fdd\u7ba1\u7406\u4efb\u52d9\u7684\u9806\u5e8f\u57f7\u884c\u3001\u5728\u5fc5\u8981\u6642\u589e\u52a0\u7cfb\u7d71\u8cc7\u6e90\uff0c\u4e26\u8003\u616e\u5728\u5fc5\u8981\u6642\u91cd\u555fMongoDB\u3002<\/p>\n<p>\u8981\u7372\u5f97\u53ef\u9760\u4e14\u9ad8\u6027\u80fd\u7684VPS\u8a17\u7ba1\u89e3\u6c7a\u65b9\u6848\uff0c\u8003\u616e\u4f7f\u7528<a href=\"https:\/\/server.hk\">Server.HK<\/a>\u3002\u6191\u85c9\u6211\u5011\u4e00\u6d41\u7684VPS\u8a17\u7ba1\u670d\u52d9\uff0c\u60a8\u53ef\u4ee5\u78ba\u4fddMongoDB\u6578\u64da\u5eab\u548c\u5176\u4ed6\u61c9\u7528\u7a0b\u5e8f\u7684\u5e73\u7a69\u904b\u884c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4fee\u5fa9MongoDB\u932f\u8aa4\u78bc &#038;&#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-21958","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21958","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=21958"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21958\/revisions"}],"predecessor-version":[{"id":23353,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21958\/revisions\/23353"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=21958"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=21958"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=21958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}