2.1. ICE Coreのセットアップ (Linux)

2.1.1. ICE Coreのファイル展開

{ICE Core物件}{ICE_HOME} で展開します。

例) {ICE_HOME} が/opt/nec/pf/ice、{ICE Core物件} がiot_connectivity_engine_core-x86-1.2.3.tar.gzの場合

# mkdir -p /opt/nec/pf/ice

# cd /opt/nec/pf/ice

# tar xzf iot_connectivity_engine_core-x86-1.2.3.tar.gz

注釈

インストールパス中に日本語やスペースを含む場所にはインストールできません。

2.1.2. ICE Coreの設定変更

{ICE_HOME}/core/conf/core_config.jsonを修正し以下の項目を設定します。

  • edge_id

    次のコマンドを実行してICE CoreにエッジIDを設定します。 <エッジID>には、他のエッジと重複しない文字列を指定してください。

    # /opt/nec/pf/ice/core/bin/configedit set -s edge_id <エッジID>
    

2.1.3. サービスの登録

  • rcスクリプトの修正

    {ICE_HOME}/core/bin/ice-edge-core の下記行を修正します。

    ICEを既定と異なる場所にインストールする場合は、59行目のICE_HOMEのパスを変更します。

    ICE_HOME=${ICE_HOME-/opt/nec/pf/ice/core}
    

    pidファイルとlockファイルの配置先を変更する場合は、8~9行目と63~64行目の設定を変更します。

    # pidfile: /tmp/ice/ice-edge-core.pid
    # lockfile: /tmp/ice/ice-edge-core.lock
    
    PIDFILE=/tmp/ice/${service}.pid
    LOCKFILE=/tmp/ice/${service}.lock
    

注釈

tmpwatchなど/tmp下のファイルが定期削除されるような設定になっている場合、このpidfile, lockfileのパス変更は必須です。/var/tmp下などを指定してください。

  • サービスの登録と有効化

    • systemd をサポートするOSの場合

      # cp /opt/nec/pf/ice/core/bin/ice-edge-core /etc/init.d/
      
      # systemctl daemon-reload
      
      # systemctl enable ice-edge-core
      
      # systemctl status ice-edge-core
        (Loaded: の項目が loaded である事を確認する)
      
    • SysV init をサポートするRed Hat系OSの場合

      # cp /opt/nec/pf/ice/core/bin/ice-edge-core /etc/init.d/
      
      # chkconfig --add ice-edge-core
      
      # chkconfig --list | grep ice-edge-core
       (下記のように出力されることを確認する)
       ice-edge-core   0:off   1:off   2:on    3:on    4:on    5:on    6:off
      
    • Upstart をサポートするOSの場合

      # cp /opt/nec/pf/ice/core/bin/ice-edge-core /etc/init.d/
      
      # insserv -d ice-edge-core
      
      # ls -l /etc/rc?.d/ | grep ice-edge-core
       (下記のように、ファイル名とシンボリックリンクが出力されることを確認する)
       <ファイルのオーナ、日付等> K01ice-edge-core -> ../init.d/ice-edge-core
       <ファイルのオーナ、日付等> K01ice-edge-core -> ../init.d/ice-edge-core
       <ファイルのオーナ、日付等> S01ice-edge-core -> ../init.d/ice-edge-core
       <ファイルのオーナ、日付等> S01ice-edge-core -> ../init.d/ice-edge-core
       <ファイルのオーナ、日付等> S01ice-edge-core -> ../init.d/ice-edge-core
       <ファイルのオーナ、日付等> S01ice-edge-core -> ../init.d/ice-edge-core
       <ファイルのオーナ、日付等> K01ice-edge-core -> ../init.d/ice-edge-core