{"id":934,"date":"2019-10-04T02:45:27","date_gmt":"2019-10-03T17:45:27","guid":{"rendered":"https:\/\/took.jp\/?p=934"},"modified":"2020-06-15T15:18:03","modified_gmt":"2020-06-15T06:18:03","slug":"post-934","status":"publish","type":"post","link":"https:\/\/took.jp\/tech-blog\/post-934\/","title":{"rendered":"\u3010\u521d\u3081\u3066\u306enodejs\u3011CentOS7\u3067nodejs\u306e\u958b\u767a\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u3001\u52d5\u304b\u3057\u3066\u307f\u308b"},"content":{"rendered":"<p>nodejs\u306e\u958b\u767a\u74b0\u5883\u3092\u521d\u3081\u3066\u69cb\u7bc9\u3057\u305f\u306e\u3067\u3059\u304c\u3001\u3068\u3066\u3082\u7c21\u5358\u3067\u3057\u305f\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001\u74b0\u5883\u69cb\u7bc9\u306e\u65b9\u6cd5\u3068\u5b9f\u969b\u306bnode\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u52d5\u304b\u3057\u3066\u52d5\u4f5c\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3053\u308d\u307e\u3067\u3092\u3054\u7d39\u4ecb\u3044\u305f\u3057\u307e\u3059\u3002<\/p>\n<p>\u53c2\u8003\uff1ahttps:\/\/qiita.com\/daskepon\/items\/16a77868d38f8e585840<\/p>\n<p>&nbsp;<\/p>\n<p>\u30ea\u30dd\u30b8\u30c8\u30ea\u8ffd\u52a0<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">curl -sL https:\/\/rpm.nodesource.com\/setup_8.x | sudo bash -<\/code><\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">sudo yum install nodejs<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">node -v<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u4ee5\u4e0a\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u307e\u3067\u304c\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<p>\u3053\u3053\u307e\u3067\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u5834\u5408\u306b\u306f\u3001\u4eee\u60f3\u30de\u30b7\u30f3\u3068\u306e\u5171\u6709\u30d5\u30a9\u30eb\u30c0\u3067\u4f5c\u696d\u3092\u3057\u3066\u3044\u306a\u3044\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u5171\u6709\u30d5\u30a9\u30eb\u30c0\u3067\u4f5c\u696d\u3092\u3057\u305f\u5834\u5408\u306b\u306f\u30a8\u30e9\u30fc\u304c\u8d77\u3053\u308b\u3053\u3068\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u6b21\u306bnode.js\u3068\u76f8\u6027\u306e\u826f\u3044mongoDB\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<p>\u53c2\u8003\uff1ahttps:\/\/qiita.com\/daskepon\/items\/aa93f8955407da0cb896<\/p>\n<p>&nbsp;<\/p>\n<p>\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u8ffd\u52a0<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">sudo vim \/\/etc\/yum.repos.d\/mongodb-org-4.0.repo<\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">[mongodb-org-4.0]\r\nname=MongoDB Repository\r\nbaseurl=https:\/\/repo.mongodb.org\/yum\/redhat\/$releasever\/mongodb-org\/4.0\/x86_64\/\r\ngpgcheck=1\r\nenabled=1\r\ngpgkey=https:\/\/www.mongodb.org\/static\/pgp\/server-4.0.asc<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u3092\u8a18\u8f09\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">sudo yum install mongodb-org<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u8d77\u52d5<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">sudo systemctl start mongod<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u6700\u5f8c\u306b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3066\u52d5\u304b\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><a href=\"https:\/\/paiza.hatenablog.com\/entry\/2018\/06\/08\/paizacloud_nodejs\" target=\"_blank\" rel=\"noopener noreferrer\">\u3053\u3061\u3089<\/a>\u306e\u8a18\u4e8b\u306e\u901a\u308a\u9032\u3081\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u6700\u5f8c\u307e\u3067\u884c\u3046\u3068\u3001TODO\u30ea\u30b9\u30c8\u7ba1\u7406\u30b5\u30a4\u30c8\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u8a18\u4e8b\u306e\u306a\u304b\u3067\u306fPaiza Cloud\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u304c\u3001<\/p>\n<p>Centos\u5185\u306b\u74b0\u5883\u3092\u69cb\u7bc9\u6e08\u307f\u306a\u306e\u3067\u3001Cloud\u3092\u5229\u7528\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u307e\u305f\u3001\u5229\u7528\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u7121\u6599\u7248\u3060\u3068\u4f5c\u6210\u304b\u308924\u6642\u9593\u307e\u3067\u3057\u304b\u5229\u7528\u304c\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u4f5c\u6210\u3067\u304d\u305f\u3089\u3001mongoDB\u306e\u4e2d\u306b\u5024\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u306e\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">show dbs<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u3067DB\u4e00\u89a7\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>server.js\u3067mydb\u306b\u767b\u9332\u3059\u308b\u3088\u3046\u9078\u629e\u3057\u3066\u3044\u305f\u306e\u3067\u3001mydb\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">use mydb<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ed6DB\u3067\u3044\u3046\u30c6\u30fc\u30d6\u30eb\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">show collections<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>todos\u3068\u3044\u3046\u8868\u793a\u304c\u51fa\u305f\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u4e2d\u306b\u5024\u304c\u5165\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u4e2d\u8eab\u3092\u3059\u3079\u3066\u8868\u793a\u3055\u305b\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">db.todos.find()<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u3053\u308c\u3067TODO\u30ea\u30b9\u30c8\u306b\u767b\u9332\u3057\u305f\u4e00\u89a7\u304c\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u305d\u306e\u4ed6\u3001\u64cd\u4f5c\u30b3\u30de\u30f3\u30c9\u3092\u78ba\u8a8d\u3057\u305f\u3044\u5834\u5408\u306f\u3001<a href=\"https:\/\/qiita.com\/svjunic\/items\/285e9cf20169d70aa1fa\" target=\"_blank\" rel=\"noopener noreferrer\">\u3053\u3061\u3089<\/a>\u306e\u8a18\u4e8b\u304c\u304a\u3059\u3059\u3081\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>nodejs\u306e\u958b\u767a\u74b0\u5883\u3092\u521d\u3081\u3066\u69cb\u7bc9\u3057\u305f\u306e\u3067\u3059\u304c\u3001\u3068\u3066\u3082\u7c21\u5358\u3067\u3057\u305f\u3002 \u4eca\u56de\u306f\u3001\u74b0\u5883\u69cb\u7bc9\u306e\u65b9\u6cd5\u3068\u5b9f\u969b\u306bnode\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u52d5\u304b\u3057\u3066\u52d5\u4f5c\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3053\u308d\u307e\u3067\u3092\u3054\u7d39\u4ecb\u3044\u305f\u3057\u307e\u3059\u3002 \u53c2\u8003\uff1ahttps:\/\/qiita.com\/daskepon\/it\u2026<\/p>\n","protected":false},"author":3,"featured_media":1910,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62,64,79],"tags":[],"class_list":["post-934","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-it","category-nodejs","category-79"],"_links":{"self":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/posts\/934","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/comments?post=934"}],"version-history":[{"count":0,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/posts\/934\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/media\/1910"}],"wp:attachment":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/media?parent=934"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/categories?post=934"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/tags?post=934"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}