Building From Source¶
Environment¶
JDK 11¶
Check Java version:
java -version
. It must be equal to 11. If it is not, do the following steps.Install JDK 11:
yum install java-11-openjdk
Select default java mashine:
sudo alternatives --config java
Select previously installed JDK 11.
Check it’s
java -version
:openjdk version "11.0.6"
PostgreSQL 11¶
Configure the repo:
rpm -Uvh https://yum.postgresql.org/11/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
Install Postgres:
yum install postgresql11-server
Initialize a database:
/usr/pgsql-11/bin/postgresql-11-setup initdb
Enable PostgreSQL Server autorun:
systemctl enable postgresql-11.service
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
Start Postgres:
systemctl start postgresql-11.service
Check it’s status:
systemctl status postgresql-11.service
Install Postgres FWD package:
yum install postgresql11-contrib
Elastic Search 7.X¶
Register a repo:
cat <<EOF | sudo tee /etc/yum.repos.d/elasticsearch.repo`
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
Refresh yum:
yum clean all yum makecache
Install ES:
yum -y install elasticsearch-oss
Change cluster’s name to
unidata
:vi /etc/elasticsearch/elasticsearch.yml
Changed line:
cluster.name: unidata
Enable ES autorun:
systemctl enable elasticsearch.service
Start ES:
systemctl start elasticsearch.service
Check it’s status:
systemctl status elasticsearch.service
Tomcat¶
Install Tomcat:
yum install tomcat tomcat-native
Enable Tomcat autorun:
systemctl enable tomcat
Start Tomcat:
systemctl start tomcat
Check it’s status:
systemctl status tomcat
Disabling SELinux¶
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
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¶
Switch to the postgres user account:
su postgres
Log in to PostgreSQL through the user account:
psql -U postgres
Create the unidata database:
create database unidata; \quit
Preparing Unidata Configs & Libs¶
Create unidata conf folder:
mkdir /usr/share/tomcat/conf/unidata
.Copy your backend.properties to Unidata conf folder.
Copy your logback configuration Unidata conf folder.
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"
Download Postgres JDBC driver to Tomcat lib folder:
cd /usr/share/tomcat/lib wget https://jdbc.postgresql.org/download/postgresql-42.2.12.jar
Restart Tomcat
systemctl restart tomcat
Deploying Unidata¶
Download Unidata distributive (e.g., unidata-ce-r6.0-be9d4bd.tar.gz) to the TEMP folder.
Unpack the
tar.gz
file.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).
Restart Tomcat:
systemctl restart tomcat
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
Check that new schemas are created in unidata database (db created on previous steps).
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.
Install the dependency:
npm ci
Run the application in dev mode:
npm run dev
Build the application:
npm run build
Build a docker image:
docker build -t my_unidata_ui:0.0.0 .
Or create the .war, if necessary:
npm run create_war