{"id":21777,"date":"2024-01-02T15:08:27","date_gmt":"2024-01-02T15:08:27","guid":{"rendered":"https:\/\/server.hk\/blog\/21777\/"},"modified":"2024-11-14T10:27:12","modified_gmt":"2024-11-14T02:27:12","slug":"how-to-fix-mongodb-error-code-192-failpointenabled","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/21777\/","title":{"rendered":"\u5982\u4f55\u4fee\u5fa9 MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 192 &#8211; FailPointEnabled"},"content":{"rendered":"<h1 id=\"how-to-fix-mongodb-error-code-192-failpointenabled-zUjxdLfKIG\">\u5982\u4f55\u4fee\u5fa9 MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 192 &#8211; FailPointEnabled<\/h1>\n<p>MongoDB \u662f\u4e00\u500b\u6d41\u884c\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\u4e5f\u53ef\u80fd\u9047\u5230\u9700\u8981\u89e3\u6c7a\u7684\u932f\u8aa4\u548c\u554f\u984c\u3002\u5176\u4e2d\u4e00\u500b\u932f\u8aa4\u662f MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 192 &#8211; FailPointEnabled\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-mongodb-error-code-192-failpointenabled-zUjxdLfKIG\">\u7406\u89e3 MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 192 &#8211; FailPointEnabled<\/h2>\n<p>\u7576\u4f60\u9047\u5230 MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 192 &#8211; FailPointEnabled \u6642\uff0c\u9019\u610f\u5473\u8457\u4f60\u7684 MongoDB \u90e8\u7f72\u4e2d\u555f\u7528\u4e86\u6545\u969c\u9ede\u529f\u80fd\u3002\u6545\u969c\u9ede\u662f\u4e00\u7a2e\u8abf\u8a66\u5de5\u5177\uff0c\u5141\u8a31\u4f60\u6a21\u64ec\u61c9\u7528\u7a0b\u5e8f\u7279\u5b9a\u90e8\u5206\u7684\u6545\u969c\uff0c\u4ee5\u6e2c\u8a66\u5176\u97cc\u6027\u548c\u932f\u8aa4\u8655\u7406\u80fd\u529b\u3002<\/p>\n<p>\u96d6\u7136\u6545\u969c\u9ede\u5728\u958b\u767c\u548c\u6e2c\u8a66\u904e\u7a0b\u4e2d\u53ef\u80fd\u5f88\u6709\u7528\uff0c\u4f46\u5728\u751f\u7522\u74b0\u5883\u4e2d\u4e0d\u61c9\u555f\u7528\u3002\u555f\u7528\u6545\u969c\u9ede\u53ef\u80fd\u5c0e\u81f4\u610f\u5916\u884c\u70ba\u3001\u6027\u80fd\u4e0b\u964d\u548c\u6f5b\u5728\u7684\u6578\u64da\u640d\u58de\u3002<\/p>\n<h2 id=\"fixing-mongodb-error-code-192-failpointenabled-zUjxdLfKIG\">\u4fee\u5fa9 MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 192 &#8211; FailPointEnabled<\/h2>\n<p>\u8981\u4fee\u5fa9 MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 192 &#8211; FailPointEnabled\uff0c\u4f60\u9700\u8981\u7981\u7528\u6545\u969c\u9ede\u529f\u80fd\u3002\u4ee5\u4e0b\u662f\u5177\u9ad4\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"step-1-connect-to-mongodb-zUjxdLfKIG\">\u6b65\u9a5f 1\uff1a\u9023\u63a5\u5230 MongoDB<\/h3>\n<p>\u6253\u958b\u7d42\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u4f7f\u7528 MongoDB shell \u6216 MongoDB \u5ba2\u6236\u7aef\u9023\u63a5\u5230\u4f60\u7684 MongoDB \u90e8\u7f72\u3002<\/p>\n<pre><code>$ mongo<\/code><\/pre>\n<h3 id=\"step-2-check-fail-point-status-zUjxdLfKIG\">\u6b65\u9a5f 2\uff1a\u6aa2\u67e5\u6545\u969c\u9ede\u72c0\u614b<\/h3>\n<p>\u9023\u63a5\u5f8c\uff0c\u904b\u884c\u4ee5\u4e0b\u547d\u4ee4\u6aa2\u67e5\u6545\u969c\u9ede\u7684\u72c0\u614b\uff1a<\/p>\n<pre><code>db.runCommand({ \"configureFailPoint\": \"failCommand\", \"mode\": \"alwaysOn\" })<\/code><\/pre>\n<p>\u5982\u679c\u6545\u969c\u9ede\u529f\u80fd\u5df2\u555f\u7528\uff0c\u4f60\u5c07\u770b\u5230\u985e\u4f3c\u4ee5\u4e0b\u7684\u97ff\u61c9\uff1a<\/p>\n<pre><code>{\r\n  \"ok\" : 1,\r\n  \"mode\" : {\r\n    \"times\" : -1,\r\n    \"activateFailPoint\" : \"failCommand\"\r\n  }\r\n}<\/code><\/pre>\n<h3 id=\"step-3-disable-fail-point-zUjxdLfKIG\">\u6b65\u9a5f 3\uff1a\u7981\u7528\u6545\u969c\u9ede<\/h3>\n<p>\u8981\u7981\u7528\u6545\u969c\u9ede\u529f\u80fd\uff0c\u904b\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>db.runCommand({ \"configureFailPoint\": \"failCommand\", \"mode\": \"off\" })<\/code><\/pre>\n<p>\u4f60\u61c9\u8a72\u6703\u770b\u5230\u4e00\u500b\u97ff\u61c9\uff0c\u6307\u793a\u6545\u969c\u9ede\u5df2\u88ab\u7981\u7528\uff1a<\/p>\n<pre><code>{\r\n  \"ok\" : 1,\r\n  \"was\" : {\r\n    \"times\" : -1,\r\n    \"activateFailPoint\" : \"failCommand\"\r\n  }\r\n}<\/code><\/pre>\n<h3 id=\"step-4-verify-fail-point-status-zUjxdLfKIG\">\u6b65\u9a5f 4\uff1a\u9a57\u8b49\u6545\u969c\u9ede\u72c0\u614b<\/h3>\n<p>\u6700\u5f8c\uff0c\u518d\u6b21\u904b\u884c\u6545\u969c\u9ede\u72c0\u614b\u547d\u4ee4\uff0c\u4ee5\u9a57\u8b49\u6545\u969c\u9ede\u529f\u80fd\u73fe\u5728\u5df2\u7981\u7528\uff1a<\/p>\n<pre><code>db.runCommand({ \"configureFailPoint\": \"failCommand\", \"mode\": \"alwaysOn\" })<\/code><\/pre>\n<p>\u5982\u679c\u6545\u969c\u9ede\u529f\u80fd\u5df2\u7981\u7528\uff0c\u4f60\u5c07\u770b\u5230\u985e\u4f3c\u4ee5\u4e0b\u7684\u97ff\u61c9\uff1a<\/p>\n<pre><code>{\r\n  \"ok\" : 0,\r\n  \"errmsg\" : \"failCommand fail point not found\"\r\n}<\/code><\/pre>\n<h2 id=\"conclusion-zUjxdLfKIG\">\u7d50\u8ad6<\/h2>\n<p>MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 192 &#8211; FailPointEnabled \u8868\u793a\u4f60\u7684 MongoDB \u90e8\u7f72\u4e2d\u555f\u7528\u4e86\u6545\u969c\u9ede\u529f\u80fd\u3002\u8981\u4fee\u5fa9\u6b64\u932f\u8aa4\uff0c\u4f60\u9700\u8981\u4f7f\u7528 MongoDB shell \u6216 MongoDB \u5ba2\u6236\u7aef\u7981\u7528\u6545\u969c\u9ede\u529f\u80fd\u3002\u901a\u904e\u9075\u5faa\u672c\u6587\u4e2d\u6982\u8ff0\u7684\u6b65\u9a5f\uff0c\u4f60\u53ef\u4ee5\u89e3\u6c7a\u6b64\u932f\u8aa4\uff0c\u78ba\u4fdd\u4f60\u7684 MongoDB \u6578\u64da\u5eab\u5e73\u7a69\u904b\u884c\u3002<\/p>\n<h2 id=\"summary-zUjxdLfKIG\">\u7e3d\u7d50<\/h2>\n<p>\u7e3d\u4e4b\uff0cMongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 192 &#8211; FailPointEnabled \u767c\u751f\u5728\u4f60\u7684 MongoDB \u90e8\u7f72\u4e2d\u555f\u7528\u4e86\u6545\u969c\u9ede\u529f\u80fd\u3002\u8981\u4fee\u5fa9\u6b64\u932f\u8aa4\uff0c\u4f60\u9700\u8981\u7981\u7528\u6545\u969c\u9ede\u529f\u80fd\u3002\u6b32\u4e86\u89e3\u66f4\u591a\u6709\u95dc MongoDB \u548c VPS \u8a17\u7ba1\u89e3\u6c7a\u65b9\u6848\u7684\u4fe1\u606f\uff0c\u8acb\u8a2a\u554f <a href=\"https:\/\/server.hk\">Server.HK<\/a>\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-21777","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21777","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=21777"}],"version-history":[{"count":2,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21777\/revisions"}],"predecessor-version":[{"id":23599,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21777\/revisions\/23599"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=21777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=21777"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=21777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}