6\u3001MongoDB\u83b7\u53d6\u6570\u636e\u5e93\u72b6\u6001\u4fe1\u606f<\/strong><\/span><\/div>\ndb.stats()<\/pre>\n<\/p>\n
\u4ee5\u4e0a\u662fMongoDB\u7684\u91cd\u8981\u6307\u6807\uff0c\u901a\u8fc7\u8fd9\u4e9b\u6307\u6807\u6211\u4eec\u53ef\u4ee5\u4e86\u89e3\u5230MongoDB\u7684\u8fd0\u884c\u72b6\u6001\uff0c\u8bc4\u4f30\u6570\u636e\u5e93\u7684\u5065\u5eb7\u7a0b\u5ea6\uff0c\u5e76\u5feb\u901f\u786e\u5b9a\u5b9e\u9645\u9879\u76ee\u4e2d\u9047\u5230\u7684\u6027\u80fd\u74f6\u9888\u3002<\/p>\n
\u6bd4\u5982\u9879\u76ee\u4e2d\u9047\u5230\u7684Timeout\u5f02\u5e38\uff1a<\/p>\n
\r\ncom.mongodb.MongoSocketReadTimeoutException: Timeout while receiving message\r\n at com.mongodb.connection.InternalStreamConnection.translateReadException(InternalStreamConnection.java:475)\r\n at com.mongodb.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:226)\r\n at com.mongodb.connection.UsageTrackingInternalConnection.receiveMessage(UsageTrackingInternalConnection.java:105)\r\n at com.mongodb.connection.DefaultConnectionPool$PooledConnection.receiveMessage(DefaultConnectionPool.java:438)\r\n at com.mongodb.connection.CommandProtocol.execute(CommandProtocol.java:112)\r\n at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:168)\r\n at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:289)\r\n at com.mongodb.connection.DefaultServerConnection.command(DefaultServerConnection.java:176)\r\n at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:216)\r\n at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:207)\r\n at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:113)\r\n at com.mongodb.operation.FindOperation$1.call(FindOperation.java:488)\r\n at com.mongodb.operation.FindOperation$1.call(FindOperation.java:1)\r\n at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:241)\r\n at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:214)\r\n at com.mongodb.operation.FindOperation.execute(FindOperation.java:483)\r\n at com.mongodb.operation.FindOperation.execute(FindOperation.java:1)\r\n at com.mongodb.Mongo.execute(Mongo.java:818)\r\n<\/pre>\n\u516d\u3001MongoDB\u6301\u4e45\u6027<\/strong><\/div>\n1\u3001\u590d\u5236\u5ef6\u8fdf<\/strong><\/span><\/div>\n\u590d\u5236\u5ef6\u8fdf\u662f\u6307\u4ece\u8282\u70b9\u65e0\u6cd5\u8ddf\u4e0a\u4e3b\u8282\u70b9\u7684\u901f\u5ea6\u3002<\/p>\n
\u4ece\u8282\u70b9\u4e00\u4e2a\u64cd\u4f5c\u7684\u65f6\u95f4\u51cf\u53bb\u4e3b\u8282\u70b9\u6b64\u64cd\u4f5c\u7684\u65f6\u95f4\uff0c\u5c31\u662f\u590d\u5236\u5ef6\u8fdf\u3002\u5ef6\u8fdf\u5e94\u8be5\u5c3d\u53ef\u80fd\u7684\u63a5\u8fd10\uff0c\u5e76\u4e14\u901a\u5e38\u662f\u6beb\u79d2\u7ea7\u7684\u3002<\/p>\n
2\u3001\u5907\u4efd<\/strong><\/span><\/div>\n\u5907\u4efd\u64cd\u4f5c\u901a\u5e38\u4f1a\u5c06\u6240\u6709\u6570\u636e\u8bfb\u5165\u5185\u5b58\uff0c\u56e0\u6b64\uff0c\u5907\u4efd\u64cd\u4f5c\u901a\u5e38\u5e94\u8be5\u5728\u526f\u672c\u96c6\u4ece\u8282\u70b9\u800c\u4e0d\u662f\u4e3b\u8282\u70b9\u8fdb\u884c\uff0c\u5982\u679c\u662f\u5355\u673aMongoDB\uff0c\u5219\u5e94\u8be5\u5728\u7a7a\u95f4\u65f6\u95f4\u8fdb\u884c\u5907\u4efd\uff0c\u6bd4\u5982\u6df1\u591c\u51cc\u6668\u3002<\/p>\n
3\u3001\u6301\u4e45\u6027<\/strong><\/span><\/div>\n\u6301\u4e45\u6027\u662f\u6570\u636e\u5e93\u5fc5\u5907\u7684\u4e00\u79cd\u7279\u6027\uff0c\u60f3\u8c61\u4e00\u4e0b\uff0c\u5982\u679c\u6570\u636e\u5e93\u4e0d\u5177\u5907\u6301\u4e45\u6027\uff0c\u5982\u679c\u6570\u636e\u5e93\u91cd\u542f\uff0c\u6570\u636e\u5168\u90e8\u4e22\u5931\uff0c\u592a\u53ef\u6015\u4e86\uff0c\u4e0d\u6562\u60f3\u3002<\/p>\n
\u4e3a\u4e86\u5728\u670d\u52a1\u5668\u53d1\u751f\u6545\u969c\u65f6\u63d0\u4f9b\u6301\u4e45\u6027\uff0cMongoDB\u4f7f\u7528\u9884\u5199\u5f0f\u65e5\u5fd7\u673a\u5236\uff0c\u82f1\u6587\u7b80\u79f0 WAL\u3002WAL\u662f\u6570\u636e\u5e93\u7cfb\u7edf\u4e2d\u4e00\u79cd\u5e38\u89c1\u7684\u6301\u4e45\u6027\u6280\u672f\u3002\u5728\u6570\u636e\u5b58\u5165\u6570\u636e\u5e93\u4e4b\u524d\uff0c\u5c06\u8fd9\u4e9b\u66f4\u6539\u64cd\u4f5c\u5199\u5230\u78c1\u76d8\u4e0a\u3002<\/p>\n
\u4eceMongoDB4.0\u5f00\u59cb\uff0c\u6267\u884c\u5199\u64cd\u4f5c\u65f6\uff0cMongoDB\u4f1a\u4f7f\u7528\u4e0eoplog\u76f8\u540c\u7684\u683c\u5f0f\u521b\u5efa\u65e5\u5fd7\u3002oplog\u8bed\u53e5\u5177\u6709\u5e42\u7b49\u6027\uff0c\u4e0d\u7ba1\u6267\u884c\u591a\u5c11\u6b21\uff0c\u7ed3\u679c\u90fd\u662f\u4e00\u6837\u7684\u3002<\/p>\n
MongoDB\u8fd8\u7ef4\u62a4\u4e86\u65e5\u5fd7\u548c\u6570\u636e\u5e93\u6570\u636e\u6587\u4ef6\u7684\u5185\u5b58\u89c6\u56fe\u3002\u9ed8\u8ba4\u60c5\u51b5\uff0c\u6bcf50\u6beb\u79d2\u4f1a\u5c06\u65e5\u5fd7\u6761\u76ee\u5237\u65b0\u5230\u78c1\u76d8\u4e0a\uff0c\u6bcf60\u79d2\u4f1a\u5c06\u6570\u636e\u5e93\u6587\u4ef6\u5237\u65b0\u5230\u78c1\u76d8\u4e0a\u3002\u5237\u65b0\u6570\u636e\u7684\u65f6\u95f460\u79d2\u95f4\u9694\u88ab\u79f0\u4e3a\u68c0\u67e5\u70b9\u3002\u65e5\u5fd7\u7528\u4e8e\u5c06\u4e0a\u4e00\u4e2a\u68c0\u67e5\u70b9\u4e4b\u540e\u7684\u6570\u636e\u63d0\u4f9b\u6301\u4e45\u6027\u3002MongoDB\u7684\u6301\u4e45\u6027\u5c31\u662f\u5728\u53d1\u751f\u6545\u969c\u65f6\uff0c\u91cd\u542f\u4e4b\u540e\uff0c\u5c06\u65e5\u5fd7\u4e2d\u7684\u8bed\u53e5\u91cd\u65b0\u6267\u884c\u4e00\u904d\uff0c\u4ee5\u4fdd\u8bc1\u5728\u5173\u95ed\u524d\u4e22\u5931\u7684\u6570\u636e\u91cd\u65b0\u5237\u65b0\u5230MongoDB\u4e2d\u3002<\/p>\n
MongoDB\u4f1a\u5728data\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2ajournal\u7684\u5b50\u76ee\u5f55\uff0cWiredTiger\u65e5\u5fd7\u6587\u4ef6\u7684\u540d\u79f0\u4e3aWiredTigerLog.\u3002sequence\u662f\u4e00\u4e2a\u4ece0 000 000 001\u5f00\u59cb\u7684\u6570\u5b57\u3002<\/p>\n<\/p>\n
MongoDB\u4f1a\u5bf9\u5199\u5165\u7684\u65e5\u5fd7\u8fdb\u884c\u538b\u7f29\uff0c\u65e5\u5fd7\u6587\u4ef6\u9650\u5236\u7684\u6700\u5927\u5927\u5c0f\u4e3a100MB\u3002\u5982\u679c\u5927\u4e8e100MB\uff0cMongoDB\u5c31\u4f1a\u81ea\u52a8\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u7531\u4e8e\u65e5\u5fd7\u6587\u4ef6\u53ea\u9700\u5728\u4e0a\u6b21\u68c0\u67e5\u70b9\u4e4b\u540e\u6062\u590d\u6570\u636e\uff0c\u56e0\u6b64\u5728\u65b0\u7684\u68c0\u67e5\u70b9\u5199\u5165\u5b8c\u6210\u65f6\uff0c\u65e7\u7684\u65e5\u5fd7\u6587\u4ef6\u5c31\u4f1a\u88ab\u5220\u9664\u3002<\/sequence><\/p>\n","protected":false},"excerpt":{"rendered":"
\u6839\u672c\u4e0d\u7528\u4e3a\u4e86\u622a\u5c4f\u800c\u5feb\u901f\u64cd\u4f5c\uff0cMongoDB\u542f\u52a8\u771f\u7684\u8d85\u7ea7\u6162\u3002 \u5728MongoDB\u5173\u95ed\u4e4b\u524d\uff0c\u6709\u8f83\u5927\u7684\u7d22\u5f15\u5efa\u7acb\u7684\u64cd\u4f5c\u6ca1 […]<\/p>\n","protected":false},"author":1920,"featured_media":95922,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-264701","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\/264701","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\/1920"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=264701"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/264701\/revisions"}],"predecessor-version":[{"id":264723,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/264701\/revisions\/264723"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/95922"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=264701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=264701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=264701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}