{"id":2959,"date":"2024-07-07T11:20:03","date_gmt":"2024-07-07T03:20:03","guid":{"rendered":"http:\/\/www.plm.cn\/?p=2959"},"modified":"2024-07-07T13:51:33","modified_gmt":"2024-07-07T05:51:33","slug":"mongodb%e5%bc%80%e6%94%be%e5%a4%96%e7%bd%91%e8%ae%bf%e9%97%ae%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.plm.cn\/2959\/","title":{"rendered":"mongodb\u5f00\u653e\u5916\u7f51\u8bbf\u95ee\u7684\u65b9\u6cd5"},"content":{"rendered":"
mongodb\u5b89\u88c5\u5728\u670d\u52a1\u5668192.168.0.208 \uff0c\u5b89\u88c5\u540e\u9ed8\u8ba4\u53ea\u80fd\u901a\u8fc7127.0.0.1 \u6765\u8bbf\u95ee\uff0c\u82e5\u522b\u7684\u673a\u5668\u5e0c\u671b\u901a\u8fc7IP\uff08192.168.0.208\uff09\u6765\u8bbf\u8bbf\u95ee\uff0c\u6211\u4eec\u5c31\u9700\u8981\u505a\u5982\u4e0b\u51c6\u5907<\/p>\n
\u4e3a\u4e86\u5728MongoDB\u5f00\u653e\u5916\u7f51\u8bbf\u95ee\uff0c\u4f60\u9700\u8981\u505a\u4ee5\u4e0b\u51e0\u6b65\uff1a<\/p>\n
1\uff09\u786e\u4fddMongoDB\u5b9e\u4f8b\u6b63\u5728\u76d1\u542c\u5916\u90e8\u63a5\u53e3\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cMongoDB\u53ea\u76d1\u542c\u672c\u5730\u63a5\u53e3\u3002<\/p>\n<\/div>\n
2\uff09\u914d\u7f6e\u9632\u706b\u5899\u5141\u8bb8\u5916\u90e8\u8bbf\u95eeMongoDB\u7684\u7aef\u53e3\uff08\u9ed8\u8ba4\u4e3a27017\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u6539\u8fdb\uff0c\u6bd4\u5982 8041\uff09\u3002<\/p>\n<\/div>\n
3\uff09\u786e\u4fddMongoDB\u914d\u7f6e\u6587\u4ef6\uff08\u901a\u5e38\u4e3a 4\uff09\u5982\u679cMongoDB\u4f7f\u7528 5\uff09\u5982\u679cMongoDB\u4f7f\u7528\u8bbf\u95ee\u63a7\u5236\uff0c\u786e\u4fdd\u5df2\u7ecf\u4e3a\u8981\u8bbf\u95ee\u7684\u7528\u6237\u6388\u6743\u5916\u7f51\u8bbf\u95ee\u3002<\/p>\n <\/p>\n \u6d4b\u8bd5\u53d1\u73b0\uff1a<\/p>\n 127.0.0.1:8041 \u901a \uff1b<\/p>\n \u800c 192.168.0.208:8041\u00a0 \u4e0d\u901a\u00a0 \uff08\u8fd9\u6837\u522b\u7684\u670d\u52a1\u5c31\u65e0\u6cd5\u901a\u8fc7 192.168.0.208 \u8bbf\u95ee\u8fd9\u4e2amongodb \uff1b\u6216\u8005\u8fd9\u4e2a mongodb \u7cfb\u7edf\u60f3\u901a\u8fc7\u7aef\u53e3\u6620\u5c04\u53d1\u5e03\u5230\u5916\u7f51\u4e5f\u662f\u4e0d\u884c\u7684\uff09<\/span><\/p>\n<\/div>\n \u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\u914d\u7f6e\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u4fee\u6539 \u6848\u4f8b\u91cc\u9762\u7684\u6587\u4ef6\u5730\u5740\uff0c\u7aef\u53e3 \u8981\u6839\u636e\u81ea\u5df1\u7684\u90e8\u7f72\u73af\u5883\u6765\u8bbe\u7f6e<\/p>\n \u4fee\u6539\u540e\uff0c\u8981\u91cd\u542fmongodb \u670d\u52a1<\/p>\n systemLog: \u82e5\u662f\u90e8\u7f72\u4e86Mobox3\u670d\u52a1\u7684\u7cfb\u7edf\uff0c\u5f53mongodb \u7aef\u53e3\u4fee\u6539\u540e\uff0c\u7ba1\u7406\u670d\u52a1\u4e5f\u9700\u8981\u8ddf\u7740\u8c03\u6574<\/p>\n 1\uff09\u9700\u8981\u6253\u5f00\uff1a\\OpenInfo\\OIServer\\OIMongoService\\config.yaml<\/p>\n \u5bf9\u91cc\u9762\u7684\u5185\u5bb9\uff08\u6839\u636emongodb\u914d\u7f6e\u7684\u7aef\u53e3\u8fdb\u884c\u8c03\u6574\uff09\uff1a<\/p>\n \u00a0host: mongodb:\/\/127.0.0.1:8041<\/span><\/p>\n 2\uff09\u9700\u8981\u6253\u5f00\uff1a\\OpenInfo\\OIServer\\filebeat\\filebeat.yml<\/p>\n \u5bf9\u91cc\u9762\u7684\u5185\u5bb9\uff08\u6839\u636emongodb\u914d\u7f6e\u7684\u7aef\u53e3\u8fdb\u884c\u8c03\u6574\uff09\uff1a<\/p>\n hosts: [mongodb:\/\/127.0.0.1:8041]<\/span><\/p>\n 3\uff09\u4fee\u6539\u540e \u91cd\u542f \uff1a<\/p>\n filebeat \u670d\u52a1<\/p>\n OIMongoService \u670d\u52a1<\/p>\n <\/p>\n <\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":" mongodb\u5b89\u88c5\u5728\u670d\u52a1\u5668192.168.0.208 \uff0c\u5b89\u88c5\u540e\u9ed8\u8ba4\u53ea\u80fd\u901a\u8fc7127.0.0.1 \u6765\u8bbf\u95ee\uff0c\u82e5\u522b\u7684\u673a […]<\/p>\n","protected":false},"author":1,"featured_media":2961,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,9],"tags":[13],"class_list":["post-2959","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-plmcenter","category-pcdoc","tag-shouche"],"_links":{"self":[{"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/posts\/2959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/comments?post=2959"}],"version-history":[{"count":11,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/posts\/2959\/revisions"}],"predecessor-version":[{"id":2972,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/posts\/2959\/revisions\/2972"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/media\/2961"}],"wp:attachment":[{"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/media?parent=2959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/categories?post=2959"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.plm.cn\/wp-json\/wp\/v2\/tags?post=2959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}mongod.conf<\/code>\u6216
mongodb.conf<\/code>\uff09\u4e2d\u6ca1\u6709\u7981\u6b62\u5916\u90e8\u8bbf\u95ee\u7684\u8bbe\u7f6e\u3002<\/p>\n<\/div>\n
bindIp<\/code>\u9009\u9879\uff0c\u786e\u4fdd\u5b83\u88ab\u6b63\u786e\u914d\u7f6e\u4e3a\u76d1\u542c\u5916\u90e8\u63a5\u53e3\u6216\u901a\u914d\u7b26
0.0.0.0<\/code>\u3002<\/p>\n<\/div>\n
\u91c7\u7528\u9ed8\u8ba4 127.0.0.1 \u8bbf\u95ee\u65f6\u5019\u7684\u6d4b\u8bd5\u6548\u679c<\/h3>\n
conf \u6587\u4ef6\u6848\u4f8b<\/h4>\n
mongod.conf<\/code>\u6765\u5141\u8bb8\u5916\u7f51\u8bbf\u95ee\uff08\u53ca\u6539\u7aef\u53e3 \u84dd\u8272\u6587\u5b57\u8868\u793a\uff09\uff1a<\/p>\n
\n
\ndestination: file
\npath: C:\/OData\/Mongodb\/Log\/mongodb.log
\nlogAppend: true
\nstorage:
\njournal:
\nenabled: true
\ndbPath: C:\/OData\/Mongodb\/Db
\ndirectoryPerDB: true
\nsecurity:
\nauthorization: disabled
\nprocessManagement:
\nwindowsService:
\nserviceName: MongoDB
\ndisplayName: MongoDB
\ndescription: MongoDB
\nnet:
\n\u00a0 port: 8041<\/span>
\n\u00a0 bindIp: 0.0.0.0<\/span>
\nsetParameter:
\nenableLocalhostAuthBypass: false<\/p>\n<\/div>\n
\nmobox3\u7cfb\u7edf\u914d\u7f6e\u5bf9\u5e94\u8c03\u6574<\/h4>\n