{"id":29389,"date":"2023-05-16T13:30:04","date_gmt":"2023-06-29T10:53:19","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mongodb%ef%bc%88centos%e3%80%81amazon-linux%ef%bc%89\/"},"modified":"2025-08-12T13:52:32","modified_gmt":"2025-08-12T05:52:32","slug":"%e5%ae%89%e8%a3%85mongodb%ef%bc%88centos%e3%80%81amazon-linux%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mongodb%ef%bc%88centos%e3%80%81amazon-linux%ef%bc%89\/","title":{"rendered":"\u5b89\u88c5MongoDB\uff08CentOS\u3001Amazon Linux\uff09"},"content":{"rendered":"<h2>\u66f4\u65b0Yum<\/h2>\n<pre class=\"post-pre\"><code>yum update -y\r\n<\/code><\/pre>\n<h2>\u6dfb\u52a0\u4ed3\u5e93<\/h2>\n<pre class=\"post-pre\"><code>vi \/etc\/yum.repos.d\/mongodb-org-3.4.repo\r\n<\/code><\/pre>\n<h3>\u25a0 \u9488\u5bf9CentOS\u64cd\u4f5c\u7cfb\u7edf\u7684\u60c5\u51b5<\/h3>\n<pre class=\"post-pre\"><code>[mongodb-org-3.4]\r\nname=MongoDB Repository\r\nbaseurl=https:\/\/repo.mongodb.org\/yum\/redhat\/$releasever\/mongodb-org\/3.4\/x86_64\/\r\ngpgcheck=1\r\nenabled=1\r\ngpgkey=https:\/\/www.mongodb.org\/static\/pgp\/server-3.4.asc\r\n<\/code><\/pre>\n<h3>\u25a0 \u5728Amazon Linux\u7684\u60c5\u51b5\u4e0b<\/h3>\n<pre class=\"post-pre\"><code>[mongodb-org-3.4]\r\nname=MongoDB Repository\r\nbaseurl=http:\/\/repo.mongodb.org\/yum\/amazon\/2013.03\/mongodb-org\/3.4\/x86_64\/\r\ngpgcheck=0\r\nenabled=1\r\n<\/code><\/pre>\n<h2>\u5b89\u88c5<\/h2>\n<pre class=\"post-pre\"><code>yum install -y mongodb-org\r\n<\/code><\/pre>\n<h2>\u7981\u7528SELinux<\/h2>\n<p>\u203b \u4e9a\u9a6c\u900a Linux \u4ece\u4e00\u5f00\u59cb\u5c31\u662f\u7981\u7528\u7684\uff0c\u56e0\u6b64\u4e0d\u9700\u8981\u3002<\/p>\n<pre class=\"post-pre\"><code>getenforce\r\nsetenforce 0\r\nsed -i 's\/SELINUX=enforcing\/SELINUX=disabled\/' \/etc\/selinux\/config\r\n<\/code><\/pre>\n<h2>\u542f\u52a8<\/h2>\n<h3>\u25a0 \u5982\u679c\u662f CentOS \u64cd\u4f5c\u7cfb\u7edf<\/h3>\n<pre class=\"post-pre\"><code>systemctl start mongod\r\nsystemctl enable mongod\r\n<\/code><\/pre>\n<h3>\u25a0 \u5bf9\u4e8eAmazon Linux\u60c5\u51b5\u4e0b<\/h3>\n<pre class=\"post-pre\"><code>\/etc\/init.d\/mongod start\r\nchkconfig mongod on\r\n<\/code><\/pre>\n<h2>\u786e\u8ba4\u542f\u52a8<\/h2>\n<pre class=\"post-pre\"><code>cat \/var\/log\/mongodb\/mongod.log\r\n2017-07-25T09:51:17.306+0000 I NETWORK  [thread1] waiting for connections on port 27017\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u66f4\u65b0Yum yum update -y \u6dfb\u52a0\u4ed3\u5e93 vi \/etc\/yum.repos.d\/mongodb-or [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[227],"class_list":["post-29389","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-227"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5b89\u88c5MongoDB\uff08CentOS\u3001Amazon Linux\uff09 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u5173\u4e8e\u5b89\u88c5MongoDB\uff08CentOS\u3001Amazon Linux\uff09\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5b89\u88c5mongodb\uff08centos\u3001amazon-linux\uff09\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5b89\u88c5MongoDB\uff08CentOS\u3001Amazon Linux\uff09\" \/>\n<meta property=\"og:description\" content=\"\u5173\u4e8e\u5b89\u88c5MongoDB\uff08CentOS\u3001Amazon Linux\uff09\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5b89\u88c5mongodb\uff08centos\u3001amazon-linux\uff09\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-29T10:53:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-12T05:52:32+00:00\" \/>\n<meta name=\"author\" content=\"\u5b87, \u534e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5b87, \u534e\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mongodb%ef%bc%88centos%e3%80%81amazon-linux%ef%bc%89\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mongodb%ef%bc%88centos%e3%80%81amazon-linux%ef%bc%89\/\",\"name\":\"\u5b89\u88c5MongoDB\uff08CentOS\u3001Amazon Linux\uff09 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-06-29T10:53:19+00:00\",\"dateModified\":\"2025-08-12T05:52:32+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\"},\"description\":\"\u5173\u4e8e\u5b89\u88c5MongoDB\uff08CentOS\u3001Amazon Linux\uff09\u7684\u6280\u672f\u6587\u7ae0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mongodb%ef%bc%88centos%e3%80%81amazon-linux%ef%bc%89\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mongodb%ef%bc%88centos%e3%80%81amazon-linux%ef%bc%89\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mongodb%ef%bc%88centos%e3%80%81amazon-linux%ef%bc%89\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5b89\u88c5MongoDB\uff08CentOS\u3001Amazon Linux\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\",\"name\":\"\u5b87, \u534e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"caption\":\"\u5b87, \u534e\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mongodb%ef%bc%88centos%e3%80%81amazon-linux%ef%bc%89\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5b89\u88c5MongoDB\uff08CentOS\u3001Amazon Linux\uff09 - Blog - Silicon Cloud","description":"\u5173\u4e8e\u5b89\u88c5MongoDB\uff08CentOS\u3001Amazon Linux\uff09\u7684\u6280\u672f\u6587\u7ae0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u5b89\u88c5mongodb\uff08centos\u3001amazon-linux\uff09\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5b89\u88c5MongoDB\uff08CentOS\u3001Amazon Linux\uff09","og_description":"\u5173\u4e8e\u5b89\u88c5MongoDB\uff08CentOS\u3001Amazon Linux\uff09\u7684\u6280\u672f\u6587\u7ae0","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5b89\u88c5mongodb\uff08centos\u3001amazon-linux\uff09\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-06-29T10:53:19+00:00","article_modified_time":"2025-08-12T05:52:32+00:00","author":"\u5b87, \u534e","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u5b87, \u534e","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mongodb%ef%bc%88centos%e3%80%81amazon-linux%ef%bc%89\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mongodb%ef%bc%88centos%e3%80%81amazon-linux%ef%bc%89\/","name":"\u5b89\u88c5MongoDB\uff08CentOS\u3001Amazon Linux\uff09 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-06-29T10:53:19+00:00","dateModified":"2025-08-12T05:52:32+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458"},"description":"\u5173\u4e8e\u5b89\u88c5MongoDB\uff08CentOS\u3001Amazon Linux\uff09\u7684\u6280\u672f\u6587\u7ae0","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mongodb%ef%bc%88centos%e3%80%81amazon-linux%ef%bc%89\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mongodb%ef%bc%88centos%e3%80%81amazon-linux%ef%bc%89\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mongodb%ef%bc%88centos%e3%80%81amazon-linux%ef%bc%89\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5b89\u88c5MongoDB\uff08CentOS\u3001Amazon Linux\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458","name":"\u5b87, \u534e","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","caption":"\u5b87, \u534e"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%ae%89%e8%a3%85mongodb%ef%bc%88centos%e3%80%81amazon-linux%ef%bc%89\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/29389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=29389"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/29389\/revisions"}],"predecessor-version":[{"id":56665,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/29389\/revisions\/56665"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=29389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=29389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=29389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}