Could not resolve hostのエラー 解決した

2017.04.09 Sunday 03:51
0
    Could not resolve hostのエラー
    ぐぐって調べるとネットワーク系のえらーっぽい。
    外の公共の無線LANつかっている際にえらーになったが
    自宅かえっておなじことをやると、無事にうまくいった

    [root@localhost install]# rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
    curl: (6) Could not resolve host: artifacts.elastic.co; Unknown error
    error: https://artifacts.elastic.co/GPG-KEY-elasticsearch: import read failed(2).
    [root@localhost install]#

    インストールしてもエラーになる
    [root@localhost install]# yum install kibana
    Loaded plugins: fastestmirror
    ・・・
    Downloading packages:
    kibana-5.3.0-x86_64.rpm FAILED
    https://artifacts.elastic.co/packages/5.x/yum/5.3.0/kibana-5.3.0-x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: artifacts.elastic.co; Unknown error"
    Trying other mirror.
    Error downloading packages:
    kibana-5.3.0-1.x86_64: [Errno 256] No more mirrors to try.
    category:サーバー | by:ittoocomments(0)trackbacks(0) | -

    Vagrantで仮想マシンのメモリサイズを変更する方法

    2017.04.08 Saturday 21:56
    0
      Vagrantで仮想マシンのメモリサイズを変更する方法
      Vagrantfile でMB単位で指定する。以下は2GBに設定した

      Vagrant.configure(2) do |config|
      config.vm.provider "virtualbox" do |vb|
      vb.memory = "2048"
      end
      end
      ↑メモリ割り当てを2Gにしました。

      仮想マシンを起動でメモリサイズ確認。

      -bash-4.2$ free -m
      total used free shared buff/cache available
      Mem: 1840 105 1498 8 236 1599
      Swap: 999 0 999
      -bash-4.2$
      2G割り当てられてました
      category:vagrant | by:ittoocomments(0)trackbacks(0) | -

      linux 自分のipアドレスを調べるのにipコマンドをつかおう

      2017.04.08 Saturday 15:33
      0
        linux 自分のipアドレスを調べる
        ipコマンドを使う ip aでわかる
        以下、vagrant環境でやってみたよ

        [root@localhost log]# ip a
        1: lo: mtu 65536 qdisc noqueue state UNKNOWN
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
        valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host
        valid_lft forever preferred_lft forever
        2: enp0s3: mtu 1500 qdisc pfifo_fast state UP qlen 1000
        link/ether 08:00:27:6c:3e:95 brd ff:ff:ff:ff:ff:ff
        inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
        valid_lft 56532sec preferred_lft 56532sec
        inet6 fe80::a00:27ff:fe6c:3e95/64 scope link
        valid_lft forever preferred_lft forever
        3: enp0s8: mtu 1500 qdisc pfifo_fast state UP qlen 1000
        link/ether 08:00:27:be:06:ae brd ff:ff:ff:ff:ff:ff
        inet 192.168.33.10/24 brd 192.168.33.255 scope global enp0s8 ★これ
        valid_lft forever preferred_lft forever
        inet6 fe80::a00:27ff:febe:6ae/64 scope link
        valid_lft forever preferred_lft forever
        [root@localhost log]#
        category:サーバー | by:ittoocomments(0)trackbacks(0) | -

        キャッシュとバッファの違い

        2017.04.08 Saturday 15:15
        0
          パソコンやサーバーにおけるキャッシュとバッファの違い

          両方、物理的にいえばメモリ。意味合いとしても両方、記憶領域になる。

          ・キャッシュとは
          キャッシュは、使用頻度の高いデーターを蓄えておき、即時実行できるようにするメモリ
          ある領域から他の領域へ情報を転送する際、その転送遅延を極力隠蔽化させ転送効率を向上させるためにの記憶階層の実現手段。
          性能の向上に役立てる為の仕組。

          ・バッファとは
          バッファは、処理速度や転送速度の差を補うためにデータを一時的に保存しておくメモリ
          入出力と処理との間で時間のズレを吸収・調整をするために一時的に情報を記憶する装置や記憶領域のこと。
          クッション的な使われ方。
          category:サーバー | by:ittoocomments(0)trackbacks(0) | -

          ポート番号を調べるのに lsofコマンドが便利なのでメモ

          2017.04.08 Saturday 15:09
          0
            ポート番号を調べるのに lsofコマンドが便利なのでメモ

            lsofコマンドの使い方
            lsofとは
            PortやPID、プロセス名からファイルがオープンしている情報を表示するコマンド。
            lsofを使ってプロセスが利用しているポートを確認

            lsof -i
            オプション-i:ポート番号でそのポートを利用しているプロセスを調べることができます。

            以下だとapacheが post番号80をつかってる
            [root@localhost install]# lsof -i:80
            COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
            httpd 14063 root 4u IPv6 161290 0t0 TCP *:http (LISTEN)
            httpd 14064 apache 4u IPv6 161290 0t0 TCP *:http (LISTEN)
            httpd 14065 apache 4u IPv6 161290 0t0 TCP *:http (LISTEN)
            httpd 14066 apache 4u IPv6 161290 0t0 TCP *:http (LISTEN)
            httpd 14067 apache 4u IPv6 161290 0t0 TCP *:http (LISTEN)
            httpd 14068 apache 4u IPv6 161290 0t0 TCP *:http (LISTEN)
            [root@localhost install]#


            あるプロセスが開いているポート番号を調べる方法
            lsof コマンドを使うとプロセスが開いているファイル(ソケットも含む)を見れるのをそれを使う。
            -n は名前解決しないためのオプション。-P はポート番号をポート名に変換しないようするオプション


            lsofコマンドは名前解決をかってにしちゃうし、ポート番号をポート名に変えて表示してしまうためわかりにくい。
            -n は名前解決しないためのオプション。-P はポート番号をポート名に変換しないようするオプション をつけるとわかりやすい
            たくさんでるので grep TCP とかつけるとわかりやすい

            [root@localhost kibana]# lsof -n -P | grep TCP ★これめっちゃつかえる
            sshd 918 root 3u IPv4 14590 0t0 TCP *:22 (LISTEN)


            ポート番号から、プロセスIDを調べる場合は lsof -i:[PORT]
            ※ 補足: ホスト名まで指定する場合は -i@[HOST]:[PORT]

            [root@localhost kibana]# lsof -P -i:5601
            COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
            node 6358 kibana 10u IPv4 26876 0t0 TCP localhost:5601 (LISTEN)
            [root@localhost kibana]#
            category:サーバー | by:ittoocomments(0)trackbacks(0) | -

            elasticsearchをvagrant環境につくったcentOSにインストール

            2017.04.08 Saturday 14:38
            0
              elasticsearchをvagrant環境につくったcentOSにインストール

              --------------------------------------------------------------------------------------------
              概要

              ▼1 # yum install java-1.8.0-openjdk
              ▼2 # java -version
              ▼3 # rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
              ▼4 # repoファイル作成
              vi /etc/yum.repos.d/elasticsearch.repo
              ▼5 # yum install elasticsearch -y
              ▼6 # elasticsearch/jvm.options のメモリサイズを変更する
              (以降の処理で足りないとエラーになる)
              ▼7 # systemctl start elasticsearch
              ▼8 # systemctl status elasticsearch
              ▼9 起動確認 curl lsof
              --------------------------------------------------------------------------------------------

              ・実際の作業履歴など
              ▼1 # yum install java-1.8.0-openjdk

              [root@localhost install]# yum install java-1.8.0-openjdk
              Loaded plugins: fastestmirror
              base | 3.6 kB 00:00:00
              extras | 3.4 kB 00:00:00
              mongodb-org-3.0 | 2.5 kB 00:00:00
              puppetlabs-pc1 | 2.5 kB 00:00:00
              remi-safe | 2.9 kB 00:00:00
              updates | 3.4 kB 00:00:00
              (1/2): puppetlabs-pc1/x86_64/primary_db | 113 kB 00:00:01
              (2/2): remi-safe/primary_db | 917 kB 00:00:04
              Loading mirror speeds from cached hostfile
              * base: ftp.jaist.ac.jp
              * epel: ftp.jaist.ac.jp
              * extras: ftp.jaist.ac.jp
              * remi-safe: repo1.sea.innoscale.net
              * updates: ftp.jaist.ac.jp
              Resolving Dependencies
              --> Running transaction check
              ---> Package java-1.8.0-openjdk.x86_64 1:1.8.0.121-0.b13.el7_3 will be installed
              --> Processing Dependency: java-1.8.0-openjdk-headless = 1:1.8.0.121-0.b13.el7_3 for package: 1:java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: xorg-x11-fonts-Type1 for package: 1:java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: libjvm.so(SUNWprivate_1.1)(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: libjli.so(SUNWprivate_1.1)(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: libjava.so(SUNWprivate_1.1)(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: libjvm.so()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: libjli.so()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: libjava.so()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: libgif.so.4()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: libawt.so()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: libXtst.so.6()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: libXrender.so.1()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: libXi.so.6()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: libXext.so.6()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: libXcomposite.so.1()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64
              --> Running transaction check
              ---> Package giflib.x86_64 0:4.1.6-9.el7 will be installed
              --> Processing Dependency: libSM.so.6()(64bit) for package: giflib-4.1.6-9.el7.x86_64
              --> Processing Dependency: libICE.so.6()(64bit) for package: giflib-4.1.6-9.el7.x86_64
              ---> Package java-1.8.0-openjdk-headless.x86_64 1:1.8.0.121-0.b13.el7_3 will be installed
              --> Processing Dependency: tzdata-java >= 2015d for package: 1:java-1.8.0-openjdk-headless-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: nss(x86-64) >= 3.21.3 for package: 1:java-1.8.0-openjdk-headless-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: copy-jdk-configs >= 1.1-3 for package: 1:java-1.8.0-openjdk-headless-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: chkconfig >= 1.7 for package: 1:java-1.8.0-openjdk-headless-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: chkconfig >= 1.7 for package: 1:java-1.8.0-openjdk-headless-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: lksctp-tools(x86-64) for package: 1:java-1.8.0-openjdk-headless-1.8.0.121-0.b13.el7_3.x86_64
              --> Processing Dependency: jpackage-utils for package: 1:java-1.8.0-openjdk-headless-1.8.0.121-0.b13.el7_3.x86_64
              ---> Package libXcomposite.x86_64 0:0.4.4-4.1.el7 will be installed
              ---> Package libXext.x86_64 0:1.3.3-3.el7 will be installed
              ---> Package libXi.x86_64 0:1.7.4-2.el7 will be installed
              ---> Package libXrender.x86_64 0:0.9.8-2.1.el7 will be installed
              ---> Package libXtst.x86_64 0:1.2.2-2.1.el7 will be installed
              ---> Package xorg-x11-fonts-Type1.noarch 0:7.5-9.el7 will be installed
              --> Processing Dependency: ttmkfdir for package: xorg-x11-fonts-Type1-7.5-9.el7.noarch
              --> Processing Dependency: ttmkfdir for package: xorg-x11-fonts-Type1-7.5-9.el7.noarch
              --> Processing Dependency: mkfontdir for package: xorg-x11-fonts-Type1-7.5-9.el7.noarch
              --> Processing Dependency: mkfontdir for package: xorg-x11-fonts-Type1-7.5-9.el7.noarch
              --> Running transaction check
              ---> Package chkconfig.x86_64 0:1.3.61-5.el7 will be updated
              ---> Package chkconfig.x86_64 0:1.7.2-1.el7 will be an update
              ---> Package copy-jdk-configs.noarch 0:1.2-1.el7 will be installed
              ---> Package javapackages-tools.noarch 0:3.4.1-11.el7 will be installed
              --> Processing Dependency: python-javapackages = 3.4.1-11.el7 for package: javapackages-tools-3.4.1-11.el7.noarch
              --> Processing Dependency: libxslt for package: javapackages-tools-3.4.1-11.el7.noarch
              ---> Package libICE.x86_64 0:1.0.9-2.el7 will be installed
              ---> Package libSM.x86_64 0:1.2.2-2.el7 will be installed
              ---> Package lksctp-tools.x86_64 0:1.0.17-2.el7 will be installed
              ---> Package nss.x86_64 0:3.19.1-19.el7_2 will be updated
              --> Processing Dependency: nss = 3.19.1-19.el7_2 for package: nss-sysinit-3.19.1-19.el7_2.x86_64
              --> Processing Dependency: nss(x86-64) = 3.19.1-19.el7_2 for package: nss-tools-3.19.1-19.el7_2.x86_64
              ---> Package nss.x86_64 0:3.28.2-1.6.el7_3 will be an update
              --> Processing Dependency: nss-util >= 3.28.2-1.1 for package: nss-3.28.2-1.6.el7_3.x86_64
              --> Processing Dependency: nss-softokn(x86-64) >= 3.16.2.3-14.2 for package: nss-3.28.2-1.6.el7_3.x86_64
              --> Processing Dependency: nspr >= 4.13.1 for package: nss-3.28.2-1.6.el7_3.x86_64
              --> Processing Dependency: libnssutil3.so(NSSUTIL_3.24)(64bit) for package: nss-3.28.2-1.6.el7_3.x86_64
              --> Processing Dependency: libnssutil3.so(NSSUTIL_3.21)(64bit) for package: nss-3.28.2-1.6.el7_3.x86_64
              ---> Package ttmkfdir.x86_64 0:3.0.9-42.el7 will be installed
              ---> Package tzdata-java.noarch 0:2017b-1.el7 will be installed
              ---> Package xorg-x11-font-utils.x86_64 1:7.5-20.el7 will be installed
              --> Processing Dependency: libfontenc.so.1()(64bit) for package: 1:xorg-x11-font-utils-7.5-20.el7.x86_64
              --> Processing Dependency: libXfont.so.1()(64bit) for package: 1:xorg-x11-font-utils-7.5-20.el7.x86_64
              --> Running transaction check
              ---> Package libXfont.x86_64 0:1.5.1-2.el7 will be installed
              ---> Package libfontenc.x86_64 0:1.1.2-3.el7 will be installed
              ---> Package libxslt.x86_64 0:1.1.28-5.el7 will be installed
              ---> Package nspr.x86_64 0:4.10.8-2.el7_1 will be updated
              ---> Package nspr.x86_64 0:4.13.1-1.0.el7_3 will be an update
              ---> Package nss-softokn.x86_64 0:3.16.2.3-13.el7_1 will be updated
              ---> Package nss-softokn.x86_64 0:3.16.2.3-14.4.el7 will be an update
              --> Processing Dependency: nss-softokn-freebl(x86-64) >= 3.16.2.3-14.4.el7 for package: nss-softokn-3.16.2.3-14.4.el7.x86_64
              ---> Package nss-sysinit.x86_64 0:3.19.1-19.el7_2 will be updated
              ---> Package nss-sysinit.x86_64 0:3.28.2-1.6.el7_3 will be an update
              ---> Package nss-tools.x86_64 0:3.19.1-19.el7_2 will be updated
              ---> Package nss-tools.x86_64 0:3.28.2-1.6.el7_3 will be an update
              ---> Package nss-util.x86_64 0:3.19.1-4.el7_1 will be updated
              ---> Package nss-util.x86_64 0:3.28.2-1.1.el7_3 will be an update
              ---> Package python-javapackages.noarch 0:3.4.1-11.el7 will be installed
              --> Processing Dependency: python-lxml for package: python-javapackages-3.4.1-11.el7.noarch
              --> Running transaction check
              ---> Package nss-softokn-freebl.x86_64 0:3.16.2.3-13.el7_1 will be updated
              ---> Package nss-softokn-freebl.x86_64 0:3.16.2.3-14.4.el7 will be an update
              ---> Package python-lxml.x86_64 0:3.2.1-4.el7 will be installed
              --> Finished Dependency Resolution

              Dependencies Resolved

              ===========================================================================================================
              Package Arch Version Repository Size
              ===========================================================================================================
              Installing:
              java-1.8.0-openjdk x86_64 1:1.8.0.121-0.b13.el7_3 updates 232 k
              Installing for dependencies:
              copy-jdk-configs noarch 1.2-1.el7 base 14 k
              giflib x86_64 4.1.6-9.el7 base 40 k
              java-1.8.0-openjdk-headless x86_64 1:1.8.0.121-0.b13.el7_3 updates 31 M
              javapackages-tools noarch 3.4.1-11.el7 base 73 k
              libICE x86_64 1.0.9-2.el7 base 65 k
              libSM x86_64 1.2.2-2.el7 base 39 k
              libXcomposite x86_64 0.4.4-4.1.el7 base 22 k
              libXext x86_64 1.3.3-3.el7 base 39 k
              libXfont x86_64 1.5.1-2.el7 base 150 k
              libXi x86_64 1.7.4-2.el7 base 40 k
              libXrender x86_64 0.9.8-2.1.el7 base 25 k
              libXtst x86_64 1.2.2-2.1.el7 base 20 k
              libfontenc x86_64 1.1.2-3.el7 base 30 k
              libxslt x86_64 1.1.28-5.el7 base 242 k
              lksctp-tools x86_64 1.0.17-2.el7 base 88 k
              python-javapackages noarch 3.4.1-11.el7 base 31 k
              python-lxml x86_64 3.2.1-4.el7 base 758 k
              ttmkfdir x86_64 3.0.9-42.el7 base 48 k
              tzdata-java noarch 2017b-1.el7 updates 183 k
              xorg-x11-font-utils x86_64 1:7.5-20.el7 base 87 k
              xorg-x11-fonts-Type1 noarch 7.5-9.el7 base 521 k
              Updating for dependencies:
              chkconfig x86_64 1.7.2-1.el7 base 175 k
              nspr x86_64 4.13.1-1.0.el7_3 updates 126 k
              nss x86_64 3.28.2-1.6.el7_3 updates 873 k
              nss-softokn x86_64 3.16.2.3-14.4.el7 base 306 k
              nss-softokn-freebl x86_64 3.16.2.3-14.4.el7 base 204 k
              nss-sysinit x86_64 3.28.2-1.6.el7_3 updates 58 k
              nss-tools x86_64 3.28.2-1.6.el7_3 updates 496 k
              nss-util x86_64 3.28.2-1.1.el7_3 updates 73 k

              Transaction Summary
              ===========================================================================================================
              Install 1 Package (+21 Dependent packages)
              Upgrade ( 8 Dependent packages)

              Total download size: 36 M
              Is this ok [y/d/N]: y
              Downloading packages:
              Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
              (1/30): copy-jdk-configs-1.2-1.el7.noarch.rpm | 14 kB 00:00:00
              (2/30): giflib-4.1.6-9.el7.x86_64.rpm | 40 kB 00:00:00
              (3/30): chkconfig-1.7.2-1.el7.x86_64.rpm | 175 kB 00:00:00
              (4/30): javapackages-tools-3.4.1-11.el7.noarch.rpm | 73 kB 00:00:00
              (5/30): libICE-1.0.9-2.el7.x86_64.rpm | 65 kB 00:00:00
              (6/30): libSM-1.2.2-2.el7.x86_64.rpm | 39 kB 00:00:00
              (7/30): libXcomposite-0.4.4-4.1.el7.x86_64.rpm | 22 kB 00:00:00
              (8/30): libXext-1.3.3-3.el7.x86_64.rpm | 39 kB 00:00:00
              (9/30): libXfont-1.5.1-2.el7.x86_64.rpm | 150 kB 00:00:00
              (10/30): libXi-1.7.4-2.el7.x86_64.rpm | 40 kB 00:00:00
              (11/30): libXrender-0.9.8-2.1.el7.x86_64.rpm | 25 kB 00:00:00
              (12/30): libXtst-1.2.2-2.1.el7.x86_64.rpm | 20 kB 00:00:00
              (13/30): libfontenc-1.1.2-3.el7.x86_64.rpm | 30 kB 00:00:00
              (14/30): lksctp-tools-1.0.17-2.el7.x86_64.rpm | 88 kB 00:00:00
              (15/30): libxslt-1.1.28-5.el7.x86_64.rpm | 242 kB 00:00:00
              (16/30): java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64.rpm | 232 kB 00:00:01
              (17/30): nspr-4.13.1-1.0.el7_3.x86_64.rpm | 126 kB 00:00:00
              (18/30): nss-3.28.2-1.6.el7_3.x86_64.rpm | 873 kB 00:00:01
              (19/30): nss-sysinit-3.28.2-1.6.el7_3.x86_64.rpm | 58 kB 00:00:00
              (20/30): nss-softokn-freebl-3.16.2.3-14.4.el7.x86_64.rpm | 204 kB 00:00:01
              (21/30): nss-softokn-3.16.2.3-14.4.el7.x86_64.rpm | 306 kB 00:00:02
              (22/30): nss-tools-3.28.2-1.6.el7_3.x86_64.rpm | 496 kB 00:00:00
              (23/30): nss-util-3.28.2-1.1.el7_3.x86_64.rpm | 73 kB 00:00:00
              (24/30): python-javapackages-3.4.1-11.el7.noarch.rpm | 31 kB 00:00:00
              (25/30): ttmkfdir-3.0.9-42.el7.x86_64.rpm | 48 kB 00:00:00
              (26/30): xorg-x11-font-utils-7.5-20.el7.x86_64.rpm | 87 kB 00:00:00
              (27/30): python-lxml-3.2.1-4.el7.x86_64.rpm | 758 kB 00:00:01
              (28/30): tzdata-java-2017b-1.el7.noarch.rpm | 183 kB 00:00:01
              (29/30): xorg-x11-fonts-Type1-7.5-9.el7.noarch.rpm | 521 kB 00:00:01
              (30/30): java-1.8.0-openjdk-headless-1.8.0.121-0.b13.el7_3.x86_64.rpm | 31 MB 00:00:09
              -----------------------------------------------------------------------------------------------------------
              Total 3.3 MB/s | 36 MB 00:00:11
              Running transaction check
              Running transaction test
              Transaction test succeeded
              Running transaction
              Updating : nspr-4.13.1-1.0.el7_3.x86_64 1/38
              Updating : nss-util-3.28.2-1.1.el7_3.x86_64 2/38
              Installing : libXext-1.3.3-3.el7.x86_64 3/38
              Installing : libXi-1.7.4-2.el7.x86_64 4/38
              Installing : libfontenc-1.1.2-3.el7.x86_64 5/38
              Installing : libICE-1.0.9-2.el7.x86_64 6/38
              Updating : nss-softokn-freebl-3.16.2.3-14.4.el7.x86_64 7/38
              Updating : nss-softokn-3.16.2.3-14.4.el7.x86_64 8/38
              Installing : libxslt-1.1.28-5.el7.x86_64 9/38
              Updating : chkconfig-1.7.2-1.el7.x86_64 10/38
              Updating : nss-sysinit-3.28.2-1.6.el7_3.x86_64 11/38
              Updating : nss-3.28.2-1.6.el7_3.x86_64 12/38
              Installing : python-lxml-3.2.1-4.el7.x86_64 13/38
              Installing : python-javapackages-3.4.1-11.el7.noarch 14/38
              Installing : javapackages-tools-3.4.1-11.el7.noarch 15/38
              Installing : libSM-1.2.2-2.el7.x86_64 16/38
              Installing : giflib-4.1.6-9.el7.x86_64 17/38
              Installing : libXfont-1.5.1-2.el7.x86_64 18/38
              Installing : 1:xorg-x11-font-utils-7.5-20.el7.x86_64 19/38
              Installing : libXtst-1.2.2-2.1.el7.x86_64 20/38
              Installing : tzdata-java-2017b-1.el7.noarch 21/38
              Installing : copy-jdk-configs-1.2-1.el7.noarch 22/38
              Installing : lksctp-tools-1.0.17-2.el7.x86_64 23/38
              Installing : 1:java-1.8.0-openjdk-headless-1.8.0.121-0.b13.el7_3.x86_64 24/38
              Installing : libXrender-0.9.8-2.1.el7.x86_64 25/38
              Installing : libXcomposite-0.4.4-4.1.el7.x86_64 26/38
              Installing : ttmkfdir-3.0.9-42.el7.x86_64 27/38
              Installing : xorg-x11-fonts-Type1-7.5-9.el7.noarch 28/38
              Installing : 1:java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64 29/38
              Updating : nss-tools-3.28.2-1.6.el7_3.x86_64 30/38
              Cleanup : nss-tools-3.19.1-19.el7_2.x86_64 31/38
              Cleanup : nss-sysinit-3.19.1-19.el7_2.x86_64 32/38
              Cleanup : nss-3.19.1-19.el7_2.x86_64 33/38
              Cleanup : nss-softokn-3.16.2.3-13.el7_1.x86_64 34/38
              Cleanup : nss-util-3.19.1-4.el7_1.x86_64 35/38
              Cleanup : nspr-4.10.8-2.el7_1.x86_64 36/38
              Cleanup : nss-softokn-freebl-3.16.2.3-13.el7_1.x86_64 37/38
              Cleanup : chkconfig-1.3.61-5.el7.x86_64 38/38
              Verifying : libXext-1.3.3-3.el7.x86_64 1/38
              Verifying : nspr-4.13.1-1.0.el7_3.x86_64 2/38
              Verifying : giflib-4.1.6-9.el7.x86_64 3/38
              Verifying : nss-tools-3.28.2-1.6.el7_3.x86_64 4/38
              Verifying : libXtst-1.2.2-2.1.el7.x86_64 5/38
              Verifying : python-lxml-3.2.1-4.el7.x86_64 6/38
              Verifying : nss-softokn-3.16.2.3-14.4.el7.x86_64 7/38
              Verifying : nss-sysinit-3.28.2-1.6.el7_3.x86_64 8/38
              Verifying : 1:java-1.8.0-openjdk-headless-1.8.0.121-0.b13.el7_3.x86_64 9/38
              Verifying : nss-util-3.28.2-1.1.el7_3.x86_64 10/38
              Verifying : ttmkfdir-3.0.9-42.el7.x86_64 11/38
              Verifying : chkconfig-1.7.2-1.el7.x86_64 12/38
              Verifying : python-javapackages-3.4.1-11.el7.noarch 13/38
              Verifying : libXcomposite-0.4.4-4.1.el7.x86_64 14/38
              Verifying : nss-3.28.2-1.6.el7_3.x86_64 15/38
              Verifying : libXrender-0.9.8-2.1.el7.x86_64 16/38
              Verifying : lksctp-tools-1.0.17-2.el7.x86_64 17/38
              Verifying : copy-jdk-configs-1.2-1.el7.noarch 18/38
              Verifying : xorg-x11-fonts-Type1-7.5-9.el7.noarch 19/38
              Verifying : libxslt-1.1.28-5.el7.x86_64 20/38
              Verifying : tzdata-java-2017b-1.el7.noarch 21/38
              Verifying : nss-softokn-freebl-3.16.2.3-14.4.el7.x86_64 22/38
              Verifying : libICE-1.0.9-2.el7.x86_64 23/38
              Verifying : libXfont-1.5.1-2.el7.x86_64 24/38
              Verifying : javapackages-tools-3.4.1-11.el7.noarch 25/38
              Verifying : libXi-1.7.4-2.el7.x86_64 26/38
              Verifying : libSM-1.2.2-2.el7.x86_64 27/38
              Verifying : libfontenc-1.1.2-3.el7.x86_64 28/38
              Verifying : 1:java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64 29/38
              Verifying : 1:xorg-x11-font-utils-7.5-20.el7.x86_64 30/38
              Verifying : nss-softokn-3.16.2.3-13.el7_1.x86_64 31/38
              Verifying : nss-sysinit-3.19.1-19.el7_2.x86_64 32/38
              Verifying : nss-3.19.1-19.el7_2.x86_64 33/38
              Verifying : nss-tools-3.19.1-19.el7_2.x86_64 34/38
              Verifying : chkconfig-1.3.61-5.el7.x86_64 35/38
              Verifying : nss-softokn-freebl-3.16.2.3-13.el7_1.x86_64 36/38
              Verifying : nspr-4.10.8-2.el7_1.x86_64 37/38
              Verifying : nss-util-3.19.1-4.el7_1.x86_64 38/38

              Installed:
              java-1.8.0-openjdk.x86_64 1:1.8.0.121-0.b13.el7_3

              Dependency Installed:
              copy-jdk-configs.noarch 0:1.2-1.el7 giflib.x86_64 0:4.1.6-9.el7
              java-1.8.0-openjdk-headless.x86_64 1:1.8.0.121-0.b13.el7_3 javapackages-tools.noarch 0:3.4.1-11.el7
              libICE.x86_64 0:1.0.9-2.el7 libSM.x86_64 0:1.2.2-2.el7
              libXcomposite.x86_64 0:0.4.4-4.1.el7 libXext.x86_64 0:1.3.3-3.el7
              libXfont.x86_64 0:1.5.1-2.el7 libXi.x86_64 0:1.7.4-2.el7
              libXrender.x86_64 0:0.9.8-2.1.el7 libXtst.x86_64 0:1.2.2-2.1.el7
              libfontenc.x86_64 0:1.1.2-3.el7 libxslt.x86_64 0:1.1.28-5.el7
              lksctp-tools.x86_64 0:1.0.17-2.el7 python-javapackages.noarch 0:3.4.1-11.el7
              python-lxml.x86_64 0:3.2.1-4.el7 ttmkfdir.x86_64 0:3.0.9-42.el7
              tzdata-java.noarch 0:2017b-1.el7 xorg-x11-font-utils.x86_64 1:7.5-20.el7
              xorg-x11-fonts-Type1.noarch 0:7.5-9.el7

              Dependency Updated:
              chkconfig.x86_64 0:1.7.2-1.el7 nspr.x86_64 0:4.13.1-1.0.el7_3
              nss.x86_64 0:3.28.2-1.6.el7_3 nss-softokn.x86_64 0:3.16.2.3-14.4.el7
              nss-softokn-freebl.x86_64 0:3.16.2.3-14.4.el7 nss-sysinit.x86_64 0:3.28.2-1.6.el7_3
              nss-tools.x86_64 0:3.28.2-1.6.el7_3 nss-util.x86_64 0:3.28.2-1.1.el7_3

              Complete!
              [root@localhost install]#



              ▼2 # java -version

              [root@localhost install]# java -version
              openjdk version "1.8.0_121"
              OpenJDK Runtime Environment (build 1.8.0_121-b13)
              OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
              [root@localhost install]#


              ▼3 # rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
              [root@localhost install]# rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch



              ▼4 # repoファイル作成
              vi /etc/yum.repos.d/elasticsearch.repo

              [elasticsearch-5.x]
              name=Elasticsearch repository for 5.x packages
              baseurl=https://artifacts.elastic.co/packages/5.x/yum
              gpgcheck=1
              gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
              enabled=1
              autorefresh=1
              type=rpm-md

              ▼5 # yum install elasticsearch -y

              [root@localhost install]# vi /etc/yum.repos.d/elasticsearch.repo


              [root@localhost install]# yum install elasticsearch -y
              Loaded plugins: fastestmirror
              elasticsearch-5.x | 1.3 kB 00:00:00
              elasticsearch-5.x/primary | 40 kB 00:00:01
              Loading mirror speeds from cached hostfile
              * base: ftp.jaist.ac.jp
              * epel: ftp.jaist.ac.jp
              * extras: ftp.jaist.ac.jp
              * remi-safe: mirrors.thzhost.com
              * updates: ftp.jaist.ac.jp
              elasticsearch-5.x 98/98
              Resolving Dependencies
              --> Running transaction check
              ---> Package elasticsearch.noarch 0:5.3.0-1 will be installed
              --> Finished Dependency Resolution

              Dependencies Resolved

              ===========================================================================================================
              Package Arch Version Repository Size
              ===========================================================================================================
              Installing:
              elasticsearch noarch 5.3.0-1 elasticsearch-5.x 32 M

              Transaction Summary
              ===========================================================================================================
              Install 1 Package

              Total download size: 32 M
              Installed size: 36 M
              Downloading packages:
              elasticsearch-5.3.0.rpm | 32 MB 00:00:10
              Running transaction check
              Running transaction test
              Transaction test succeeded
              Running transaction
              Creating elasticsearch group... OK
              Creating elasticsearch user... OK
              Installing : elasticsearch-5.3.0-1.noarch 1/1
              ### NOT starting on installation, please execute the following statements to configure elasticsearch servic
              e to start automatically using systemd
              sudo systemctl daemon-reload
              sudo systemctl enable elasticsearch.service
              ### You can start elasticsearch service by executing
              sudo systemctl start elasticsearch.service
              Verifying : elasticsearch-5.3.0-1.noarch 1/1

              Installed:
              elasticsearch.noarch 0:5.3.0-1

              Complete!
              [root@localhost install]#
              [root@localhost install]#


              ▼6 # elasticsearch/jvm.options のメモリサイズを変更する
              (以降の処理で足りないとエラーになる)

              # vi /etc/elasticsearch/jvm.options
              #-Xms2g
              #-Xmx2g
              -Xms1g
              -Xmx1g

              [root@localhost install]# systemctl daemon-reload
              [root@localhost install]# systemctl start elasticsearch
              [root@localhost install]# systemctl status elasticsearch
              ● elasticsearch.service - Elasticsearch
              Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled)
              Active: failed (Result: exit-code) since Fri 2017-04-07 20:18:38 BST; 11s ago
              Docs: http://www.elastic.co
              Process: 13109 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet -Edefault.path.logs=${LOG_DIR} -Edefault.path.data=${DATA_DIR} -Edefault.path.conf=${CONF_DIR} (code=exited, status=1/FAILURE)
              Process: 13106 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
              Main PID: 13109 (code=exited, status=1/FAILURE)

              Apr 07 20:18:37 localhost.localdomain systemd[1]: Started Elasticsearch.
              Apr 07 20:18:38 localhost.localdomain elasticsearch[13109]: OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x000000008a660000, 19730268...rno=12)
              Apr 07 20:18:38 localhost.localdomain elasticsearch[13109]: #
              Apr 07 20:18:38 localhost.localdomain elasticsearch[13109]: # There is insufficient memory for the Java Runtime Environment to continue.
              Apr 07 20:18:38 localhost.localdomain elasticsearch[13109]: # Native memory allocation (mmap) failed to map 1973026816 bytes for committing reserved memory.
              Apr 07 20:18:38 localhost.localdomain elasticsearch[13109]: # An error report file with more information is saved as:
              Apr 07 20:18:38 localhost.localdomain elasticsearch[13109]: # /tmp/hs_err_pid13109.log
              Apr 07 20:18:38 localhost.localdomain systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
              Apr 07 20:18:38 localhost.localdomain systemd[1]: Unit elasticsearch.service entered failed state.
              Apr 07 20:18:38 localhost.localdomain systemd[1]: elasticsearch.service failed.
              Hint: Some lines were ellipsized, use -l to show in full.


              エラーがでた
              メモリーが足りないというエラーらしい


              [root@localhost install]# systemctl status elasticsearch
              ● elasticsearch.service - Elasticsearch
              Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled)
              Active: failed (Result: exit-code) since Fri 2017-04-07 20:18:38 BST; 58min ago
              Docs: http://www.elastic.co
              Process: 13109 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet -Edefault.path.logs=${LOG_DIR} -Edefault.path.data=${DATA_DIR} -Edefault.path.conf=${CONF_DIR} (code=exited, status=1/FAILURE)
              Process: 13106 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
              Main PID: 13109 (code=exited, status=1/FAILURE)

              Apr 07 20:18:37 localhost.localdomain systemd[1]: Started Elasticsearch.
              Apr 07 20:18:38 localhost.localdomain elasticsearch[13109]: OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x000000008a660000, 19730268...rno=12)
              Apr 07 20:18:38 localhost.localdomain elasticsearch[13109]: #
              Apr 07 20:18:38 localhost.localdomain elasticsearch[13109]: # There is insufficient memory for the Java Runtime Environment to continue.
              Apr 07 20:18:38 localhost.localdomain elasticsearch[13109]: # Native memory allocation (mmap) failed to map 1973026816 bytes for committing reserved memory.
              ## the heap to 4 GB, set:
              Apr 07 20:18:38 localhost.localdomain elasticsearch[13109]: # An error report file with more information is saved as:
              Apr 07 20:18:38 localhost.localdomain elasticsearch[13109]: # /tmp/hs_err_pid13109.log
              Apr 07 20:18:38 localhost.localdomain systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
              Apr 07 20:18:38 localhost.localdomain systemd[1]: Unit elasticsearch.service entered failed state.
              Apr 07 20:18:38 localhost.localdomain systemd[1]: elasticsearch.service failed.
              Hint: Some lines were ellipsized, use -l to show in full.
              [root@localhost install]#


              [root@localhost install]# systemctl start elasticsearch
              [root@localhost install]#
              [root@localhost install]# vi /etc/elasticsearch/jvm.options
              [root@localhost install]#
              [root@localhost install]# systemctl start elasticsearch
              [root@localhost install]#
              [root@localhost install]#


              ▼7 # systemctl start elasticsearch
              ▼8 # systemctl status elasticsearch



              ▼9 起動確認
              [root@localhost install]# ps -ef | grepelasticsearch
              -bash: grepelasticsearch: command not found
              [root@localhost install]# ps -ef | grep elasticsearch
              elastic+ 13414 1 97 04:47 ? 00:00:53 /bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -XX:+HeapDumpOnOutOfMemoryError -Des.path.home=/usr/share/elasticsearch -cp /usr/share/elasticsearch/lib/elasticsearch-5.3.0.jar:/usr/share/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch -p /var/run/elasticsearch/elasticsearch.pid --quiet -Edefault.path.logs=/var/log/elasticsearch -Edefault.path.data=/var/lib/elasticsearch -Edefault.path.conf=/etc/elasticsearch
              root 13460 12568 0 04:48 pts/1 00:00:00 grep --color=auto elasticsearch
              [root@localhost install]#


              [root@localhost install]# lsof -i:9200
              COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
              java 13414 elasticsearch 129u IPv6 146075 0t0 TCP localhost:wap-wsp (LISTEN)
              java 13414 elasticsearch 130u IPv6 146076 0t0 TCP localhost:wap-wsp (LISTEN)
              [root@localhost install]#
              [root@localhost install]#
              [root@localhost install]# curl localhost:9200
              {
              "name" : "uO1KpJW",
              "cluster_name" : "elasticsearch",
              "cluster_uuid" : "SM8-AG97QamXTz5nxOiidQ",
              "version" : {
              "number" : "5.3.0",
              "build_hash" : "3adb13b",
              "build_date" : "2017-03-23T03:31:50.652Z",
              "build_snapshot" : false,
              "lucene_version" : "6.4.1"
              },
              "tagline" : "You Know, for Search"
              }
              [root@localhost install]#
              category:elasticsearch | by:ittoocomments(0)trackbacks(0) | -

              今村復興大臣のエヴァネクタイ注目されててすごいね! 調べるとちょいお高いのね

              2017.04.05 Wednesday 08:13
              0
                新世紀エヴァンゲリオン ネクタイ コミックスタイプ
                新世紀エヴァンゲリオン ネクタイ コミックスタイプ

                今村復興大臣のエヴァネクタイ注目されててすごいわ!
                ネットで調べるとちょいお高いのね

                そのうちエヴァネクタイの方が話題かっさらっていきそう。
                ガイナックスって福島県と関係あったのね。

                アスカ・ラングレーの顔が真ん中にあって目立ってるから
                人前で使うのは勇気いるけど
                政治家はそういうのも大事だよね

                パナソニック AM/FM ラジオ シルバー RF-U150A-S


                ハイスツール

                (DORIS) ダイニングテーブル 5点セット 【ウォーム ブラウン】 テーブル&チェア(5点セット) 4人掛け 幅:110cm 組み立て式

                エレコムHDMI


                オリオン 24V型 1波(地上デジタル) ハイビジョン液晶テレビ ブルーライトガード搭載 ブラック NHC-241B

                エレコム USB3.0対応 外付けハードディスク 3.0TB【WEB限定商品】ELD-XEDUBKシリーズ ELD-XED030UBK

                ティファール 電気ケトル 0.8L アプレシア プラス コンパクトモデル カフェオレ BF805170


                category:日記 | by:ittoocomments(0)trackbacks(0) | -

                PHP5.6インストール

                2017.04.02 Sunday 16:45
                0
                  PHP5.6インストール
                  yum install --enablerepo=remi,remi-php56 php php-devel php-mbstring php-pdo php-gd

                  インストール結果確認
                  rpm -qa | grep php
                  php --version

                  php.iniを編集
                  vi /etc/php.ini
                  以下に変更
                  php.ini
                  date.timezone = "Asia/Tokyo"
                  mbsting.language = Japanese
                  mbstring.internal_encoding = UTF-8
                  mbstring.http_input = UTF-8
                  mbstring.http_output = pass
                  mbstring.encoding_translation = On
                  mbstring.detect_order = auto
                  mbstring.substitute_charset = none


                  Composerをインストール
                  ダウンロード
                  curl -sS https://getcomposer.org/installer | php

                  パスが通っている場所にリネームする
                  mv composer.phar /usr/local/bin/composer

                  category:php | by:ittoocomments(0)trackbacks(0) | -

                  nodeとExpressとnvmをインストールしたった vagrantのcentosね

                  2017.04.02 Sunday 15:53
                  0
                    nodeとExpressとnvmをインストールしたった vagrantのcentosね


                    ★mongodb インストール
                    [root@localhost install]# cd /etc/yum.repos.d/
                    [root@localhost yum.repos.d]# ls -ltr
                    total 40
                    -rw-r--r-- 1 root root 1056 Nov 25 2014 epel-testing.repo
                    -rw-r--r-- 1 root root 957 Nov 25 2014 epel.repo
                    -rw-r--r-- 1 root root 422 Oct 1 2015 puppetlabs-pc1.repo
                    -rw-r--r--. 1 root root 1952 Dec 9 2015 CentOS-Vault.repo
                    -rw-r--r--. 1 root root 1331 Dec 9 2015 CentOS-Sources.repo
                    -rw-r--r--. 1 root root 630 Dec 9 2015 CentOS-Media.repo
                    -rw-r--r--. 1 root root 290 Dec 9 2015 CentOS-fasttrack.repo
                    -rw-r--r--. 1 root root 649 Dec 9 2015 CentOS-Debuginfo.repo
                    -rw-r--r--. 1 root root 1309 Dec 9 2015 CentOS-CR.repo
                    -rw-r--r--. 1 root root 1664 Dec 9 2015 CentOS-Base.repo
                    [root@localhost yum.repos.d]#
                    [root@localhost yum.repos.d]# vi mongodb-org-3.0.repo
                    [root@localhost yum.repos.d]#
                    [root@localhost yum.repos.d]#
                    [root@localhost yum.repos.d]#
                    [root@localhost yum.repos.d]# yum install mongodb-org
                    Loaded plugins: fastestmirror
                    base | 3.6 kB 00:00:00
                    epel/x86_64/metalink | 4.2 kB 00:00:00
                    epel | 4.3 kB 00:00:00
                    extras | 3.4 kB 00:00:00
                    mongodb-org-3.0 | 2.5 kB 00:00:00
                    puppetlabs-pc1 | 2.5 kB 00:00:00
                    updates | 3.4 kB 00:00:00
                    (1/9): base/7/x86_64/group_gz | 155 kB 00:00:02
                    (2/9): epel/x86_64/group_gz | 170 kB 00:00:02
                    epel/x86_64/updateinfo FAILED
                    http://ftp.riken.jp/Linux/fedora/epel/7/x86_64/repodata/56be5b8d19447db16a651fd36313c9f005ae7aa50073dc084c4c2166a108ed13-updateinfo.xml.bz2: [Errno 14] HTTP Error 404 - Not Found
                    Trying other mirror.
                    To address this issue please refer to the below knowledge base article

                    https://access.redhat.com/articles/1320623

                    If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/

                    (3/9): base/7/x86_64/primary_db | 5.6 MB 00:00:05
                    (4/9): extras/7/x86_64/primary_db | 139 kB 00:00:02
                    (5/9): mongodb-org-3.0/7/primary_db | 74 kB 00:00:03
                    (6/9): puppetlabs-pc1/x86_64/primary_db | 109 kB 00:00:03
                    epel/x86_64/primary_db FAILED
                    https://mirrors.tuna.tsinghua.edu.cn/epel/7/x86_64/repodata/9d3545ef1f8b2414d5f8d5bca3289cf7dcf4b9ac4d0940a90e15c6a446315098-primary.sqlite.xz: [Errno 14] HTTPS Error 404 - Not Found
                    Trying other mirror.
                    (7/9): epel/x86_64/updateinfo | 765 kB 00:00:01
                    (8/9): updates/7/x86_64/primary_db | 3.9 MB 00:00:02
                    epel/x86_64/primary_db FAILED
                    http://ftp.cuhk.edu.hk/pub/linux/fedora-epel/7/x86_64/repodata/9d3545ef1f8b2414d5f8d5bca3289cf7dcf4b9ac4d0940a90e15c6a446315098-primary.sqlite.xz: [Errno 14] HTTP Error 404 - Not Found
                    Trying other mirror.
                    (9/9): epel/x86_64/primary_db | 4.6 MB 00:00:05
                    Determining fastest mirrors
                    * base: ftp.jaist.ac.jp
                    * epel: ftp.jaist.ac.jp
                    * extras: ftp.jaist.ac.jp
                    * updates: ftp.jaist.ac.jp
                    Resolving Dependencies
                    --> Running transaction check
                    ---> Package mongodb-org.x86_64 0:3.0.14-1.el7 will be installed
                    --> Processing Dependency: mongodb-org-tools = 3.0.14 for package: mongodb-org-3.0.14-1.el7.x86_64
                    --> Processing Dependency: mongodb-org-shell = 3.0.14 for package: mongodb-org-3.0.14-1.el7.x86_64
                    --> Processing Dependency: mongodb-org-server = 3.0.14 for package: mongodb-org-3.0.14-1.el7.x86_64
                    --> Processing Dependency: mongodb-org-mongos = 3.0.14 for package: mongodb-org-3.0.14-1.el7.x86_64
                    --> Running transaction check
                    ---> Package mongodb-org-mongos.x86_64 0:3.0.14-1.el7 will be installed
                    ---> Package mongodb-org-server.x86_64 0:3.0.14-1.el7 will be installed
                    ---> Package mongodb-org-shell.x86_64 0:3.0.14-1.el7 will be installed
                    ---> Package mongodb-org-tools.x86_64 0:3.0.14-1.el7 will be installed
                    --> Finished Dependency Resolution

                    Dependencies Resolved

                    ======================================================================================
                    Package Arch Version Repository Size
                    ======================================================================================
                    Installing:
                    mongodb-org x86_64 3.0.14-1.el7 mongodb-org-3.0 5.8 k
                    Installing for dependencies:
                    mongodb-org-mongos x86_64 3.0.14-1.el7 mongodb-org-3.0 4.6 M
                    mongodb-org-server x86_64 3.0.14-1.el7 mongodb-org-3.0 9.7 M
                    mongodb-org-shell x86_64 3.0.14-1.el7 mongodb-org-3.0 5.0 M
                    mongodb-org-tools x86_64 3.0.14-1.el7 mongodb-org-3.0 38 M

                    Transaction Summary
                    ======================================================================================
                    Install 1 Package (+4 Dependent packages)

                    Total download size: 57 M
                    Installed size: 166 M
                    Is this ok [y/d/N]: y
                    Downloading packages:
                    (1/5): mongodb-org-3.0.14-1.el7.x86_64.rpm | 5.8 kB 00:00:01
                    (2/5): mongodb-org-mongos-3.0.14-1.el7.x86_64.rpm | 4.6 MB 00:00:02
                    (3/5): mongodb-org-server-3.0.14-1.el7.x86_64.rpm | 9.7 MB 00:00:05
                    (4/5): mongodb-org-shell-3.0.14-1.el7.x86_64.rpm | 5.0 MB 00:00:04
                    (5/5): mongodb-org-tools-3.0.14-1.el7.x86_64.rpm | 38 MB 00:00:27
                    --------------------------------------------------------------------------------------
                    Total 1.7 MB/s | 57 MB 00:34
                    Running transaction check
                    Running transaction test
                    Transaction test succeeded
                    Running transaction
                    Installing : mongodb-org-shell-3.0.14-1.el7.x86_64 1/5
                    Installing : mongodb-org-tools-3.0.14-1.el7.x86_64 2/5
                    Installing : mongodb-org-mongos-3.0.14-1.el7.x86_64 3/5
                    Installing : mongodb-org-server-3.0.14-1.el7.x86_64 4/5
                    Installing : mongodb-org-3.0.14-1.el7.x86_64 5/5
                    Verifying : mongodb-org-3.0.14-1.el7.x86_64 1/5
                    Verifying : mongodb-org-server-3.0.14-1.el7.x86_64 2/5
                    Verifying : mongodb-org-mongos-3.0.14-1.el7.x86_64 3/5
                    Verifying : mongodb-org-tools-3.0.14-1.el7.x86_64 4/5
                    Verifying : mongodb-org-shell-3.0.14-1.el7.x86_64 5/5

                    Installed:
                    mongodb-org.x86_64 0:3.0.14-1.el7

                    Dependency Installed:
                    mongodb-org-mongos.x86_64 0:3.0.14-1.el7 mongodb-org-server.x86_64 0:3.0.14-1.el7
                    mongodb-org-shell.x86_64 0:3.0.14-1.el7 mongodb-org-tools.x86_64 0:3.0.14-1.el7

                    Complete!
                    [root@localhost yum.repos.d]#
                    [root@localhost yum.repos.d]#
                    [root@localhost yum.repos.d]#
                    [root@localhost yum.repos.d]# systemcol start mongod
                    -bash: systemcol: command not found
                    [root@localhost yum.repos.d]# systemctl start mongod
                    [root@localhost yum.repos.d]#
                    [root@localhost yum.repos.d]# chkconfig mongod on
                    [root@localhost yum.repos.d]#


                    ★nvmいれる前にgitいれる
                    [root@localhost yum.repos.d]# yum install git
                    Loaded plugins: fastestmirror
                    Loading mirror speeds from cached hostfile
                    * base: ftp.jaist.ac.jp
                    * epel: ftp.jaist.ac.jp
                    * extras: ftp.jaist.ac.jp
                    * updates: ftp.jaist.ac.jp
                    Resolving Dependencies
                    --> Running transaction check
                    ---> Package git.x86_64 0:1.8.3.1-6.el7_2.1 will be installed
                    --> Processing Dependency: perl-Git = 1.8.3.1-6.el7_2.1 for package: git-1.8.3.1-6.el7_2.1.x86_64
                    --> Processing Dependency: rsync for package: git-1.8.3.1-6.el7_2.1.x86_64
                    --> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-6.el7_2.1.x86_64
                    --> Processing Dependency: perl(Git) for package: git-1.8.3.1-6.el7_2.1.x86_64
                    --> Processing Dependency: perl(Error) for package: git-1.8.3.1-6.el7_2.1.x86_64
                    --> Processing Dependency: libgnome-keyring.so.0()(64bit) for package: git-1.8.3.1-6.el7_2.1.x86_64
                    --> Running transaction check
                    ---> Package libgnome-keyring.x86_64 0:3.8.0-3.el7 will be installed
                    ---> Package perl-Error.noarch 1:0.17020-2.el7 will be installed
                    ---> Package perl-Git.noarch 0:1.8.3.1-6.el7_2.1 will be installed
                    ---> Package perl-TermReadKey.x86_64 0:2.30-20.el7 will be installed
                    ---> Package rsync.x86_64 0:3.0.9-17.el7 will be installed
                    --> Finished Dependency Resolution

                    Dependencies Resolved

                    ======================================================================================
                    Package Arch Version Repository Size
                    ======================================================================================
                    Installing:
                    git x86_64 1.8.3.1-6.el7_2.1 base 4.4 M
                    Installing for dependencies:
                    libgnome-keyring x86_64 3.8.0-3.el7 base 109 k
                    perl-Error noarch 1:0.17020-2.el7 base 32 k
                    perl-Git noarch 1.8.3.1-6.el7_2.1 base 53 k
                    perl-TermReadKey x86_64 2.30-20.el7 base 31 k
                    rsync x86_64 3.0.9-17.el7 base 360 k

                    Transaction Summary
                    ======================================================================================
                    Install 1 Package (+5 Dependent packages)

                    Total download size: 5.0 M
                    Installed size: 23 M
                    Is this ok [y/d/N]: y
                    Downloading packages:
                    (1/6): perl-Error-0.17020-2.el7.noarch.rpm | 32 kB 00:00:01
                    (2/6): libgnome-keyring-3.8.0-3.el7.x86_64.rpm | 109 kB 00:00:01
                    (3/6): rsync-3.0.9-17.el7.x86_64.rpm | 360 kB 00:00:00
                    (4/6): perl-Git-1.8.3.1-6.el7_2.1.noarch.rpm | 53 kB 00:00:02
                    (5/6): perl-TermReadKey-2.30-20.el7.x86_64.rpm | 31 kB 00:00:02
                    (6/6): git-1.8.3.1-6.el7_2.1.x86_64.rpm | 4.4 MB 00:00:05
                    --------------------------------------------------------------------------------------
                    Total 878 kB/s | 5.0 MB 00:05
                    Running transaction check
                    Running transaction test
                    Transaction test succeeded
                    Running transaction
                    Installing : 1:perl-Error-0.17020-2.el7.noarch 1/6
                    Installing : libgnome-keyring-3.8.0-3.el7.x86_64 2/6
                    Installing : rsync-3.0.9-17.el7.x86_64 3/6
                    Installing : perl-TermReadKey-2.30-20.el7.x86_64 4/6
                    Installing : perl-Git-1.8.3.1-6.el7_2.1.noarch 5/6
                    Installing : git-1.8.3.1-6.el7_2.1.x86_64 6/6
                    Verifying : perl-TermReadKey-2.30-20.el7.x86_64 1/6
                    Verifying : 1:perl-Error-0.17020-2.el7.noarch 2/6
                    Verifying : rsync-3.0.9-17.el7.x86_64 3/6
                    Verifying : git-1.8.3.1-6.el7_2.1.x86_64 4/6
                    Verifying : libgnome-keyring-3.8.0-3.el7.x86_64 5/6
                    Verifying : perl-Git-1.8.3.1-6.el7_2.1.noarch 6/6

                    Installed:
                    git.x86_64 0:1.8.3.1-6.el7_2.1

                    Dependency Installed:
                    libgnome-keyring.x86_64 0:3.8.0-3.el7 perl-Error.noarch 1:0.17020-2.el7
                    perl-Git.noarch 0:1.8.3.1-6.el7_2.1 perl-TermReadKey.x86_64 0:2.30-20.el7
                    rsync.x86_64 0:3.0.9-17.el7

                    Complete!
                    [root@localhost yum.repos.d]#
                    [root@localhost yum.repos.d]#


                    ★nvmいれる
                    [root@localhost yum.repos.d]# git clone git://github.com/creationix/nvm.git ~/.nvm
                    Cloning into '/root/.nvm'...
                    remote: Counting objects: 6308, done.
                    remote: Compressing objects: 100% (32/32), done.
                    remote: Total 6308 (delta 13), reused 0 (delta 0), pack-reused 6276
                    Receiving objects: 100% (6308/6308), 1.83 MiB | 679.00 KiB/s, done.
                    Resolving deltas: 100% (3899/3899), done.
                    [root@localhost yum.repos.d]# pwd
                    /etc/yum.repos.d
                    [root@localhost yum.repos.d]# ll
                    total 44
                    -rw-r--r--. 1 root root 1664 Dec 9 2015 CentOS-Base.repo
                    -rw-r--r--. 1 root root 1309 Dec 9 2015 CentOS-CR.repo
                    -rw-r--r--. 1 root root 649 Dec 9 2015 CentOS-Debuginfo.repo
                    -rw-r--r--. 1 root root 290 Dec 9 2015 CentOS-fasttrack.repo
                    -rw-r--r--. 1 root root 630 Dec 9 2015 CentOS-Media.repo
                    -rw-r--r--. 1 root root 1331 Dec 9 2015 CentOS-Sources.repo
                    -rw-r--r--. 1 root root 1952 Dec 9 2015 CentOS-Vault.repo
                    -rw-r--r-- 1 root root 957 Nov 25 2014 epel.repo
                    -rw-r--r-- 1 root root 1056 Nov 25 2014 epel-testing.repo
                    -rw-r--r-- 1 root root 143 Apr 1 08:04 mongodb-org-3.0.repo
                    -rw-r--r-- 1 root root 422 Oct 1 2015 puppetlabs-pc1.repo
                    [root@localhost yum.repos.d]# ls -ltr
                    total 44
                    -rw-r--r-- 1 root root 1056 Nov 25 2014 epel-testing.repo
                    -rw-r--r-- 1 root root 957 Nov 25 2014 epel.repo
                    -rw-r--r-- 1 root root 422 Oct 1 2015 puppetlabs-pc1.repo
                    -rw-r--r--. 1 root root 1952 Dec 9 2015 CentOS-Vault.repo
                    -rw-r--r--. 1 root root 1331 Dec 9 2015 CentOS-Sources.repo
                    -rw-r--r--. 1 root root 630 Dec 9 2015 CentOS-Media.repo
                    -rw-r--r--. 1 root root 290 Dec 9 2015 CentOS-fasttrack.repo
                    -rw-r--r--. 1 root root 649 Dec 9 2015 CentOS-Debuginfo.repo
                    -rw-r--r--. 1 root root 1309 Dec 9 2015 CentOS-CR.repo
                    -rw-r--r--. 1 root root 1664 Dec 9 2015 CentOS-Base.repo
                    -rw-r--r-- 1 root root 143 Apr 1 08:04 mongodb-org-3.0.repo
                    [root@localhost yum.repos.d]# cd /home/install
                    [root@localhost install]# ll
                    total 0
                    [root@localhost install]# source ~/.nvm/nvm.sh
                    [root@localhost install]#
                    [root@localhost install]#
                    [root@localhost install]# nvm ls-remote
                    v0.1.14
                    v0.1.15
                    v0.1.16
                    v0.1.17
                    v0.1.18
                    v0.1.19
                    v0.1.20
                    v0.1.21
                    v0.1.22
                    v0.1.23
                    v0.1.24
                    v0.1.25
                    v0.1.26
                    v0.1.27
                    v0.1.28
                    v0.1.29
                    v0.1.30
                    v0.1.31
                    v0.1.32
                    v0.1.33
                    v0.1.90
                    v0.1.91
                    v0.1.92
                    v0.1.93
                    v0.1.94
                    v0.1.95
                    v0.1.96
                    v0.1.97
                    v0.1.98
                    v0.1.99
                    v0.1.100
                    v0.1.101
                    v0.1.102
                    v0.1.103
                    v0.1.104
                    v0.2.0
                    v0.2.1
                    v0.2.2
                    v0.2.3
                    v0.2.4
                    v0.2.5
                    v0.2.6
                    v0.3.0
                    v0.3.1
                    v0.3.2
                    v0.3.3
                    v0.3.4
                    v0.3.5
                    v0.3.6
                    v0.3.7
                    v0.3.8
                    v0.4.0
                    v0.4.1
                    v0.4.2
                    v0.4.3
                    v0.4.4
                    v0.4.5
                    v0.4.6
                    v0.4.7
                    v0.4.8
                    v0.4.9
                    v0.4.10
                    v0.4.11
                    v0.4.12
                    v0.5.0
                    v0.5.1
                    v0.5.2
                    v0.5.3
                    v0.5.4
                    v0.5.5
                    v0.5.6
                    v0.5.7
                    v0.5.8
                    v0.5.9
                    v0.5.10
                    v0.6.0
                    v0.6.1
                    v0.6.2
                    v0.6.3
                    v0.6.4
                    v0.6.5
                    v0.6.6
                    v0.6.7
                    v0.6.8
                    v0.6.9
                    v0.6.10
                    v0.6.11
                    v0.6.12
                    v0.6.13
                    v0.6.14
                    v0.6.15
                    v0.6.16
                    v0.6.17
                    v0.6.18
                    v0.6.19
                    v0.6.20
                    v0.6.21
                    v0.7.0
                    v0.7.1
                    v0.7.2
                    v0.7.3
                    v0.7.4
                    v0.7.5
                    v0.7.6
                    v0.7.7
                    v0.7.8
                    v0.7.9
                    v0.7.10
                    v0.7.11
                    v0.7.12
                    v0.8.0
                    v0.8.1
                    v0.8.2
                    v0.8.3
                    v0.8.4
                    v0.8.5
                    v0.8.6
                    v0.8.7
                    v0.8.8
                    v0.8.9
                    v0.8.10
                    v0.8.11
                    v0.8.12
                    v0.8.13
                    v0.8.14
                    v0.8.15
                    v0.8.16
                    v0.8.17
                    v0.8.18
                    v0.8.19
                    v0.8.20
                    v0.8.21
                    v0.8.22
                    v0.8.23
                    v0.8.24
                    v0.8.25
                    v0.8.26
                    v0.8.27
                    v0.8.28
                    v0.9.0
                    v0.9.1
                    v0.9.2
                    v0.9.3
                    v0.9.4
                    v0.9.5
                    v0.9.6
                    v0.9.7
                    v0.9.8
                    v0.9.9
                    v0.9.10
                    v0.9.11
                    v0.9.12
                    v0.10.0
                    v0.10.1
                    v0.10.2
                    v0.10.3
                    v0.10.4
                    v0.10.5
                    v0.10.6
                    v0.10.7
                    v0.10.8
                    v0.10.9
                    v0.10.10
                    v0.10.11
                    v0.10.12
                    v0.10.13
                    v0.10.14
                    v0.10.15
                    v0.10.16
                    v0.10.17
                    v0.10.18
                    v0.10.19
                    v0.10.20
                    v0.10.21
                    v0.10.22
                    v0.10.23
                    v0.10.24
                    v0.10.25
                    v0.10.26
                    v0.10.27
                    v0.10.28
                    v0.10.29
                    v0.10.30
                    v0.10.31
                    v0.10.32
                    v0.10.33
                    v0.10.34
                    v0.10.35
                    v0.10.36
                    v0.10.37
                    v0.10.38
                    v0.10.39
                    v0.10.40
                    v0.10.41
                    v0.10.42
                    v0.10.43
                    v0.10.44
                    v0.10.45
                    v0.10.46
                    v0.10.47
                    v0.10.48
                    v0.11.0
                    v0.11.1
                    v0.11.2
                    v0.11.3
                    v0.11.4
                    v0.11.5
                    v0.11.6
                    v0.11.7
                    v0.11.8
                    v0.11.9
                    v0.11.10
                    v0.11.11
                    v0.11.12
                    v0.11.13
                    v0.11.14
                    v0.11.15
                    v0.11.16
                    v0.12.0
                    v0.12.1
                    v0.12.2
                    v0.12.3
                    v0.12.4
                    v0.12.5
                    v0.12.6
                    v0.12.7
                    v0.12.8
                    v0.12.9
                    v0.12.10
                    v0.12.11
                    v0.12.12
                    v0.12.13
                    v0.12.14
                    v0.12.15
                    v0.12.16
                    v0.12.17
                    v0.12.18
                    iojs-v1.0.0
                    iojs-v1.0.1
                    iojs-v1.0.2
                    iojs-v1.0.3
                    iojs-v1.0.4
                    iojs-v1.1.0
                    iojs-v1.2.0
                    iojs-v1.3.0
                    iojs-v1.4.1
                    iojs-v1.4.2
                    iojs-v1.4.3
                    iojs-v1.5.0
                    iojs-v1.5.1
                    iojs-v1.6.0
                    iojs-v1.6.1
                    iojs-v1.6.2
                    iojs-v1.6.3
                    iojs-v1.6.4
                    iojs-v1.7.1
                    iojs-v1.8.1
                    iojs-v1.8.2
                    iojs-v1.8.3
                    iojs-v1.8.4
                    iojs-v2.0.0
                    iojs-v2.0.1
                    iojs-v2.0.2
                    iojs-v2.1.0
                    iojs-v2.2.0
                    iojs-v2.2.1
                    iojs-v2.3.0
                    iojs-v2.3.1
                    iojs-v2.3.2
                    iojs-v2.3.3
                    iojs-v2.3.4
                    iojs-v2.4.0
                    iojs-v2.5.0
                    iojs-v3.0.0
                    iojs-v3.1.0
                    iojs-v3.2.0
                    iojs-v3.3.0
                    iojs-v3.3.1
                    v4.0.0
                    v4.1.0
                    v4.1.1
                    v4.1.2
                    v4.2.0 (LTS: Argon)
                    v4.2.1 (LTS: Argon)
                    v4.2.2 (LTS: Argon)
                    v4.2.3 (LTS: Argon)
                    v4.2.4 (LTS: Argon)
                    v4.2.5 (LTS: Argon)
                    v4.2.6 (LTS: Argon)
                    v4.3.0 (LTS: Argon)
                    v4.3.1 (LTS: Argon)
                    v4.3.2 (LTS: Argon)
                    v4.4.0 (LTS: Argon)
                    v4.4.1 (LTS: Argon)
                    v4.4.2 (LTS: Argon)
                    v4.4.3 (LTS: Argon)
                    v4.4.4 (LTS: Argon)
                    v4.4.5 (LTS: Argon)
                    v4.4.6 (LTS: Argon)
                    v4.4.7 (LTS: Argon)
                    v4.5.0 (LTS: Argon)
                    v4.6.0 (LTS: Argon)
                    v4.6.1 (LTS: Argon)
                    v4.6.2 (LTS: Argon)
                    v4.7.0 (LTS: Argon)
                    v4.7.1 (LTS: Argon)
                    v4.7.2 (LTS: Argon)
                    v4.7.3 (LTS: Argon)
                    v4.8.0 (LTS: Argon)
                    v4.8.1 (Latest LTS: Argon)
                    v5.0.0
                    v5.1.0
                    v5.1.1
                    v5.2.0
                    v5.3.0
                    v5.4.0
                    v5.4.1
                    v5.5.0
                    v5.6.0
                    v5.7.0
                    v5.7.1
                    v5.8.0
                    v5.9.0
                    v5.9.1
                    v5.10.0
                    v5.10.1
                    v5.11.0
                    v5.11.1
                    v5.12.0
                    v6.0.0
                    v6.1.0
                    v6.2.0
                    v6.2.1
                    v6.2.2
                    v6.3.0
                    v6.3.1
                    v6.4.0
                    v6.5.0
                    v6.6.0
                    v6.7.0
                    v6.8.0
                    v6.8.1
                    v6.9.0 (LTS: Boron)
                    v6.9.1 (LTS: Boron)
                    v6.9.2 (LTS: Boron)
                    v6.9.3 (LTS: Boron)
                    v6.9.4 (LTS: Boron)
                    v6.9.5 (LTS: Boron)
                    v6.10.0 (LTS: Boron)
                    v6.10.1 (Latest LTS: Boron)
                    v7.0.0
                    v7.1.0
                    v7.2.0
                    v7.2.1
                    v7.3.0
                    v7.4.0
                    v7.5.0
                    v7.6.0
                    v7.7.0
                    v7.7.1
                    v7.7.2
                    v7.7.3
                    v7.7.4
                    v7.8.0
                    [root@localhost install]# nvm install staable
                    Version 'staable' not found - try `nvm ls-remote` to browse available versions.
                    [root@localhost install]#
                    [root@localhost install]#


                    ★nodeインストール
                    [root@localhost install]# nvm install v7.8.0
                    Downloading and installing node v7.8.0...
                    Downloading https://nodejs.org/dist/v7.8.0/node-v7.8.0-linux-x64.tar.xz...
                    ######################################################################## 100.0%
                    Computing checksum with sha256sum
                    Checksums matched!
                    Now using node v7.8.0 (npm v4.2.0)
                    Creating default alias: default -> v7.8.0
                    [root@localhost install]#
                    [root@localhost install]#
                    [root@localhost install]# node -v
                    v7.8.0


                    ★expressいれる
                    [root@localhost install]# npm install -g express
                    /root/.nvm/versions/node/v7.8.0/lib
                    └─┬ express@4.15.2
                    ├─┬ accepts@1.3.3
                    │ ├─┬ mime-types@2.1.15
                    │ │ └── mime-db@1.27.0
                    │ └── negotiator@0.6.1
                    ├── array-flatten@1.1.1
                    ├── content-disposition@0.5.2
                    ├── content-type@1.0.2
                    ├── cookie@0.3.1
                    ├── cookie-signature@1.0.6
                    ├─┬ debug@2.6.1
                    │ └── ms@0.7.2
                    ├── depd@1.1.0
                    ├── encodeurl@1.0.1
                    ├── escape-html@1.0.3
                    ├── etag@1.8.0
                    ├─┬ finalhandler@1.0.1
                    │ ├── debug@2.6.3
                    │ └── unpipe@1.0.0
                    ├── fresh@0.5.0
                    ├── merge-descriptors@1.0.1
                    ├── methods@1.1.2
                    ├─┬ on-finished@2.3.0
                    │ └── ee-first@1.1.1
                    ├── parseurl@1.3.1
                    ├── path-to-regexp@0.1.7
                    ├─┬ proxy-addr@1.1.4
                    │ ├── forwarded@0.1.0
                    │ └── ipaddr.js@1.3.0
                    ├── qs@6.4.0
                    ├── range-parser@1.2.0
                    ├─┬ send@0.15.1
                    │ ├── destroy@1.0.4
                    │ ├─┬ http-errors@1.6.1
                    │ │ └── inherits@2.0.3
                    │ └── mime@1.3.4
                    ├── serve-static@1.12.1
                    ├── setprototypeof@1.0.3
                    ├── statuses@1.3.1
                    ├─┬ type-is@1.6.15
                    │ └── media-typer@0.3.0
                    ├── utils-merge@1.0.0
                    └── vary@1.1.1

                    [root@localhost install]#
                    [root@localhost install]#

                    [root@localhost install]# export NODE_PATH=/usr/local/lib/node_modules

                    [root@localhost install]# vi ~/.bash_profile

                    [root@localhost install]# npm link express
                    /home/install/node_modules/express -> /root/.nvm/versions/node/v7.8.0/lib/node_modules/express


                    [root@localhost install]#
                    [root@localhost install]#
                    [root@localhost install]#
                    [root@localhost install]# npm install -g express-generator
                    /root/.nvm/versions/node/v7.8.0/bin/express -> /root/.nvm/versions/node/v7.8.0/lib/node_modules/express-generator/bin/express-cli.js
                    /root/.nvm/versions/node/v7.8.0/lib
                    └─┬ express-generator@4.15.0
                    ├─┬ commander@2.9.0
                    │ └── graceful-readlink@1.0.1
                    ├── ejs@2.5.6
                    ├─┬ mkdirp@0.5.1
                    │ └── minimist@0.0.8
                    └── sorted-object@2.0.1

                    [root@localhost install]#


                    ただここまでして、nodeで起動したら、curlコマンドではアクセスできるのだが
                    ブラウザからはアクセスできなかった
                    ただディレクトリを変えるとアクセスできるようになった
                    本環境はwindowsと共通で、vagrantを使用しているのだが
                    node起動ディレクトリがwindowsと共通だとうまくいかないらしい。
                    実際にディレクトリを変えるとうまくいった
                    category:node.js | by:ittoocomments(0)trackbacks(0) | -

                    mongodbのデータ取り出し方の操作方法。検索と登録方法

                    2017.04.02 Sunday 10:55
                    0
                      # mongodb ログイン
                      mongo

                      #

                      MongoDBとRDBの用語比較(厳密には異なる)

                      MongDB RDB
                      データベース データベース
                      コレクション テーブル collections は RDBの テーブル
                      ドキュメント 行(レコード)
                      フィールド 列



                      # mongodb insert
                      collection
                      db.user_collect.insert({user_id: "uid001", age: 10, status: "A"})
                      db.user_collect.insert({user_id: "uid002", age: 20, status: "B"})
                      db.user_collect.insert({user_id: "uid003", age: 30, status: "B"})
                      db.user_collect.insert({ age: 40, status: "B"})
                      db.user_collect.insert({user_id: "uid005", age: 50, status: "C"})


                      # select 検索 参照
                      # 全文検索 select * from tbl
                      > db.user_collect.find()
                      { "_id" : ObjectId("58e0441a3708943450405c54"), "user_id" : "uid001", "age" : 10, "status" : "A" }
                      { "_id" : ObjectId("58e044243708943450405c55"), "user_id" : "uid002", "age" : 20, "status" : "B" }
                      { "_id" : ObjectId("58e044243708943450405c56"), "user_id" : "uid003", "age" : 30, "status" : "B" }
                      { "_id" : ObjectId("58e044323708943450405c57"), "age" : 40, "status" : "B" }
                      { "_id" : ObjectId("58e044323708943450405c58"), "user_id" : "uid005", "age" : 50, "status" : "C" }
                      >

                      # 件数をカウント
                      > db.user_collect.count()
                      5

                      または

                      > db.user_collect.find().count()
                      5
                      >

                      # limit指定 指定した件数のみを取得
                      > db.user_collect.find().limit(3)
                      { "_id" : ObjectId("58e05486aa5f6141259db9a2"), "user_id" : "uid001", "age" : 10, "status" : "A" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a3"), "user_id" : "uid002", "age" : 20, "status" : "B" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a4"), "user_id" : "uid003", "age" : 30, "status" : "B" }
                      >


                      # 検索フィールドを指定して検索
                      第1パラメータは、検索条件
                      第2パラメータで、検索フィールド
                      表示したいフィールドを1にする。非表示にしたい場合は0にする。
                      デフォルトで、_id が表示されるので非表示にしたい場合はこれをつかう
                      db.user_collection.find({}, user_id, age )

                      > db.user_collect.find({}, { age:1} )
                      { "_id" : ObjectId("58e0441a3708943450405c54"), "age" : 10 }
                      { "_id" : ObjectId("58e044243708943450405c55"), "age" : 20 }
                      { "_id" : ObjectId("58e044243708943450405c56"), "age" : 30 }
                      { "_id" : ObjectId("58e044323708943450405c57"), "age" : 40 }
                      { "_id" : ObjectId("58e044323708943450405c58"), "age" : 50 }
                      >

                      > db.user_collect.find({}, { _id:0 , age:1} )
                      { "age" : 10 }
                      { "age" : 20 }
                      { "age" : 30 }
                      { "age" : 40 }
                      { "age" : 50 }
                      >

                      # 検索(条件1つ)
                      > db.user_collect.find({ status:"B"})
                      { "_id" : ObjectId("58e044243708943450405c55"), "user_id" : "uid002", "age" : 20, "status" : "B" }
                      { "_id" : ObjectId("58e044243708943450405c56"), "user_id" : "uid003", "age" : 30, "status" : "B" }
                      { "_id" : ObjectId("58e044323708943450405c57"), "age" : 40, "status" : "B" }
                      >

                      # 検索(条件複数)
                      > db.user_collect.find({ status:"B",user_id:"uid002"})
                      { "_id" : ObjectId("58e044243708943450405c55"), "user_id" : "uid002", "age" : 20, "status" : "B" }
                      >
                      >

                      # 検索(条件 or検索)

                      findの第一引数に $or を指定する
                      条件は[]でくくり、それぞれの条件を {} でくくる

                      > db.user_collect.find({ $or: [ {status:"B"}, { status:"C"} ] })
                      { "_id" : ObjectId("58e044243708943450405c55"), "user_id" : "uid002", "age" : 20, "status" : "B" }
                      { "_id" : ObjectId("58e044243708943450405c56"), "user_id" : "uid003", "age" : 30, "status" : "B" }
                      { "_id" : ObjectId("58e044323708943450405c57"), "age" : 40, "status" : "B" }
                      { "_id" : ObjectId("58e044323708943450405c58"), "user_id" : "uid005", "age" : 50, "status" : "C" }
                      >
                      > db.user_collect.find(
                      { $or: [
                      { status:"B"},
                      { status:"C"}
                      ] }
                      )



                      # 比較演算子
                      演算子 MongoDB 概要 サンプル
                      = {name:'hoge'} nameの値がhogeの場合
                      < $lt 右辺より小さい { age:{$lt:100} }
                      <= $lte 右辺以下 { age:{$lte:100} }
                      > $gt 右辺より大きい { age:{$gt:100} }
                      >= $gte 右辺以上 { age:{$gte:100} }
                      != $ne 等しくない { name:{$ne:'mr.a'} }
                      該当なし $exists フィールド(列)自体の存在チェック db.mycol.find({ hoge:{$exists:false} })
                      OR $or $orで指定する条件のいずれかを満たすものを抽出 db.mycol.find({$or:[{loves:'apple'},{loves:'energon'}]})



                      # ageが20より大きい
                      > db.user_collect.find( { age : { $gt: 20 } } )
                      { "_id" : ObjectId("58e044243708943450405c56"), "user_id" : "uid003", "age" : 30, "status" : "B" }
                      { "_id" : ObjectId("58e044323708943450405c57"), "age" : 40, "status" : "B" }
                      { "_id" : ObjectId("58e044323708943450405c58"), "user_id" : "uid005", "age" : 50, "status" : "C" }
                      >
                      >

                      # ageが20以上
                      > db.user_collect.find( { age : { $gte: 20 } } )
                      { "_id" : ObjectId("58e044243708943450405c55"), "user_id" : "uid002", "age" : 20, "status" : "B" }
                      { "_id" : ObjectId("58e044243708943450405c56"), "user_id" : "uid003", "age" : 30, "status" : "B" }
                      { "_id" : ObjectId("58e044323708943450405c57"), "age" : 40, "status" : "B" }
                      { "_id" : ObjectId("58e044323708943450405c58"), "user_id" : "uid005", "age" : 50, "status" : "C" }
                      >
                      >
                      >
                      # ageが20より少ない
                      > db.user_collect.find( { age : { $lt: 20 } } )
                      { "_id" : ObjectId("58e0441a3708943450405c54"), "user_id" : "uid001", "age" : 10, "status" : "A" }
                      >
                      >

                      # ageが20より以下
                      > db.user_collect.find( { age : { $lte: 20 } } )
                      { "_id" : ObjectId("58e0441a3708943450405c54"), "user_id" : "uid001", "age" : 10, "status" : "A" }
                      { "_id" : ObjectId("58e044243708943450405c55"), "user_id" : "uid002", "age" : 20, "status" : "B" }
                      >
                      >

                      # like検索
                      > db.user_collect.find( { user_id : /id00/} )
                      { "_id" : ObjectId("58e0441a3708943450405c54"), "user_id" : "uid001", "age" : 10, "status" : "A" }
                      { "_id" : ObjectId("58e044243708943450405c55"), "user_id" : "uid002", "age" : 20, "status" : "B" }
                      { "_id" : ObjectId("58e044243708943450405c56"), "user_id" : "uid003", "age" : 30, "status" : "B" }
                      { "_id" : ObjectId("58e044323708943450405c58"), "user_id" : "uid005", "age" : 50, "status" : "C" }
                      >
                      >
                      > db.user_collect.find( { user_id : /id001/} )
                      { "_id" : ObjectId("58e0441a3708943450405c54"), "user_id" : "uid001", "age" : 10, "status" : "A" }
                      >
                      >


                      # in検索
                      > db.user_collect.find( { "user_id" : { $in:["uid001","uid002"]}} )
                      { "_id" : ObjectId("58e05486aa5f6141259db9a2"), "user_id" : "uid001", "age" : 10, "status" : "A" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a3"), "user_id" : "uid002", "age" : 20, "status" : "B" }
                      >

                      上のor検索もそうだけど、or検索やin検索の場合は、その後ろに[] で配列で条件を指定
                      その中身はそれぞれ{}でくくると覚えておくといいかな


                      # sort昇順
                      > db.user_collect.find().sort({age:1})
                      { "_id" : ObjectId("58e05486aa5f6141259db9a2"), "user_id" : "uid001", "age" : 10, "status" : "A" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a3"), "user_id" : "uid002", "age" : 20, "status" : "B" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a4"), "user_id" : "uid003", "age" : 30, "status" : "B" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a5"), "age" : 40, "status" : "B" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a6"), "user_id" : "uid005", "age" : 50, "status" : "C" }
                      >
                      >
                      >
                      # sort降順
                      > db.user_collect.find().sort({age:-1})
                      { "_id" : ObjectId("58e05486aa5f6141259db9a6"), "user_id" : "uid005", "age" : 50, "status" : "C" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a5"), "age" : 40, "status" : "B" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a4"), "user_id" : "uid003", "age" : 30, "status" : "B" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a3"), "user_id" : "uid002", "age" : 20, "status" : "B" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a2"), "user_id" : "uid001", "age" : 10, "status" : "A" }
                      >

                      sortは、findの外
                      sortはfindの時もそうだけど、していするばあいは({}) と外は{}で、中は{}でくくる必要がある





                      # 更新
                      > db.user_collect.update({user_id:"uid002"},{$set:{ age:21 }})
                      WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
                      >
                      > db.user_collect.find()
                      { "_id" : ObjectId("58e05486aa5f6141259db9a2"), "user_id" : "uid001", "age" : 10, "status" : "A" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a3"), "user_id" : "uid002", "age" : 21, "status" : "B" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a4"), "user_id" : "uid003", "age" : 30, "status" : "B" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a5"), "age" : 40, "status" : "B" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a6"), "user_id" : "uid005", "age" : 50, "status" : "C" }
                      >


                      # 削除 remove()
                      > db.user_collect.find()
                      { "_id" : ObjectId("58e05486aa5f6141259db9a2"), "user_id" : "uid001", "age" : 10, "status" : "A" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a3"), "user_id" : "uid002", "age" : 21, "status" : "B" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a4"), "user_id" : "uid003", "age" : 30, "status" : "B" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a5"), "age" : 40, "status" : "B" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a6"), "user_id" : "uid005", "age" : 50, "status" : "C" }

                      > db.user_collect.remove( { user_id:"uid002"} )
                      WriteResult({ "nRemoved" : 1 })


                      > db.user_collect.find()
                      { "_id" : ObjectId("58e05486aa5f6141259db9a2"), "user_id" : "uid001", "age" : 10, "status" : "A" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a4"), "user_id" : "uid003", "age" : 30, "status" : "B" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a5"), "age" : 40, "status" : "B" }
                      { "_id" : ObjectId("58e05486aa5f6141259db9a6"), "user_id" : "uid005", "age" : 50, "status" : "C" }
                      >



                      # 現在のデータベース状況を知る(ステータスじゃないよ、統計のstatsだよ)
                      > db.stats()
                      {
                      "db" : "test",
                      "collections" : 0,
                      "objects" : 0,
                      "avgObjSize" : 0,
                      "dataSize" : 0,
                      "storageSize" : 0,
                      "numExtents" : 0,
                      "indexes" : 0,
                      "indexSize" : 0,
                      "fileSize" : 0,
                      "ok" : 1
                      }
                      >

                      # データベース一覧
                      show dbs

                      # mongodbでは RDBでいう、create database、create tableは必要ない
                      use データベース名
                      でそのデータベース名にスイッチするが、その時点で存在してなくていい



                      MongoDBのデータ構造とRDBのデータ構造の比較
                      ---------------------------------------------------
                      RDBでの呼称 → MongoDBでの呼称
                      ・database → database
                      ・table → collection
                      ・row → document
                      ・column → field
                      ・index → index
                      ・primary key _→ id field
                      ※ MongoDBでは,"_id"の値に自動的に一意な文字列が採番される。
                      ---------------------------------------------------
                      mongodbでは操作する際に、つねにフィールド名(カラム名)の指定が必要。
                      つまりカラム名もいっしょにその都度登録される。
                      そのため、RDBとMongoDBの大きな違いとして
                      RDBではテーブル中のすべてのレコードが同じカラムを有するのに対し,
                      MongoDBではドキュメントごとに自由なフィールドを定義できる



                      データベース操作
                      MySQL MongoDB
                      > SHOW DATABASES; > show dbs
                      > USE testdb; > use testdb
                      > CREATE DATABASE testdb; useコマンドで自動生成
                      > DROP DATABASE testdb; > use testdb
                      > db.dropDatabase()
                      > DESC testdb; なし



                      > show collections
                      system.indexes
                      user_collect

                      > show dbs
                      aaaaa 0.078GB
                      local 0.078GB
                      testdb 0.078GB
                      >
                      category:mongodb | by:ittoocomments(0)trackbacks(0) | -

                      ad
                      Calender
                            1
                      2345678
                      9101112131415
                      16171819202122
                      23242526272829
                      3031     
                      << July 2017 >>
                      Selected entry
                      PR
                      Category
                      Archives
                      Recent comment
                      • マクドナルドでYahoo BBモバイルポイント 公衆無線LANサービスがつながらない
                        66hills
                      • マクドナルドでYahoo BBモバイルポイント 公衆無線LANサービスがつながらない
                        ssd
                      • マクドナルドでYahoo BBモバイルポイント 公衆無線LANサービスがつながらない
                        max
                      • マクドナルドでYahoo BBモバイルポイント 公衆無線LANサービスがつながらない
                        DOM
                      • マクドナルドでYahoo BBモバイルポイント 公衆無線LANサービスがつながらない
                        DOM
                      • コンピュータ業界の根本的な変化
                        cloud
                      • コンピュータ業界の根本的な変化
                        Dellの仮想化
                      • マクドナルドでYahoo BBモバイルポイント 公衆無線LANサービスがつながらない
                        えちごや
                      • マクドナルドでYahoo BBモバイルポイント 公衆無線LANサービスがつながらない
                        touch
                      • マクドナルドでYahoo BBモバイルポイント 公衆無線LANサービスがつながらない
                        bob77777
                      Recent trackback
                      • スマートフォンの法人活用例
                        無線LANネットのブログ
                      • Yahoo!オークションからのアフィリエイト収入が一気に70%減になってしまい涙目になってる話
                        特選情報
                      Recommend
                      Link
                      Profile
                      Search
                      Others
                      Mobile
                      qrcode
                      Powered
                      無料ブログ作成サービス JUGEM