Menu

Ubuntu 16

Koji Kamei

ubuntu 16.04 LTS への UNR プラットフォームのインストール

ubuntu 16.04 LTS の環境構築

  • 16.04.5 LTS (desktop, amd64) の ISO イメージを取得。http://releases.ubuntu.com/16.04/ubuntu-16.04.5-desktop-amd64.iso
  • (vmware fusion pro 10 / macos 上に ) ubuntu 16.04 LTS をインストール。
  • 実行用のユーザ (unr) を作成。

  • unrpf の build フォルダを展開

% wget http://irc.atr.jp/std/unrpf-2013-release/unrpf-20181030.tgz
% tar zxpvf unrpf-20181030.tgz
  • java 8 をインストール
% sudo add-apt-repository ppa:webupd8team/java
% sudo apt update
% sudo apt install oracle-java8-installer
  • glassfish5 (J2EE8) をインストール
% wget http://download.oracle.com/glassfish/5.0/release/glassfish-5.0.zip
% unzip glassfish-5.0.zip
% sudo chown -r root:root glassfish5
% sudo mv glassfish5 /usr/local
  • postgresql 9.5 をインストール
% sudo apt install postgresql
  • /etc/postgresql/9.5/main/postgresql.conf の編集 (diff で示します)
unr@unr-ubuntu16:/etc/postgresql/9.5/main$ diff -c postgresql.conf postgresql.conf.orig 
*** postgresql.conf 2018-11-08 15:31:06.625226217 +0900
--- postgresql.conf.orig    2018-11-08 14:33:46.743174568 +0900
***************
*** 59,65 ****
  #listen_addresses = 'localhost'       # what IP address(es) to listen on;
                    # comma-separated list of addresses;
                    # defaults to 'localhost'; use '*' for all
- listen_addresses = '*'
                    # (change requires restart)
  port = 5432               # (change requires restart)
  max_connections = 100         # (change requires restart)
--- 59,64 ----
unr@unr-ubuntu16:/etc/postgresql/9.5/main$ 
  • /etc/postgresql/9.5/main/pg_hba.conf の編集 (diff で示します)
unr@unr-ubuntu16:/etc/postgresql/9.5/main$ sudo diff -c pg_hba.conf pg_hba.conf.orig 
*** pg_hba.conf 2018-11-08 15:34:14.507704749 +0900
--- pg_hba.conf.orig    2018-11-08 13:12:36.419315313 +0900
***************
*** 89,96 ****
  # "local" is for Unix domain socket connections only
  local   all             all                                     peer
  # IPv4 local connections:
! #host    all             all             127.0.0.1/32            md5
! host  all     all     0.0.0.0/0 trust
  # IPv6 local connections:
  host    all             all             ::1/128                 md5
  # Allow replication connections from localhost, by a user with the
--- 89,95 ----
  # "local" is for Unix domain socket connections only
  local   all             all                                     peer
  # IPv4 local connections:
! host    all             all             127.0.0.1/32            md5
  # IPv6 local connections:
  host    all             all             ::1/128                 md5
  # Allow replication connections from localhost, by a user with the
  • postgresql のユーザおよびデータベース作成
% sudo -u postgres createuser -s unr
% createdb unrDB
% cd /home/unr/unrpf/platform/core/unrPF/setupDB
% psql unrDB -f table_definition.txt
% psql unrDB -f create_search_function.txt
% psql unrDB -f INSERT_userinfo.txt
% psql unrDB -f INSERT_userattribute.txt
% psql unrDB -f INSERT_managementuser.txt
% psql unrDB -f INSERT_Navigation.txt
% psql unrDB -f INSERT_RoISCommon.txt
% psql unrDB -f INSERT_SpeechRecognition.txt
% psql unrDB -f INSERT_SpeechSynthesis.txt
% psql unrDB -f INSERT_SpeechSynthesis2.txt
% psql unrDB -f insert_cleaning.txt
% psql unrDB -f insert_moving.txt
% psql unrDB -f insert_persondetection.txt
% psql unrDB -f insert_photocapture.txt
% psql unrDB -f insert_resource_Monitor.txt
  • データベースアクセスモジュールの glassfish への deploy と起動
% cd /home/unr/unrpf/platform/dist/unrDBAccessServer
% sudo cp unrDBAccessServer.war /usr/local/glassfish5/glassfish/domains/domain1/autodeploy/
% sudo /usr/local/glassfish5/bin/asadmin start-domain domain1
  • データベースアクセスモジュールの待ち受けポートを 8080 から 8081 に変更

    • glassfish のコンソールをブラウザで開く http://localhost:4848/
    • Configurations -> server-config -> Network Config -> Network Listeners を開く
    • http-listeners-1 を開き port を 8081 に変更して save
  • UNR Platform の起動

% cd /home/unr/unrpf/platform/module/pf
% sh exec.sh
  • test component の起動(別のターミナルを開いて)
% cd /home/unr/unrpf/platform/module/unrTestComponent
% sh exec.sh
  • test service の起動(別のターミナルを開いて)
% cd /home/unr/unrpf/platform/module/testServiceAppA
% sh exec.sh

Related

Wiki: UNR Platform