arrow-left

All pages
gitbookPowered by GitBook
1 of 3

Loading...

Loading...

Loading...

Manual Setup

hashtag
Manual Installation

This chapter describes the steps for a manual installation (eg. not using the vagrant script and puppet scripts). This chapter is for developers who would like to have more control over the installation procedure.

With the increased control come increased risks of things not working with the versions or configuration of the software involved with the OSGP environment. If you run into issues, you may find clues in the puppet scripts about versions and modifications to the configuration of installed software.

hashtag
Note

  • Skip this chapter if you followed the Vagrant installation! You can continue with next chapter:

hashtag
Operating System

The Open Smart Grid Platform runs on a Linux environment. It is recommended to set up a machine running Ubuntu.

hashtag
Software and tools

The Open Smart Grid platform needs the following software and tools installed/downloaded:

  • Java 8 openjdk-8

  • PostgreSQL and pgAdmin 3

  • Git

hashtag
Settings

hashtag
User

It is recommended to create a 'dev' user, because some scripts contain hard coded references to this 'dev' user. It is possible to skip this step, but then some of the scripts will have to be adjusted manually.

hashtag
Tomcat

  • Place the PostgreSQL JDBC driver jar in the Tomcat lib directory.

  • Change permissions of Tomcat Config files to 644 in the Tomcat conf directory.

hashtag
Apache HTTPD

  • Enable mod_ssl by running the following command:

  • Enable proxy_ajp by running the following command:

hashtag
Java

  • Make sure the JAVA_HOME var is set, and points to openjdk-8.

hashtag
Cloning Sources

Clone the following repo's, it is recommended to create a Sources/OSGP directory in /home/dev/ since some scripts contain hard coded references to those folders.

Make sure you are on the development branch (default).

hashtag
Creating directories and symlinks

Create the following directories:

  • /var/log/osp/logs

  • /etc/osp/

Make the dev user (or equivalent) the owner of the log directory with rwx permission. Give the other users read and execute permission.

Execute the script /home/dev/Sources/OSGP/Config/scripts/create-symlinks.sh

