Page tree
Skip to end of metadata
Go to start of metadata

Here you can find step by step instructions how to install and configure Nsys Platform.

Table of Contents

1.0 Overview

  • Instructions how to install Nsys Platform manually on Ubuntu 16.04 LTS server can be found below.
  • Instructions how to install Nsys Platform via nsys-installer.sh script on Unix/Linux can be found here.
  • You can use Docker CLI to run images with Nsys Platform

2.0 How to install Nsys

Console - Java 8 Installation
root@ubuntu:~# apt-get install openjdk-8-jdk
root@ubuntu:~# update-alternatives --display java
java - auto mode
  link best version is /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
  link currently points to /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
  link java is /usr/bin/java
  slave java.1.gz is /usr/share/man/man1/java.1.gz
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java - priority 1081
  slave java.1.gz: /usr/lib/jvm/java-8-openjdk-amd64/jre/man/man1/java.1.gz
root@ubuntu:~# echo -e "\n\nJAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64" >> /etc/environment
root@ubuntu:~# export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
root@ubuntu:~# echo $JAVA_HOME
/usr/lib/jvm/java-8-openjdk-amd64/
root@ubuntu:~# java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-0ubuntu4~16.04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
root@ubuntu:~# 
Console - Nsys Installation
root@ubuntu:~# adduser --system --shell /bin/bash --gecos 'Nsys Platform Control' --group --disabled-password --home /opt/nsys nsys
Adding system user `nsys' (UID 111) ...
Adding new group `nsys' (GID 120) ...
Adding new user `nsys' (UID 111) with group `nsys' ...
Creating home directory `/opt/nsys' ...
root@ubuntu:~# wget http://cloud.nsys.org/download/nsys-bundle.zip -P /tmp 
root@ubuntu:~# cp /tmp/nsys-bundle.zip /opt/nsys
root@ubuntu:~# cd /opt/nsys
root@ubuntu:/opt/nsys# unzip nsys-bundle.zip
root@ubuntu:/opt/nsys# mkdir -p /var/nsys/application-data/
root@ubuntu:/opt/nsys# chown -R nsys:nsys /opt/nsys/
root@ubuntu:/opt/nsys# chown -R nsys:nsys /var/nsys/application-data/
root@ubuntu:/opt/nsys# chmod -R 755 /opt/nsys/bin/*.sh
root@ubuntu:/opt/nsys# chmod -R 755 /opt/nsys/portal/bin/*.sh
root@ubuntu:/opt/nsys# chmod -R 775 /opt/nsys/portal/webapps
root@ubuntu:/opt/nsys# rm nsys-bundle.zip
root@ubuntu:/opt/nsys# cd
root@ubuntu:~# nano /opt/nsys/bin/nsys-daemon.env.sh
root@ubuntu:~# nano /opt/nsys/bin/nsys-portal.env.sh
root@ubuntu:~# cp /opt/nsys/bin/nsys-daemon.sh /etc/init.d/nsys-daemon
root@ubuntu:~# cp /opt/nsys/bin/nsys-portal.sh /etc/init.d/nsys-portal
root@ubuntu:~# chmod a+x /etc/init.d/nsys-daemon
root@ubuntu:~# chmod a+x /etc/init.d/nsys-portal
root@ubuntu:~# update-rc.d nsys-daemon defaults
root@ubuntu:~# update-rc.d nsys-portal defaults
root@ubuntu:~# /etc/init.d/nsys-daemon start
Running application:    /opt/nsys/bin/nsys-daemon.jar
Command line args:
Using NSYS_BASEDIR:     /opt/nsys
Using NSYS_HOME:        /var/nsys/application-data/daemon
Using JAVA:             /usr/lib/jvm/java-8-openjdk-amd64/bin/java
Using JAVA_VERSION:     18 (17 -> 1.7.0, 18 -> 1.8.0, ...)
Using JAVA_OPTS:        -Xms128m -Xmx256m  -Dnsys.home=/var/nsys/application-data/daemon -Dnsys.basedir=/opt/nsys -Dnsys.config=/opt/nsys/conf/nsys.cfg -Dnsys-boot.class.path=.|/opt/nsys/lib/hazelcast-3.6.3.jar|/opt/nsys/lib/nsys-cloudlet.jar|/opt/nsys/lib/nsys-core.jar|/opt/nsys/lib/nsys-daemon-core.jar|/opt/nsys/lib/nsys-firmware.jar|/opt/nsys/lib/nsys-plugins.jar|/opt/nsys/lib/nsys-portal.jar  -Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -Dlog4j.debug=false -Dlog4j.configuration=file:/opt/nsys/conf/log4j.xml
Starting Nsys Daemon ...
Nsys Daemon started
root@ubuntu:~# /etc/init.d/nsys-portal start
Using NSYS_BASEDIR:     /opt/nsys
Using NSYS_HOME:        /var/nsys/application-data/portal
Using JAVA:             /usr/lib/jvm/java-8-openjdk-amd64/bin/java
Using JAVA_VERSION:     18 (17 -> 1.7.0, 18 -> 1.8.0, ...)
Using JAVA_OPTS:        -Xms128m -Xmx384m  -Dnsys.home=/var/nsys/application-data/portal -Dnsys.basedir=/opt/nsys -Dnsys.config=/opt/nsys/conf/nsys-portal.cfg  -Dlog4j.debug=false -Dlog4j.configuration=file:/opt/nsys/conf/log4j-portal.xml
Using CATALINA_OPTS:    -server -Xss64M -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true
Using CATALINA_BASE:    /opt/nsys/portal
Using CATALINA_HOME:    /opt/nsys/portal
Using CATALINA_TMPDIR:  /opt/nsys/portal/temp
Using JRE_HOME:         /usr/lib/jvm/java-8-openjdk-amd64
Using CLASSPATH:        /opt/nsys/portal/bin/bootstrap.jar:/opt/nsys/portal/bin/tomcat-juli.jar
Tomcat started.
root@ubuntu:~# 
Edit /opt/nsys/bin/nsys-daemon.env.sh file:
#!/bin/bash

#
# One way to set the NSYS HOME path is here via this variable. Simply uncomment it and set a valid path like
# /var/nsys/application-data/daemon. You can of course set it outside in the command terminal, that will also work.
#
NSYS_HOME="/var/nsys/application-data/daemon"

#
# One way to set the custom NSYS CONFIG is here via this variable. Simply uncomment it and set a valid path like
# /opt/nsys/conf/nsys.cfg. You can of course set it outside in the command terminal, that will also work.
#
NSYS_CONFIG="/opt/nsys/conf/nsys.cfg"

#
# One way to set the custom LOG4J CONFIG is here via this variable. Simply uncomment it and set a valid path like
# /opt/nsys/conf/log4j.xml. You can of course set it outside in the command terminal, that will also work.
#
LOG4J_CONFIG="/opt/nsys/conf/log4j.xml"

#
# Occasionally support team may recommend that you set some specific JVM arguments. 
# You can use this variable below to do that.
#
JVM_SUPPORT_RECOMMENDED_ARGS=""

#
# The following 2 settings control the minimum and maximum given to the Nsys Daemon Java virtual machine.
# In larger Nsys Platform instances, the maximum amount will need to be increased.
#
JVM_MINIMUM_MEMORY="128m"
JVM_MAXIMUM_MEMORY="256m"

if [ "x$NSYS_HOME" = "x" ]; then
    NSYS_HOME="${NSYS_BASEDIR}/application-data/daemon"
    echo "Variable NSYS_HOME is missing! Using default..." >&2
fi

if [ "x$NSYS_CONFIG" = "x" ]; then
    NSYS_CONFIG="${NSYS_BASEDIR}/conf/nsys.cfg"
    echo "Variable NSYS_CONFIG is missing! Using default..." >&2
fi

if [ "x$LOG4J_CONFIG" = "x" ]; then
    LOG4J_CONFIG="${NSYS_BASEDIR}/conf/log4j.xml"
    echo "Variable LOG4J_CONFIG is missing! Using default..." >&2
fi

#
# The following creates classpaths for Nsys-Boot class loader.
# http://doc.nsys.org/display/NSYS/Nsys+Boot
#

NSYS_CLASSPATH="."

for entry in "$NSYS_BASEDIR"/lib/*.jar 
do
  NSYS_CLASSPATH="${NSYS_CLASSPATH}|${entry}"
done

#
# The following are the required arguments needed for Nsys Daemon.
#
JVM_REQUIRED_ARGS="-Dnsys.home=${NSYS_HOME} -Dnsys.basedir=${NSYS_BASEDIR} -Dnsys.config=${NSYS_CONFIG} -Dnsys-boot.class.path=${NSYS_CLASSPATH}"
JVM_REQUIRED_ARGS="${JVM_REQUIRED_ARGS} -Dnsys.daemon.port=9080"

JAVA_OPTS="-Xms${JVM_MINIMUM_MEMORY} -Xmx${JVM_MAXIMUM_MEMORY} ${JAVA_OPTS} ${JVM_REQUIRED_ARGS} ${NSYS_OPTS} ${JVM_SUPPORT_RECOMMENDED_ARGS}"

# PermGen size needs to be increased if encountering OutOfMemoryError: PermGen problems. 
# Specifying PermGen size is not valid on IBM JDKs.
JVM_MAX_PERM_SIZE=128m

if [ "$JAVA_VERSION" -lt 18 ]; then
    JAVA_OPTS="-XX:MaxPermSize=${JVM_MAX_PERM_SIZE} ${JAVA_OPTS}"
fi

JAVA_OPTS="${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true"
JAVA_OPTS="${JAVA_OPTS} -Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8"

if [ "$LOG4J_CONFIG" != "" ]; then
    JAVA_OPTS="${JAVA_OPTS} -Dlog4j.debug=false -Dlog4j.configuration=file:${LOG4J_CONFIG}"
fi

export JAVA_OPTS
Edit /opt/nsys/bin/nsys-portal.env.sh file:
#!/bin/bash

#
# One way to set the NSYS HOME path is here via this variable. Simply uncomment it and set a valid 
# path like /var/nsys/application-data/portal. You can of course set it outside in the command 
# terminal, that will also work.
#
NSYS_HOME="/var/nsys/application-data/portal"

#
# One way to set the custom NSYS CONFIG is here via this variable. Simply uncomment it and set a valid path like
# /opt/nsys/conf/nsys-portal.cfg. You can of course set it outside in the command terminal, that will also work.
#
NSYS_CONFIG="/opt/nsys/conf/nsys-portal.cfg"

#
# One way to set the custom LOG4J CONFIG is here via this variable. Simply uncomment it and set a valid path like
# /opt/nsys/conf/log4j-portal.xml. You can of course set it outside in the command terminal, that will also work.
#
LOG4J_CONFIG="/opt/nsys/conf/log4j-portal.xml"

#
# Occasionally support team may recommend that you set some specific JVM arguments. 
# You can use this variable below to do that.
#
JVM_SUPPORT_RECOMMENDED_ARGS=""

#
# The following 2 settings control the minimum and maximum given to the Nsys Portal Java virtual machine.
# In larger Nsys Platform instances, the maximum amount will need to be increased.
#
JVM_MINIMUM_MEMORY="128m"
JVM_MAXIMUM_MEMORY="384m"

if [ "x$NSYS_HOME" = "x" ]; then
    NSYS_HOME="${NSYS_BASEDIR}/application-data/portal"
    echo "Variable NSYS_HOME is missing! Using default..." >&2
fi

if [ "x$NSYS_CONFIG" = "x" ]; then
    NSYS_CONFIG="${NSYS_BASEDIR}/conf/nsys-portal.cfg"
    echo "Variable NSYS_CONFIG is missing! Using default..." >&2
fi

if [ "x$LOG4J_CONFIG" = "x" ]; then
    LOG4J_CONFIG="${NSYS_BASEDIR}/conf/log4j-portal.xml"
    echo "Variable LOG4J_CONFIG is missing! Using default..." >&2
fi

#
# The following are the required arguments needed for Nsys Portal.
#
JVM_REQUIRED_ARGS="-Dnsys.home=${NSYS_HOME} -Dnsys.basedir=${NSYS_BASEDIR} -Dnsys.config=${NSYS_CONFIG}"
JVM_REQUIRED_ARGS="${JVM_REQUIRED_ARGS} -Dnsys.portal.http.port=9060 -Dnsys.portal.https.port=9070"
JVM_REQUIRED_ARGS="${JVM_REQUIRED_ARGS} -Dnsys.portal.ajp.port=9050 -Dnsys.portal.rmi.port=9040"

JAVA_OPTS="-Xms${JVM_MINIMUM_MEMORY} -Xmx${JVM_MAXIMUM_MEMORY} ${JAVA_OPTS} ${JVM_REQUIRED_ARGS} ${NSYS_OPTS} ${JVM_SUPPORT_RECOMMENDED_ARGS}"

# PermGen size needs to be increased if encountering OutOfMemoryError: PermGen problems. 
# Specifying PermGen size is not valid on IBM JDKs.
JVM_MAX_PERM_SIZE=256m

if [ "$JAVA_VERSION" -lt 18 ]; then
    JAVA_OPTS="-XX:MaxPermSize=${JVM_MAX_PERM_SIZE} ${JAVA_OPTS}"
fi

JAVA_OPTS="${JAVA_OPTS} -Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8"

if [ "$LOG4J_CONFIG" != "" ]; then
    JAVA_OPTS="${JAVA_OPTS} -Dlog4j.debug=false -Dlog4j.configuration=file:${LOG4J_CONFIG}"
fi

export JAVA_OPTS

3.0 How to configure MySQL database

Console
root@ubuntu:~# mysql -u root -p
mysql> CREATE USER 'nsysuser'@'localhost' IDENTIFIED BY 'your_password';
mysql> CREATE DATABASE nsys DEFAULT CHARSET utf8;
mysql> GRANT ALL ON nsys.* TO nsysuser@'localhost';
mysql> quit
root@ubuntu:~# mv /opt/nsys/conf/database-portal.properties /opt/nsys/conf/database-portal.properties.original
root@ubuntu:~# cp /opt/nsys/conf/database.mysql.properties.dist /opt/nsys/conf/database-portal.properties
root@ubuntu:~# nano /opt/nsys/conf/database-portal.properties
root@ubuntu:~# /etc/init.d/nsys-portal restart
Edit /opt/nsys/conf/database-portal.properties file:
# This is a sample file for configuring Nsys Platform to use an external database.
# To make it effective, copy it to the "database.properties" file (Nsys Daemon) or
# "database-portal.properties" file (Nsys Portal) and modify the settings according
# to your environment.

# Database: MySQL

connectionDriver=com.mysql.jdbc.Driver
connectionDialect=org.hibernate.dialect.MySQLDialect
connectionUrl=jdbc:mysql://localhost:3306/nsys?useEncoding=true&characterEncoding=UTF-8
connectionProperties.user=nsysuser
connectionProperties.password=your_password


# Additional configuration properties

hibernate.generate_statistics=false
hibernate.cache.use_structured_entries=true
hibernate.show_sql=false
hibernate.format_sql=true
hibernate.hbm2ddl.auto=update
hibernate.cache.provider_class=org.hibernate.cache.NoCacheProvider
hibernate.connection.autoReconnect=true
hibernate.connection.autoReconnectForPools=true
hibernate.connection.is-connection-validation-required=true
hibernate.c3p0.acquire_increment=3
hibernate.c3p0.idle_test_period=14400
hibernate.c3p0.timeout=25200
hibernate.c3p0.min_size=3
hibernate.c3p0.max_size=15
hibernate.c3p0.max_statements=0
hibernate.c3p0.preferredTestQuery=select 1;

4.0 How to configure PostgreSQL database

Console
root@ubuntu:~# apt-get update
root@ubuntu:~# apt-get upgrade
root@ubuntu:~# apt-get install postgresql
root@ubuntu:~# su - postgres
postgres@ubuntu:~$ createuser nsysuser
postgres@ubuntu:~$ createdb -E UNICODE nsys
postgres@ubuntu:~$ psql
psql (9.5.3)
Type "help" for help.

postgres=# alter user postgres with password 'your_password';
ALTER ROLE
postgres=# alter user nsysuser with password 'your_password';
ALTER ROLE
postgres=# grant all privileges on database nsys to nsysuser;
GRANT
postgres=# \q
postgres@ubuntu:~$ nano /etc/postgresql/9.5/main/postgresql.conf
postgres@ubuntu:~$ exit
logout
root@ubuntu:~# /etc/init.d/postgresql restart
[ ok ] Restarting postgresql (via systemctl): postgresql.service.
root@ubuntu:~# mv /opt/nsys/conf/database-portal.properties /opt/nsys/conf/database-portal.properties.original
root@ubuntu:~# cp /opt/nsys/conf/database.postgresql.properties.dist /opt/nsys/conf/database-portal.properties
root@ubuntu:~# nano /opt/nsys/conf/database-portal.properties
root@ubuntu:~# /etc/init.d/nsys-portal restart
Edit /etc/postgresql/9.5/main/postgresql.conf file:
...

#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------

# - Connection Settings -

listen_addresses = 'localhost'          # what IP address(es) to listen on;

...

# - Security and Authentication -

password_encryption = on

...

Edit /opt/nsys/conf/database-portal.properties file:
# This is a sample file for configuring Nsys Platform to use an external database.
# To make it effective, copy it to the "database.properties" file (Nsys Daemon) or
# "database-portal.properties" file (Nsys Portal) and modify the settings according
# to your environment.

# Database: PostgreSQL

connectionDriver=org.postgresql.Driver
connectionDialect=org.hibernate.dialect.PostgreSQLDialect
connectionUrl=jdbc:postgresql://localhost:5432/nsys
connectionProperties.user=nsysuser
connectionProperties.password=your_password


# Additional configuration properties

hibernate.generate_statistics=false
hibernate.cache.use_structured_entries=true
hibernate.show_sql=false
hibernate.format_sql=true
hibernate.hbm2ddl.auto=update
hibernate.cache.provider_class=org.hibernate.cache.NoCacheProvider
hibernate.connection.autoReconnect=true
hibernate.connection.autoReconnectForPools=true
hibernate.connection.is-connection-validation-required=true
hibernate.c3p0.acquire_increment=1
hibernate.c3p0.idle_test_period=40
hibernate.c3p0.timeout=1800
hibernate.c3p0.min_size=5
hibernate.c3p0.max_size=20
hibernate.c3p0.max_statements=50
hibernate.c3p0.preferredTestQuery=select 1;
  • No labels