on-premise-new

Ubuntu 18.04 64 bit – Single machine (on premise)

Hardware requirements

To install sibylla on your system you need at least:

  • 4 core CPU
  • 16 GB RAM
  • 256 GB of disk space

Prerequisites

To install sibylla on your system you need to install:

  • JRE 11 (commercial or open)
  • node 11.2.0
  • nginx (It is the entry point for the Sibylla platform: console, cores, gateways, …)
  • A user sibylla (group sibylla)
  • Utilities: vi, wget, …

Download the sibylla installation package (community edition)

Login into the machine as user: sibylla (group sibylla).

Get the product from here and place in the parent directory you want sibylla to be installed:

  • cd <parent directory of the sibylla product> (Suggested: the home directory of the sibylla user)
  • wget https://github.com/greenvulcano/sibylla-documentation/releases/download/1.0.0-RELEASE/sibylla-1.0.0.tar.gz

Prepare the directory structure

Login into the machine as user: sibylla (group sibylla).

From the parent directory where you want to install sibylla, untar the sibylla package:

  • tar xzvf sibylla-1.0.tar

Set the environment

Modify the sibylla/scripts/set-environment.source-me to meet your environment:

  • vi sibylla/scripts/set-environment.source-me
    • Verify these ENV variables and set them to the correct path. If for you is ok this setting, skip this step
      • export PRJ_HOME=”/home/`whoami`/<folder in which the sibylla tar was extracted”
      • export SIBYLLA_HOME=$PRJ_HOME

Load the sibylla environment at login:

  • vi .bashrc (or equivalent)
    • Add this line at the end of the script
      • source <path to the sibylla directory>/scripts/set-environment.source-me

Test the new settings: logout and login. You should see the Sibylla IoT platform splash screen.

Download these third parties software (portable option)

You can skip any of these steps if you already have these components installed somewhere else, as for example in the case MySql is installed externally on a different machine or as a service on the same machine. In this case make sure you have full control of these components and save the connection parameters somewhere, because you will need the connection information.

The procedure that follows consider the “portable application” approach:

Download the packages into this directory:

  • cd $SIBYLLA_HOME/downloads
  • wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.15-linux-glibc2.12-x86_64.tar.xz
  • wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.0.6.tgz
  • wget http://it.apache.contactlab.it/kafka/2.1.1/kafka_2.12-2.1.1.tgz
  • wget http://it.apache.contactlab.it//activemq/5.15.9/apache-activemq-5.15.9-bin.tar.gz
  • wget https://www.emqx.io/downloads/broker/v3.1-beta.2/emqx-ubuntu18.04-v3.1-beta.2.zip
  • wget http://downloads.metabase.com/v0.31.2/metabase.jar
Package Version Download at
MySQL 8.0 – Linux generic – 64 bits mysql-8.0.15-linux-glibc2.12-x86_64.tar.xz
Mongo 4.0.6 – Ubuntu 18.04 64 bits – tgz mongodb-linux-x86_64-ubuntu1804-4.0.6.tgz
Kafka 2.1.1 – Scala 2.12 – kafka_2.12-2.1.1.tgz (asc, sha512) kafka_2.12-2.1.1.tgz
ActiveMQ Unix/Linux/Cygwin Distribution apache-activemq-5.15.9-bin.tar.gz
EMQTT Linux – 3.1* – Ubuntu 18.04 – Zip emqx-ubuntu18.04-v3.1-beta.2.zip
Metabase Custom install – v0.31.2 metabase.jar

Install third party software (portable option)

This part of the procedure will prepare and test all 3rd party software.

MySQL

Untar mysql into the sibylla/3rd-party/db-domain/bin directory:

  • cd $SIBYLLA_HOME/3rd-party/db-domain/bin
  • tar -xJvf $SIBYLLA_HOME/downloads/mysql-8.0.15-linux-glibc2.12-x86_64.tar.xz
  • ln -s mysql-8.0.15-linux-glibc2.12-x86_64 mysql

MYSQL configuration and DB initialization (In case of doubts follow the official procedure defined at MySQL docs)

  • sibyl setup db
  • cd $SIBYLLA_HOME/3rd-party/db-domain
  • ./bin/mysql/bin/mysqld –defaults-file=./config/sibylla.cnf –initialize
    • Only 4 Docker (libs not previously installed)
      • apt-get install libaio1 libaio-dev
      • apt-get install numactl
  • ./bin/mysql/bin/mysql_ssl_rsa_setup –defaults-file=./config/sibylla.cnf
  • ./bin/mysql/bin/mysqld –defaults-file=./config/sibylla.cnf &

Change password:

Note: A root auto generated password has been create by the “initialize” command

  • grep password ./logs/mysql.log
    • Example: 2019-03-08T22:36:20.410102Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: #=heSyL3dfTF
  • bin/mysql/bin/mysql -u root -p
    • ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘root’;
    • CREATE USER ‘sibylla’ IDENTIFIED BY ‘sibylla’;
    • CREATE SCHEMA sibylla;
    • GRANT ALL PRIVILEGES ON sibylla.* TO ‘sibylla’@’%’;
    • use sibylla;
    • show tables;

Start/stop MySQL (using the scripts):

  • cd $SIBYLLA_HOME/3rd-party/db-domain
  • scripts/start.sh
  • scripts/stop.sh (STOP needs a password. It is requested when you issue the command)

MongoDB