Note This script uses hard coded references to /home/dev/Sources/OSGP/*, if you used a different user, please edit the script before executing it.

The script will make symlinks to certificates, to Apache HTTP server configuration and copy configuration settings as samples to locations where these properties may be overridden.

hashtag
Initiating the Database

To create the database run the following command (Change /home/dev/ in case of no dev user)

And create a backup of the pg_hba.conf file (modify if your version of PostgreSQL is different)

Finally, reload the postgresql service:

hashtag
Set up the Open Smart Grid Platform

Continue with setting up the Open Smart Grid Platform by following the

Vagrant

hashtag
Installation

This document describes the automatic installation procedure for your Open Smart Grid Platform development environment.

hashtag

Installation

To install the platform you can use one of the following procedures.

  1. The Vagrant Installation. This procedure creates and installs a complete image with the Open Smart Grid Platform pre-installed, including all the tools such as Maven, Eclipse, SoapUI, etc.

  2. The Manual Installation. Follow this guide if you want to install the Open Smart Grid Platform yourself.

Maven

  • ActiveMQ

  • Tomcat

  • Apache HTTPD

  • SoapUi

  • Eclipse IDE for Java EE Developers

  • Google Protocol Buffers: protobuf-compiler, libprotoc7 and libprotobuf7

  • PostgreSQL JDBC driverarrow-up-right

  • Setup the Open Smart grid Platform
    Set up the Open Smart Grid Platform Guide
    a2enmod ssl
    a2enmod proxy_ajp
    git clone https://github.com/OSGP/Config.git /home/dev/Sources/OSGP/Config
    git clone https://github.com/OSGP/open-smart-grid-platform.git /home/dev/Sources/OSGP/open-smart-grid-platform
    git clone https://github.com/OSGP/Documentation.git /home/dev/Sources/OSGP/Documentation
    sudo -u postgres /usr/bin/psql -p 5432 -f /home/dev/Sources/OSGP/Config/sql/create-users-and-databases.sql
    cp -p /etc/postgresql/9.4/main/pg_hba.conf /etc/postgresql/9.4/main/pg_hba.backup
    service postgresql reload
    Manual installation

    If you would like to follow the manual installation procedure, please proceed to the Manual Installation Chapter.

    hashtag
    Overview

    Creating a Virtual Machine using Virtual Box and Vagrant

    To improve the usability of the Installation process, a Vagrant file and some puppet scripts are used to automatically set-up an virtual Open Smart Grid Platform development environment. The following steps will describe how to install VirtualBox, Vagrant and kick off the procedure by running the vagrant up command.

    hashtag
    System Requirements

    The following system requirements are recommended:

    • Core i5/i7 ~2.5GHz Dual Core, Quad Core recommended

    • At least 16 GB RAM, 32 GB RAM recommended

    • At least 20 GB free space, 50 GB free space recommended

    The installation procedure has been tested on Windows 10.

    hashtag
    Install Vagrant and VirtualBox

    Start by downloading VirtualBox by going to https://www.virtualbox.org/wiki/Downloadsarrow-up-right And follow the installation steps.

    note: If you already have VirtualBox, make sure it is at least version 6.1.38

    alt text

    note: Check whether Virtualbox stores the images on a drive with enough free space. (Open Oracle VM VirtualBox Manager -> Preferences -> General -> Default Machine Folder).

    Now download and install Vagrant. Vagrant is available at the following URL: https://www.vagrantup.com/downloads.htmlarrow-up-right

    alt text

    note: If you already have Vagrant, make sure it is at least version 2.3.0 Complete the installation and restart your PC.

    note: If you did a fresh install of Vagrant and already had a command prompt open, make sure you close this command prompt and open it again.

    hashtag
    Tip

    • Remember to enable Virtualization in your system BIOS.

    • Also disable Hyper-V in Windows (can be found in Windows Features)

    hashtag
    Download and run the Vagrant file

    First create a new directory (for example: D:\My Vagrant Images\OSGP Development\)

    Browse to https://github.com/OSGP/Config/tree/development/vagrantarrow-up-right and save the png image and Vagrantfile files in your newly created directory.

    alt text

    hashtag
    Note

    • Make sure that the file is named like this: Vagrantfile without an extension!

    • If the file has an extension (for example .txt) you can rename the file using the following console command.

      MacOS/Linux:

      Windows:

    Now open a Command Prompt and navigate to the newly created directory where you just put the files. Make sure that you run the Command Prompt using administrator rights.

    note: When you open the Vagrantfile you see that default the image is configured to run in virtualbox with 2 cpu cores and 8192 MB of RAM. If you need to you can change this to more or less cpu cores and RAM, but it is recommended to use the provided settings.

    Run the following command: vagrant up

    note: In case of error bad uri Images/OSGP Development/hashicorp/itc/itc-ubuntu-mate-20.04-amd64 then use the following command;

    • vagrant destroy

    • vagrant box add itc/itc-ubuntu-mate-20.04-amd64

    • vagrant up

    note: In case of an error complaining about not being able to resolve a URL (for instance to github.com) then try using a different internet connection not behind a proxy.

    alt text

    Vagrant will now automatically download an Ubuntu image (+- 2.6 Gb), create a virtualbox image from it and run the installation puppet script when finished. This might take a while, depending on your internet speed. After some time (while the script is still running) you will notice that a window with an Ubuntu Virtual Machine pops-up. Don't log in yet, wait until the script in the Console is finished.

    alt text

    hashtag
    Tip

    • If the script fails for some reason (eg. Errors in the console such as time outs during downloading), you can retry the procedure by running the following command vagrant destroy && vagrant up

    Now that the script has ran its course, it will automatically log in on the Ubuntu virtual machine as user dev.

    note: For some actions, like sudo, you will have to enter the password of user dev. The password for user dev is dev.

    hashtag
    Optimize your Open Smart Grid Platform Development virtualbox image.

    At this point you also can adjust the virtualbox settings like cpus and memory size. If you don't want to adjust this proceed to Chapter 2.1.2. Platform Setup.

    If you do want to update the virtualbox settings for this image, shut down the image first:

    alt text

    Once the machine has been Shut Down, open VirtualBox and right click on the new virtual machine (called "OSGP Development") and select Settings. Go to System and increase the Base Memory of the system to at least 6144 MB (6 GB) (or the maximum recommended (in green) amount for your system).

    alt text

    Now go to the Processor Tab and increase the amount of Processors to the maximum recommended (in green) amount.

    alt text

    Close the Settings window and Start the Virtual Machine again. Once it is booted, you should be automatically logged in as the 'dev' user.

    hashtag
    Post actions

    In order to use git correctly you need to execute the following commands in a terminal:

    hashtag
    Recap

    You just created a virtual machine running Ubuntu with pre-installed tooling. Proceed with Platform Setup of the guide describing how to set-up the open smart grid platform.

    mv Vagrantfile.txt Vagrantfile
    move Vagrantfile.txt Vagrantfile
    git config --global user.name "your full name"
    git config --global user.email yourEmailAddress