{"id":1359,"date":"2023-03-19T10:12:33","date_gmt":"2023-03-19T02:12:33","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1359"},"modified":"2023-04-28T21:19:00","modified_gmt":"2023-04-28T13:19:00","slug":"install-mongodb-under-centos","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/19\/install-mongodb-under-centos\/","title":{"rendered":"CentOS\u4e0b\u5b89\u88c5MongoDB"},"content":{"rendered":"<p>MongoDB \u662f\u4e00\u4e2a\u57fa\u4e8e\u5206\u5e03\u5f0f\u6587\u4ef6\u5b58\u50a8\u7684\u6570\u636e\u5e93\u3002\u7531 C++ \u8bed\u8a00\u7f16\u5199\u3002\u65e8\u5728\u4e3a WEB \u5e94\u7528\u63d0\u4f9b\u53ef\u6269\u5c55\u7684\u9ad8\u6027\u80fd\u6570\u636e\u5b58\u50a8\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<p>MongoDB \u662f\u4e00\u4e2a\u4ecb\u4e8e\u5173\u7cfb\u6570\u636e\u5e93\u548c\u975e\u5173\u7cfb\u6570\u636e\u5e93\u4e4b\u95f4\u7684\u4ea7\u54c1\uff0c\u662f\u975e\u5173\u7cfb\u6570\u636e\u5e93\u5f53\u4e2d\u529f\u80fd\u6700\u4e30\u5bcc\uff0c\u6700\u50cf\u5173\u7cfb\u6570\u636e\u5e93\u7684\u3002<\/p>\n<p><!-- more --><\/p>\n<p>MongoDB \u5b98\u7f51\u5730\u5740\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.mongodb.com\/\">https:\/\/www.mongodb.com\/<\/a><br \/>\nMongoDB \u5b98\u65b9\u82f1\u6587\u6587\u6863\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/docs.mongodb.com\/manual\/\">https:\/\/docs.mongodb.com\/manual\/<\/a><br \/>\nMongoDB \u5404\u5e73\u53f0\u4e0b\u8f7d\u5730\u5740\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.mongodb.com\/download-center#community\">https:\/\/www.mongodb.com\/download-center#community<\/a><\/p>\n<h2>\u5b89\u88c5MongoDB<\/h2>\n<pre><code># wget https:\/\/fastdl.mongodb.org\/linux\/mongodb-linux-x86_64-rhel70-3.6.4.tgz\n# tar -zxf mongodb-linux-x86_64-rhel70-3.6.4.tgz -C \/usr\/local\/\n# mv \/usr\/local\/mongodb-linux-x86_64-rhel70-3.6.4\/ \/usr\/local\/mongodb\n# vim \/etc\/profile\n\nexport MONGO_HOME=\/usr\/local\/mongodb\nexport PATH=$PATH:$MONGO_HOME\/bin\n\n# source \/etc\/profile\n# mongo --version<\/code><\/pre>\n<h2>\u521b\u5efa\u6570\u636e\u5e93\u76ee\u5f55<\/h2>\n<p>MongoDB\u7684\u6570\u636e\u9ed8\u8ba4\u5b58\u50a8\u5728data\u76ee\u5f55\u7684db\u76ee\u5f55\u4e0b\uff0c\u4f46\u662f\u8fd9\u4e2a\u76ee\u5f55\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e0d\u4f1a\u81ea\u52a8\u521b\u5efa\uff0c\u6240\u4ee5\u9700\u8981\u624b\u52a8\u521b\u5efadata\/db\u76ee\u5f55<\/p>\n<pre><code>mkdir -p \/data\/db<\/code><\/pre>\n<blockquote>\n<p>\u6ce8\u610f\uff1a\u5982\u679c\u6570\u636e\u5e93\u76ee\u5f55\u4e0d\u662f\/data\/db\uff0c\u53ef\u4ee5\u901a\u8fc7 &#8211;dbpath \u6765\u6307\u5b9a\u3002<\/p>\n<\/blockquote>\n<h2>\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c MongoDB \u670d\u52a1<\/h2>\n<p>\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u6267\u884cmongod\u547d\u4ee4\u542f\u52a8mongdb\u670d\u52a1\u3002<\/p>\n<pre><code># mkdir \/data\/mongo\n# screen\n# mongod --dbpath \/data\/mongo<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>MongoDB \u662f\u4e00\u4e2a\u57fa\u4e8e\u5206\u5e03\u5f0f\u6587\u4ef6\u5b58\u50a8\u7684\u6570\u636e\u5e93\u3002\u7531 C++ \u8bed\u8a00\u7f16\u5199\u3002\u65e8\u5728\u4e3a WEB \u5e94\u7528\u63d0\u4f9b\u53ef\u6269\u5c55\u7684\u9ad8\u6027\u80fd [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[333],"tags":[154],"class_list":["post-1359","post","type-post","status-publish","format-standard","hentry","category-install-deploy","tag-mongodb"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1359","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1359"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1359\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}