Untar the product:

  • cd $SIBYLLA_HOME/3rd-party/mongodb-domain/bin
  • tar xzvf $SIBYLLA_HOME/downloads/mongodb-linux-x86_64-ubuntu1804-4.0.6.tgz
    • Only 4 Docker (libs not previously installed)
      • apt-get install curl
      • apt-get install -y tzdata
  • ln -s mongodb-linux-x86_64-ubuntu1804-4.0.6 mongodb

MongoDB configuration:

  • sibyl setup mongodb

Start/stop MongoDB:

  • cd $SIBYLLA_HOME/3rd-party/mongodb-domain
  • scripts/start.sh
  • scripts/stop.sh

Kafka

Untar the product:

  • cd $SIBYLLA_HOME/3rd-party/kafka-domain
  • tar xzvf $SIBYLLA_HOME/downloads/kafka_2.12-2.1.1.tgz
  • ln -s kafka_2.12-2.1.1 kafka

Kafka and Zookeper configuration:

  • sibyl setup kafka
  • sibyl setup zk

Start/stop Kafka:

  • cd $SIBYLLA_HOME/3rd-party/kafka-domain
  • scripts/start.sh
  • scripts/stop.sh

ActiveMQ

Prepare the directory structure:

  • cd $SIBYLLA_HOME/3rd-party/jms-domain
  • tar xvzf $SIBYLLA_HOME/downloads/apache-activemq-5.15.9-bin.tar.gz
  • ln -s apache-activemq-5.15.9 activemq

ActiveMQ configuration:

  • sibyl setup jms-main

Start/stop ActiveMQ:

  • cd $SIBYLLA_HOME/3rd-party/jms-domain
  • scripts/start.sh
  • scripts/stop.sh

EMQX

Untar the product:

  • cd $SIBYLLA_HOME/3rd-party/mqtt-domain
  • unzip $SIBYLLA_HOME/downloads/emqx-ubuntu18.04-v3.1-beta.2.zip
  • Version the installation to simplify future upgrade and tranfer of data:
    • mv emqx emqx-v3.1-beta.2
    • ln -s emqx-v3.1-beta.2 emqx

EMQX: configuration

  • The configuration file is under ./emqx/etc. The basic installation does not require any specific configuration

Start/stop EMQX:

  • cd $SIBYLLA_HOME/3rd-party/mqtt-domain
  • scripts/start.sh
  • scripts/stop.sh

Metabase

Untar the product:

  • cd $SIBYLLA_HOME/3rd-party/analytics-domain/metabase/bin
  • cp $SIBYLLA_HOME/downloads/metabase.jar .

Configure Metabase:

  • cd $SIBYLLA_HOME/3rd-party/analytics-domain/metabase
  • vi scripts/start.sh (only if necessary to change exposed port)

Start/stop Metabase:

  • cd $SIBYLLA_HOME/3rd-party/analytics-domain/metabase
  • scripts/start.sh
  • scripts/stop.sh

Sibylla Platform

Download the platform:

  • sibyl download-app

Configure the plaform:

  • sibyl setup core

Console installation & setup

In order to install the WebApp’s backend service, move into sibylla/, download the console and unzip the file. The configuration file’s default endpoints are http://localhost if you want to change them you have to run the following commands:
-$ cd dist/config
-$ nano/vi/vim environment.js

  • Change endopoints:
"use strict";
Object.defineProperty(export const environment = {
    mongoUrl: 'mongodb://localhost:27017/sibylla',
    metabaseSiteUrl: "http://localhost:19180",
    metabaseSecretKey: "",
    webGisFolderPath: "",
    webGisWritePath: ""
 };

mongoUrl syntax is is divided between these two methods:

  • One MongoDB instance: mongodb://*MONGO_URL*/gv_iot_webapp
  • Multiple MongoDB instance: mongodb://*1_MONGO_URL*,*2_MONGO_URL*,.../gv_iot_webapp

-$ cd ../../
-$ cd src/dist/sibylla/assets
-$ nano/vi/vim appConfig.json

  • Change the webapp endopoints:
{
        "production": true,
        "apiUrl": "http://localhost:18180/sibylla",
        "nodeApiUrl": "http://localhost:3000",
        "metabaseApiUrl": "http://10.100.60.210:19180",
        "socketIoConfigUrl": "http://localhost:3000",
        "myRxStompConfig": {
                "brokerUrl": "ws://localhost:51614/stomp",
                "login": "guest",
                "passcode": "guest",
                "heartbeatIncoming": 0,
                "heartbeatOutgoing": 20000,
                "reconnectDelay": 200
        }
}

Now you can either run the app by using the sibylla-console-start.sh npm, or if you have installed Forever.JS you can run:
sibylla-console-start.sh forever.
The installation now is finished, your application will be hosted on localhost:3000 or either the port you’ve specified in the server.js file.

If you want to stop the Sibylla Console run sibylla-console-stop.sh .

Configure the application

Configure sibylla.conf

Modify the content of the file to reflect your environment:

##############################################
# Instance name          #   port    hosts
##############################################
db                                   localhost
mongodb                              localhost
zk                                   localhost
kafka                                localhost
jms-main                             localhost
metabase                             localhost
core                     1   18180   localhost
console                              localhost
n-1-gateway-http         1   21100   localhost
n-1-gateway-mqtt         1           localhost
n-1-datapump-mongodb     1           localhost
n-1-datapump-websocket   1           localhost

Configure the core

Configure the console

Configure the sibylla-network-1/sibylla-gateway

Configure the sibylla-network-1/sibylla-datapump

Configure the sibylla-network-1/sibylla-datapump-websocket

Test the start and stop of the application

  • iot start (or sibylla start)

Next reading: Getting started guide