{"id":2142,"date":"2022-09-17T10:42:28","date_gmt":"2022-09-17T01:42:28","guid":{"rendered":"http:\/\/www.agile-software.site\/?p=2142"},"modified":"2022-09-17T10:42:28","modified_gmt":"2022-09-17T01:42:28","slug":"mongodb%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab","status":"publish","type":"post","link":"https:\/\/agile-software.net\/?p=2142","title":{"rendered":"mongodb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},"content":{"rendered":"\n<p>\u30ea\u30dd\u30b8\u30c8\u30ea\uff08\u30d1\u30c3\u30b1\u30fc\u30b8\uff09\u306e\u8eab\u5143\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306bGPG\u30ad\u30fc\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>wget -qO - https:\/\/www.mongodb.org\/static\/pgp\/server-4.4.asc | sudo apt-key add -<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u30ea\u30dd\u30b8\u30c8\u30ea\u5b9a\u7fa9\u3092\u4fdd\u5b58<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>echo &quot;deb [ arch=amd64,arm64 ] https:\/\/repo.mongodb.org\/apt\/ubuntu focal\/mongodb-org\/4.4 multiverse&quot; | sudo tee \/etc\/apt\/sources.list.d\/mongodb-org-4.4.list<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">apt\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>sudo apt-get -y install mongodb-org<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">MongoDB\u306e\u8d77\u52d5<\/h3>\n\n\n\n<p><strong><code>--dbpath<\/code><\/strong>\u00a0\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u306e\u683c\u7d0d\u5148\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br>\u00a0\u4e0b\u8a18\u306e\u4f8b\u3067\u306f\u3001mongo\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30c7\u30fc\u30bf\u683c\u7d0d\u5148\u306b\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>mongod --dbpath mongo<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">MongoDB\u30b7\u30a7\u30eb<\/h3>\n\n\n\n<p>\u65b0\u3057\u304f\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u8d77\u52d5\u3057mongo\u3068\u5165\u529b\u3059\u308b\u3068<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>mongo<\/code><\/pre><\/div>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>MongoDB shell version v4.4.16\nconnecting to: mongodb:\/\/127.0.0.1:27017\/?compressors=disabled&gssapiServiceName=mongodb\nImplicit session: session { &quot;id&quot; : UUID(&quot;2a40ce55-f0c0-4a15-aa6c-f0030cfa0f68&quot;) }\nMongoDB server version: 4.4.16\nWelcome to the MongoDB shell.\nFor interactive help, type &quot;help&quot;.\nFor more comprehensive documentation, see\n        https:\/\/docs.mongodb.com\/\nQuestions? Try the MongoDB Developer Community Forums\n        https:\/\/community.mongodb.com\n---\nThe server generated these startup warnings when booting: \n        2022-09-17T10:13:34.086+09:00: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http:\/\/dochub.mongodb.org\/core\/prodnotes-filesystem\n        2022-09-17T10:13:34.452+09:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted\n        2022-09-17T10:13:34.452+09:00: This server is bound to localhost. Remote systems will be unable to connect to this server. Start the server with --bind_ip &lt;address&gt; to specify which IP addresses it should serve responses from, or with --bind_ip_all to bind to all interfaces. If this behavior is desired, start the server with --bind_ip 127.0.0.1 to disable this warning\n        2022-09-17T10:13:34.452+09:00: \/sys\/kernel\/mm\/transparent_hugepage\/enabled is &#39;always&#39;. We suggest setting it to &#39;never&#39;\n---\n---\n        Enable MongoDB&#39;s free cloud-based monitoring service, which will then receive and display\n        metrics about your deployment (disk utilization, CPU, operation statistics, etc).\n\n        The monitoring data will be available on a MongoDB website with a unique URL accessible to you\n        and anyone you share the URL with. MongoDB may use this information to make product\n        improvements and to suggest MongoDB products and deployment options to you.\n\n        To enable free monitoring, run the following command: db.enableFreeMonitoring()\n        To permanently disable this reminder, run the following command: db.disableFreeMonitoring()\n---\n&gt; db\ntest\n&gt; 1+1\n2<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u4f5c\u6210<\/h2>\n\n\n\n<p>use\u3092\u4f7f\u3046\u3053\u3068\u3067\u3069\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f7f\u3046\u306e\u304b\u5909\u66f4\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>use animalShelter<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>show dbs\n\nshow collections\n\ndb.cats.find()<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u30ea\u30dd\u30b8\u30c8\u30ea\uff08\u30d1\u30c3\u30b1\u30fc\u30b8\uff09\u306e\u8eab\u5143\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306bGPG\u30ad\u30fc\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u30ea\u30dd\u30b8\u30c8\u30ea\u5b9a\u7fa9\u3092\u4fdd\u5b58 apt\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb MongoDB\u306e\u8d77\u52d5 &#8211;dbpath\u00a0\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u306e\u683c\u7d0d\u5148\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u6307\u5b9a\u3059\u308b\u3053<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jin_ogp_image_url":"","_jin_last_featured_id":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2142","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/2142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2142"}],"version-history":[{"count":1,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/2142\/revisions"}],"predecessor-version":[{"id":2143,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/2142\/revisions\/2143"}],"wp:attachment":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}