Building From Source

Environment

JDK 11

  1. Check Java version: java -version. It must be equal to 11. If it is not, do the following steps.

  2. Install JDK 11:

    yum install java-11-openjdk
    
  3. Select default java mashine:

    sudo alternatives --config java
    
  4. Select previously installed JDK 11.

  5. Check it’s java -version:

    openjdk version "11.0.6"
    

PostgreSQL 11

  1. Configure the repo:

    rpm -Uvh https://yum.postgresql.org/11/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
    
  2. Install Postgres:

    yum install postgresql11-server
    
  3. Initialize a database:

    /usr/pgsql-11/bin/postgresql-11-setup initdb
    
  4. Enable PostgreSQL Server autorun:

    systemctl enable postgresql-11.service
    
  5. Allow IP4 local connections. Edit vi /var/lib/pgsql/11/data/pg_hba.conf:

    local   all             all                                     trust
    host    all             all             127.0.0.1/32            trust
    
  6. Start Postgres:

    systemctl start postgresql-11.service
    
  7. Check it’s status:

    systemctl status postgresql-11.service
    
  8. Install Postgres FWD package:

    yum install postgresql11-contrib
    

Elastic Search 7.X

  1. Register a repo:

    cat <<EOF | sudo tee /etc/yum.repos.d/elasticsearch.repo`
    
  2. Result example:

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

    yum clean all
    yum makecache
    
  4. Install ES:

    yum -y install elasticsearch-oss
    
  5. Change cluster’s name to unidata:

    vi /etc/elasticsearch/elasticsearch.yml
    
  6. Changed line:

    cluster.name: unidata
    
  7. Enable ES autorun:

    systemctl enable elasticsearch.service
    
  8. Start ES:

    systemctl start elasticsearch.service
    
  9. Check it’s status:

    systemctl status elasticsearch.service
    

Tomcat

  1. Install Tomcat:

    yum install tomcat tomcat-native
    
  2. Enable Tomcat autorun:

    systemctl enable tomcat
    
  3. Start Tomcat:

    systemctl start tomcat
    
  4. Check it’s status:

    systemctl status tomcat
    

Disabling SELinux

  1. Open the /etc/selinux/config file and set the SELINUX mode to disabled:

    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    #       enforcing - SELinux security policy is enforced.
    #       permissive - SELinux prints warnings instead of enforcing.
    #       disabled - No SELinux policy is loaded.
    SELINUX=disabled
    # SELINUXTYPE= can take one of these two values:
    #       targeted - Targeted processes are protected,
    #       mls - Multi Level Security protection.
    SELINUXTYPE=targeted
    
  2. Save the file and reboot your CentOS system:

    sudo shutdown -r now
    

Unidata Application

Deploying Third-party Resources

ES Dictionaries

Install ru_RU and en_US dictionaries. See official ES docs via https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-hunspell-tokenfilter.html.

Example steps:

cd /etc/elasticsearch/
mkdir hunspell
cd hunspell/
mkdir ru_RU
mkdir en_US
cd /etc/elasticsearch/hunspell/ru_RU
wget https://cgit.freedesktop.org/libreoffice/dictionaries/plain/ru_RU/ru_RU.dic
wget https://cgit.freedesktop.org/libreoffice/dictionaries/plain/ru_RU/ru_RU.aff
cd /etc/elasticsearch/hunspell/en_US
wget https://cgit.freedesktop.org/libreoffice/dictionaries/plain/en/en_US.dic
wget https://cgit.freedesktop.org/libreoffice/dictionaries/plain/en/en_US.aff
systemctl restart elasticsearch.service

Creating DB

  1. Switch to the postgres user account:

    su postgres
    
  2. Log in to PostgreSQL through the user account:

    psql -U postgres
    
  3. Create the unidata database:

    create database unidata;
    \quit
    

Preparing Unidata Configs & Libs

  1. Create unidata conf folder: mkdir /usr/share/tomcat/conf/unidata.

  2. Copy your backend.properties to Unidata conf folder.

  3. Copy your logback configuration Unidata conf folder.

  4. Add unidata properties to Tomcat Java options in /usr/share/tomcat/conf/tomcat.conf file:

    JAVA_OPTS="-Xms1024M -Xmx4096M  -Dunidata.conf=/usr/share/tomcat/conf/unidata/ -Dlogback.configurationFile=/usr/share/tomcat/conf/unidata/logback.xml -server"
    
  5. Download Postgres JDBC driver to Tomcat lib folder:

    cd /usr/share/tomcat/lib
    wget https://jdbc.postgresql.org/download/postgresql-42.2.12.jar
    
  6. Restart Tomcat systemctl restart tomcat

Deploying Unidata

  1. Download Unidata distributive (e.g., unidata-ce-r6.0-be9d4bd.tar.gz) to the TEMP folder.

  2. Unpack the tar.gz file.

  3. Deploy war file from <DIST_FOLDER>/Tomcat/webapps folder to the Tomcat (you can copy the file to /usr/share/Tomcat/webapps folder and Tomcat will automatically deploy it).

  4. Restart Tomcat:

    systemctl restart tomcat
    
  5. Check that there are no errors in /usr/share/tomcat/logs/unidata-backend.log, so that the lines look like this:

    2020-04-17 14:35:21,769 [localhost-startStop-1] [-] [-]  INFO  o.u.mdm.system.service.impl. ModuleServiceImpl.loadModule:289 - Module org.unidata.mdm. soap.core was started
    
    2020-04-17 14:35:27,969 [localhost-startStop-1]    [-] [-]  INFO  o.u.mdm.system.service.impl. ModuleServiceImpl. loadModules:138 - Modules were loaded
    
  6. Check that new schemas are created in unidata database (db created on previous steps).

  7. Check that all modules listed in the org_unidata_mdm_system.modules_info table have the LOADED status.

Unidata UI

Note

To develop your own application based on unidata-platform-ui, see the unidata-ui-template repo.

Before you start:

You should create a local config in config/local.yml with:

APP_TYPE:
- 'dataSteward' # data operator interface
- 'dataAdmin' # data admin
- 'systemAdmin' # admin part (users, roles, etc)

serverUrl:
'http://localhost:8081/unidata-backend/api/' # path to backend api

Start developing or building:

The application requires node v 12.14.

  1. Install the dependency:

    npm ci
    
  2. Run the application in dev mode:

    npm run dev
    
  3. Build the application:

    npm run build
    
  4. Build a docker image:

    docker build -t my_unidata_ui:0.0.0 .
    
  5. Or create the .war, if necessary:

    npm run create_war