Installation Guide

Install Dependencies

This guide was written for Ubuntu 14.04 LTS. GreenBus runs on any platform that supports Java, PostgreSQL, and Apache Qpid.

First, update the package manager and install the GreenBus dependencies:

ubuntu@ubuntu:~$ sudo apt-get update

ubuntu@ubuntu:~$ sudo apt-get install openjdk-7-jdk postgresql qpidd

Broker Configuration

By default, the Qpid distribution has SASL authorization enabled. For testing and development purposes, the Qpid broker can be configured to run without SSL or authorization.

The Qpid broker configuration file is at the following path: /etc/qpid/qpidd.conf

Replace the configuration file with this simplified version:

auth=no
tcp-nodelay=1

log-to-syslog=yes
log-to-stderr=no
log-time=no

pid-dir=/var/run/qpid

data-dir=/var/spool/qpid
mgmt-enable=yes

Restart the broker:

ubuntu@ubuntu:~$ sudo service qpidd restart

Download And Install GreenBus

GreenBus needs to be downloaded and unpackaged, and the PostgreSQL database needs to be initialized.

Download the GreenBus distribution:

ubuntu@ubuntu:~$ wget https://github.com/gec/greenbus/releases/download/v3.0.0/greenbus-3.0.0.tar.gz

ubuntu@ubuntu:~$ tar -xf greenbus-3.0.0.tar.gz

PostgreSQL needs to be initialized with the GreenBus user and databases. The init_postgres.sql SQL script in the etc/ subdirectory contains the initialization and needs to be fed to the psql utility:

ubuntu@ubuntu:~$ cd greenbus-3.0.0/

ubuntu@ubuntu:~/greenbus-3.0.0$ sudo su postgres -c psql < etc/init_postgres.sql

The resetdb utility needs to be run to (re-)initialize the database tables. Note that this will wipe all data in an existing GreenBus installation.

ubuntu@ubuntu:~/greenbus-3.0.0$ bin/greenbus resetdb
Proceed with modifications? (y/N)
y

ubuntu@ubuntu:~/greenbus-3.0.0$

Distribution Directory

In the distribution tarball are the following directories:

Directory Description
bin/ Contains the greenbus script used to run services and utilities.
etc/ Contains configuration for processes.
install/ Contains a script, install_service_alias.sh that creates a Linux init.d service for a GreenBus service.
lib/ Contains binary libraries and the configuration necessary to start Java processes.
samples/ Contains model XML samples.
var/ Contains log files under var/log/[process name]/.

Running Processes

To run service (background) processes:

bin/greenbus services start

To run utility processes:

bin/greenbus import config.xml

To see help for utility processes:

bin/greenbus export --help

Services

Name Description
services Core stateless services.
processing Measurement processor front end register with.
calculation Calculation protocol front end.
simulator Simulator protocol front end.

Utilities

Name Description
auth-export Exports the authorization XML format.
auth-import Imports the authorization XML format.
cli Runs the command line interface utility.
event-export Exports the event configuration XML format.
event-import Imports the event configuration XML format.
export Exports the system model configuration format.
import Imports the system model configuration format.
resetdb Initializes or wipes the PostgreSQL database.

Installing System Services

The install/ directory contains a script to create init.d scripts for Linux in order to install GreenBus processes as system-wide services that start on boot.

Use the install_service_alias.sh script by specifying the local name first followed by the init.d service name to create:

ubuntu@ubuntu:~/greenbus-3.0.0$ sudo install/install_service_alias.sh services greenbus-services

The GreenBus process can then be called with start, stop, or restart:

ubuntu@ubuntu:~/greenbus-3.0.0$ sudo service greenbus-services start
Starting services...
19611
ubuntu@ubuntu:~/greenbus-3.0.0$ sudo service greenbus-services stop
Stopping services.
Waiting for services to stop....
ubuntu@ubuntu:~/greenbus-3.0.0$

Installing Add-On Modules

GreenBus modules like the Modbus and DNP3 adapters come in their own distributions. To run, they need to be folded into an existing copy of the base GreenBus installation.

First, download and unpackage the module:

cd ../
wget https://github.com/gec/greenbus-modbus/releases/download/v3.0.0/greenbus-modbus-3.0.0.tar.gz
tar -xf greenbus-modbus-3.0.0.tar.gz

Then, copy all files from the module into the installation:

cp -r greenbus-modbus-3.0.0/** greenbus-3.0.0

The module's process is now added to the installation directory:

cd greenbus-3.0.0/
bin/greenbus modbus start